|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.core.pc.agent.AgentService
public abstract class AgentService
Those plugin container managers that need to expose their interfaces remotely (to the JON Server for example) need to extend this class. This class will know what its remote client interface is (see the constructor) and will be able notify a set of listeners when it is started and stopped (to presumably tell the listeners that they should remote and "unremote" its client interface).
| Nested Class Summary | |
|---|---|
static class |
AgentService.LifecycleState
The different states agent services can be in. |
| Constructor Summary | |
|---|---|
protected |
AgentService(Class clientInterface)
Creates a new AgentService object. |
| Method Summary | |
|---|---|
void |
addLifecycleListener(AgentServiceLifecycleListener listener)
Adds the given listener to the list of listeners that will be notified when this agent service changes its state (i.e. |
Class |
getClientInterface()
Returns the interface that this agent service wants to be made remotely accessible to external clients. |
void |
notifyLifecycleListenersOfNewState(AgentService.LifecycleState newState)
This is called when the agent service changes its state - it will notify all listeners of
the changed state. |
protected InputStream |
remoteInputStream(InputStream inputStream)
Given any input stream, this will attempt to remote it using the stream remoter, thus providing access to
external clients. |
protected OutputStream |
remoteOutputStream(OutputStream outputStream)
Given any output stream, this will attempt to remote it using the stream remoter, thus providing access to
external clients. |
void |
removeLifecycleListener(AgentServiceLifecycleListener listener)
Removes the given listener so it is no longer notified of changed states. |
void |
setAgentServiceStreamRemoter(AgentServiceStreamRemoter remoter)
Sets the remoter object that is responsible for remoting streams. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AgentService(Class clientInterface)
AgentService object.
clientInterface - the client interface that this agent service wants to make remotely accessible to external
clients| Method Detail |
|---|
public void notifyLifecycleListenersOfNewState(AgentService.LifecycleState newState)
state - it will notify all listeners of
the changed state.
newState - protected InputStream remoteInputStream(InputStream inputStream)
stream remoter, thus providing access to
external clients. If there is no remoter available, the same input stream instance passed into this method is
returned as-is.
If inputStream is null, null is returned.
inputStream - the input stream to remote
protected OutputStream remoteOutputStream(OutputStream outputStream)
stream remoter, thus providing access to
external clients. If there is no remoter available, the same output stream instance passed into this method is
returned as-is.
If outputStream is null, null is returned.
outputStream - the output stream to remote
public void addLifecycleListener(AgentServiceLifecycleListener listener)
listener - public void removeLifecycleListener(AgentServiceLifecycleListener listener)
listener - public void setAgentServiceStreamRemoter(AgentServiceStreamRemoter remoter)
null, the agent service will
not be able to remote streams to external clients, as in the case when the plugin container is not running inside
an agent (i.e. embedded mode).
remoter - public Class getClientInterface()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||