public.javadoc.org.spincast.plugins.hotswap.classeswatcher.HotSwapClassesRedefinitionsWatcherDefault.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
HotSwapClassesRedefinitionsWatcherDefault (org.spincast:spincast-framework 1.0.0 API)
org.spincast.plugins.hotswap.classeswatcher
Class HotSwapClassesRedefinitionsWatcherDefault
- java.lang.Object
-
- org.spincast.plugins.hotswap.classeswatcher.HotSwapClassesRedefinitionsWatcherDefault
-
- All Implemented Interfaces:
- HotSwapClassesRedefinitionsWatcher
@Plugin(name="HotSwapClassesRedefinitionsWatcher",
testedVersions="")
public class HotSwapClassesRedefinitionsWatcherDefault
extends Object
implements HotSwapClassesRedefinitionsWatcher
The instance of this class will be created by
HotSwap Agent.
We bind it to the Guice context using
toInstance()
and this will inject
the required dependencies on members
("@Inject" annotated), directly.
-
-
Field Summary
Fields
Modifier and Type
Field and Description
protected static org.slf4j.Logger
logger
protected org.hotswap.agent.command.Scheduler
scheduler
This will be called by HotSwap Agent to inject
the Scheduler instance.
protected static String
THIS_CLASS_NAME
-
Constructor Summary
Constructors
Constructor and Description
HotSwapClassesRedefinitionsWatcherDefault()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
void
classRedefined(Class<?> classBeingRedefined)
Listen to redefinitions of any class.
protected Map<Class<?>,Set<HotSwapClassesRedefinitionsListener>>
getListenersByClassToWatch()
protected org.hotswap.agent.command.Scheduler
getScheduler()
protected SpincastConfig
getSpincastConfig()
void
guiceInjected()
Flag to know that dependencies
have been injected by Guice.
static void
init(org.hotswap.agent.javassist.CtClass ctClass)
protected boolean
isGuiceInjected()
void
registerListener(HotSwapClassesRedefinitionsListener listener)
Add a new listener for modifications to class
redefinitions.
void
removeAllListeners()
Removes all listeners.
void
removeListener(HotSwapClassesRedefinitionsListener listener)
Removes a listener.
void
setBoundListerns(Set<HotSwapClassesRedefinitionsListener> boundListeners)
Guice injects the bound listeners
-
-
Field Detail
-
logger
protected static final org.slf4j.Logger logger
-
THIS_CLASS_NAME
protected static final String THIS_CLASS_NAME
- See Also:
- Constant Field Values
-
scheduler
@Init
protected org.hotswap.agent.command.Scheduler scheduler
This will be called by HotSwap Agent to inject
the Scheduler instance.
-
Constructor Detail
-
HotSwapClassesRedefinitionsWatcherDefault
public HotSwapClassesRedefinitionsWatcherDefault()
-
Method Detail
-
guiceInjected
@Inject
public void guiceInjected()
Flag to know that dependencies
have been injected by Guice.
-
isGuiceInjected
protected boolean isGuiceInjected()
-
getScheduler
protected org.hotswap.agent.command.Scheduler getScheduler()
-
getSpincastConfig
protected SpincastConfig getSpincastConfig()
-
setBoundListerns
@Inject
public void setBoundListerns(@Nullable
Set<HotSwapClassesRedefinitionsListener> boundListeners)
Guice injects the bound listeners
-
getListenersByClassToWatch
protected Map<Class<?>,Set<HotSwapClassesRedefinitionsListener>> getListenersByClassToWatch()
-
init
@OnClassLoadEvent(classNameRegexp="org.spincast.plugins.hotswap.classeswatcher.HotSwapClassesRedefinitionsWatcherDefault",
events=DEFINE)
public static void init(org.hotswap.agent.javassist.CtClass ctClass)
throws org.hotswap.agent.javassist.NotFoundException,
org.hotswap.agent.javassist.CannotCompileException
- Throws:
org.hotswap.agent.javassist.NotFoundException
org.hotswap.agent.javassist.CannotCompileException
-
registerListener
public void registerListener(HotSwapClassesRedefinitionsListener listener)
Description copied from interface: HotSwapClassesRedefinitionsWatcher
Add a new listener for modifications to class
redefinitions.
More than one listeners can be added for the same class!
- Specified by:
registerListener
in interface HotSwapClassesRedefinitionsWatcher
-
removeListener
public void removeListener(HotSwapClassesRedefinitionsListener listener)
Description copied from interface: HotSwapClassesRedefinitionsWatcher
Removes a listener.
- Specified by:
removeListener
in interface HotSwapClassesRedefinitionsWatcher
-
removeAllListeners
public void removeAllListeners()
Description copied from interface: HotSwapClassesRedefinitionsWatcher
Removes all listeners.
- Specified by:
removeAllListeners
in interface HotSwapClassesRedefinitionsWatcher
-
classRedefined
@OnClassLoadEvent(classNameRegexp=".+",
events=REDEFINE)
public void classRedefined(Class<?> classBeingRedefined)
Listen to redefinitions of any class.
Copyright © 2019. All rights reserved.