GitXplorerGitXplorer
v

HoTea

public
13 stars
1 forks
1 issues

Commits

List of commits on branch master.
Unverified
1fe7a389b507b16342e332a5e1cb9d74c62b405e

Bump guava from 31.1-jre to 32.0.0-jre in /ch.vorburger.hotea

ddependabot[bot] committed 2 years ago
Verified
d5b51363ad614d90b55808d8d8974964e70f8ad9

Add https://pf4j.org to README

vvorburger committed 2 years ago
Verified
f0be2ec78fa9f32652dce6c12f2d5a2bb452cd60

Bump fswatch from 1.1.0 to 1.2.0

vvorburger committed 3 years ago
Unverified
54edc020e5392ff74521fc8f8d8af85a5c950fbf

Make License Headers not be JavaDoc

vvorburger committed 3 years ago
Unverified
e8e2290d9879bcd13531fe983a97b1662d12ae16

Add missing license header

vvorburger committed 3 years ago
Unverified
f6d229afa0bf792b0ff52ffa1c587e1db4ab1836

rpl -R "(C) 2015" "(C) 2015 - 2022" .

vvorburger committed 3 years ago

README

The README file for this repository.

Hot Chai (tea) with Java coffee (ch.vorburger.hotea)

Hotea is a "kept it simple and stupid" (KISS) Java Mod-ules/Plug-In mini framework with HOT Class reloading to "support dynamic script like source code" (through isolated ClassLoader/s). This may be of interest and useful to you to build things ranging from e.g. plugins for game engines to perhaps some sort of runtime changeable coded out "business rule" stuff.

https://github.com/vorburger/HoTea/blob/master/ch.vorburger.hoteajava/ch/vorburger/hotea/examples/swing/HotSwingExampleMain.java

Caveat emptor: This is intended for and best works with simple plugin-like scenarios, where the classpath of each such plugin does not overlap nor need to share instances among different plugins. In more interesting use cases, by experience, Very Weired Things (VWT) may happen if you don't fully understand what you are actually doing when several class loaders are involved in Java. You have been warned.

See also follow-up projects ch.vorburger.osgi.gradle and ch.vorburger.minecraft.osgi.

Features

Features, what this project does do:

  • Load Java byte code for additional *.classes from directory/-ies and/or JARs, through a child ClassLoader
  • Hot reload such extensions/modules/plugins/bundles whenever any files in the watched classpath directory are updated
  • Notify your code whenever it hot reloaded, so that you can do what you need to do in your code (say cleanly shut down previous instances of your classes, and re-instantiate objects using your new class definitions)
  • No need to follow a particular "Plugin API" at all (of Hotea, there is none) - you can hot (re)load any class implementing any of your own "API" interface

Non-Features, what it does NOT do, not today and not planned:

  • Hot-reload classes on your (already loaded) "main" primary classpath - no JVM Agent
  • Dependencies between modules/plugins/bundles (perhaps you want to look at OSGi?)
  • Versioning of modules/plugins/bundles (perhaps you want to look at OSGi?)
  • Repositories, remote provisioning, etc.
  • Remote API export etc.

Other Projects

Approaches which hot-reload classes on your (already loaded) "main" primary classpath typically through a custom JVM Agent (with more or less limitations)

Other extensions/modules/plugins/bundles frameworks

Scripting

Related articles

History

The watchdir utility is now a separate project, see https://github.com/vorburger/ch.vorburger.fswatch.

The Minecraft specific part was in minecraft/ module. This project now focuses on a general library that is not Minecraft related. (Which the Minecraft module used this in 2017. Since changes made when picking up this project in 2022, the original Minecraft demo is broken; however work has now started to add the equivalent funcationality into https://github.com/OASIS-learn-study/minecraft-storeys-maker, see its issue #58.

Use of Java 8 is recommended to avoid PermGen memory issues due to Class reloading.