public final class EspressoHotSwap extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
registerClassInitHotSwap(Class<?> klass,
boolean onChange,
HotSwapAction action)
Registration of a HotSwap action that is fired if the
klass or any subclass thereof
has a changed static initializer. |
static boolean |
registerHotSwapAction(Class<?> klass,
HotSwapAction action)
Registration of a HotSwap action that will be fired in case the
klass changes. |
static boolean |
registerMetaInfServicesListener(Class<?> serviceType,
ClassLoader loader,
HotSwapAction action)
Registration of a HotSwap action that will be fired if changes are detected to the declared
META-INF/services for
serviceType. |
static boolean |
registerPlugin(HotSwapPlugin plugin)
Registration of a HotSwap plugin for which all generic actions are fired during HotSwap.
|
static boolean |
registerPostHotSwapAction(HotSwapAction action)
Registration of a generic post HotSwap action that will be fired after class redefinition
completed.
|
static boolean |
registerResourceListener(ClassLoader loader,
String resource,
HotSwapAction action)
Registration of a HotSwap action that will be fired if changes are detected to the specified
resource.
|
public static boolean registerPlugin(HotSwapPlugin plugin)
HotSwapPlugin.postHotSwap(Class[]) that is fired for a
registered plugin.
Note: The Plugin API is expected to change to allow plugins to receive finer-grained changes.plugin - the plugin to registerpublic static boolean registerPostHotSwapAction(HotSwapAction action)
action - the action to firepublic static boolean registerHotSwapAction(Class<?> klass, HotSwapAction action)
klass changes.action - the action to firepublic static boolean registerClassInitHotSwap(Class<?> klass, boolean onChange, HotSwapAction action)
klass or any subclass thereof
has a changed static initializer. Use onChange to control if the action should only
fire when the static initializer actually changed.klass - the class instanceonChange - if action should be fired only when the static initializer changesaction - the action to firepublic static boolean registerResourceListener(ClassLoader loader, String resource, HotSwapAction action) throws IOException
loader - the class loader to lookup the service typeresource - the resource to register a change listener onaction - the action to fireIOExceptionpublic static boolean registerMetaInfServicesListener(Class<?> serviceType, ClassLoader loader, HotSwapAction action) throws IOException
serviceType.serviceType - the class instance of the service typeloader - the class loader to lookup the service typeaction - the action to fireIOException