public abstract class AbstractPlugin extends java.lang.Object implements Plugin
AbstractPlugin
class is used to provide common implementations of the plug-in methods needed to overcome the issues caused by the use
of virtual proxy wrappers (see Plugin
for more
details). Since this class is abstract, developers will need to extend one of this classes sub-classes to make use of this functionality.Constructor and Description |
---|
AbstractPlugin() |
Modifier and Type | Method and Description |
---|---|
<P extends Plugin> |
castTo(java.lang.Class<P> pluginInterface)
An alternative to Java's class casting mechanism that is needed because BladeRunnerJS wraps plug-ins within virtual proxy
wrappers, preventing class casting from working.
|
void |
close()
Invoked during the invocation of
BRJS.close() , offering plug-ins a chance to release any resources they may be holding on to. |
boolean |
equals(java.lang.Object otherPlugin) |
java.lang.Class<?> |
getPluginClass()
An alternative to Java's
Object.getClass() method that is needed because BladeRunnerJS wraps plug-ins within virtual proxy
wrappers, causing the native Object.getClass() method to become ineffective. |
<P extends Plugin> |
instanceOf(java.lang.Class<P> pluginInterface)
An alternative to Java's
instanceof operator that is needed because BladeRunnerJS wraps plug-ins within virtual proxy
wrappers, causing the native instanceof operator to become ineffective. |
public boolean equals(java.lang.Object otherPlugin)
equals
in class java.lang.Object
public void close()
Plugin
BRJS.close()
, offering plug-ins a chance to release any resources they may be holding on to.public <P extends Plugin> boolean instanceOf(java.lang.Class<P> pluginInterface)
Plugin
instanceof
operator that is needed because BladeRunnerJS wraps plug-ins within virtual proxy
wrappers, causing the native instanceof
operator to become ineffective.
Plug-ins are not expected to implement this method themselves, and should instead extend one of the AbstractPlugin
sub-classes (e.g. AbstractCommandPlugin
).
instanceOf
in interface Plugin
P
- Any pluginpluginInterface
- The interface which this object may, or may not be, an instance of.true
, if this object is an instance of the given interface, and false
otherwise.public <P extends Plugin> P castTo(java.lang.Class<P> pluginInterface)
Plugin
Plug-ins are not expected to implement this method themselves, and should instead extend one of the AbstractPlugin
sub-classes (e.g. AbstractCommandPlugin
).
public java.lang.Class<?> getPluginClass()
Plugin
Object.getClass()
method that is needed because BladeRunnerJS wraps plug-ins within virtual proxy
wrappers, causing the native Object.getClass()
method to become ineffective.
Plug-ins are not expected to implement this method themselves, and should instead extend one of the AbstractPlugin
sub-classes (e.g. AbstractCommandPlugin
).
getPluginClass
in interface Plugin