Class PluginThread
java.lang.Object
ecmwf.common.technical.ThreadService.ConfigurableRunnable
ecmwf.common.plugin.PluginThread
- All Implemented Interfaces:
MBeanService
,Runnable
- Direct Known Subclasses:
HttpPlugin
,HttpPlugin
,MqttPlugin
,ServerPlugin
public abstract class PluginThread
extends ThreadService.ConfigurableRunnable
implements MBeanService
The Class PluginThread.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPluginThread
(String ref, Map<String, String> params) Instantiates a new plugin thread. -
Method Summary
Modifier and TypeMethodDescriptionvoid
callerBack
(boolean reset) Caller back.void
Caller gone.void
Configurable run.getAttribute
(String attributeName) Gets the attribute.static <T> T
Gets the caller.Gets the MBean info.final String
Gets the param.Gets the plugin container.abstract String
Gets the plugin name.final String
getRef()
Gets the ref.abstract String
Gets the version.void
handle
(PluginEvent<?> event) Handle.protected final void
handle
(PluginEvent<?>[] events) Handle.Invoke.boolean
setAttribute
(String name, Object value) Sets the attribute.static final void
Sets the caller.void
setPluginContainer
(PluginContainer container) Sets the plugin container.abstract boolean
start()
Start.abstract void
stop()
Stop.final void
Subscribe.final void
unSubscribe
(String eventName) Un subscribe.Methods inherited from class ecmwf.common.technical.ThreadService.ConfigurableRunnable
execute, execute, getContextClassLoader, getPriority, getThreadName, interrupt, interrupted, isAlive, isStarted, join, join, run, setContextClassLoader, setForceCookie, setInheritCookie, setPriority, setThreadNameAndCookie
-
Field Details
-
_params
-
-
Constructor Details
-
PluginThread
-
-
Method Details
-
callerBack
public void callerBack(boolean reset) Caller back.- Parameters:
reset
- the reset
-
callerGone
public void callerGone()Caller gone. -
getCaller
Gets the caller.- Type Parameters:
T
- the generic type- Parameters:
clazz
- the class- Returns:
- the caller
-
getPluginName
-
getParam
-
getRef
-
getVersion
-
setCaller
Sets the caller.- Parameters:
caller
- the new caller
-
handle
-
handle
-
subscribe
-
unSubscribe
Un subscribe.- Parameters:
eventName
- the event name
-
start
public abstract boolean start()Start.- Returns:
- true, if successful
-
stop
public abstract void stop()Stop. -
getAttribute
Gets the attribute. Gets the attribute.- Specified by:
getAttribute
in interfaceMBeanService
- Parameters:
attributeName
- the attribute name- Returns:
- the attribute
- Throws:
AttributeNotFoundException
- the attribute not found exceptionMBeanException
- the MBean exception
-
getMBeanInfo
Gets the MBean info. Gets the MBean info.- Specified by:
getMBeanInfo
in interfaceMBeanService
- Returns:
- the MBean info
-
getPluginContainer
Gets the plugin container.- Returns:
- the plugin container
-
invoke
public Object invoke(String operationName, Object[] params, String[] signature) throws NoSuchMethodException, MBeanException Invoke. Invoke.- Specified by:
invoke
in interfaceMBeanService
- Parameters:
operationName
- the operation nameparams
- the paramssignature
- the signature- Returns:
- the object
- Throws:
NoSuchMethodException
- the no such method exceptionMBeanException
- the MBean exception
-
setAttribute
public boolean setAttribute(String name, Object value) throws InvalidAttributeValueException, MBeanException Sets the attribute. Sets the attribute.- Specified by:
setAttribute
in interfaceMBeanService
- Parameters:
name
- the namevalue
- the value- Returns:
- true, if successful
- Throws:
InvalidAttributeValueException
- the invalid attribute value exceptionMBeanException
- the MBean exception
-
setPluginContainer
Sets the plugin container.- Parameters:
container
- the new plugin container
-
configurableRun
public void configurableRun()Configurable run. Configurable run.- Specified by:
configurableRun
in classThreadService.ConfigurableRunnable
-