|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.rhq.enterprise.server.agent.EmbeddedAgentBootstrapService
public class EmbeddedAgentBootstrapService
This is an MBean service that can be used to bootstrap a RHQ Agent that is embedded in a RHQ Server. This will create a standalone classloader that will completely isolate the agent from any RHQ Server classloader (other than the top-level system classloader). Note that this service MBean interface does not expose any agent-specific classes to clients and it does not have direct access to any class outside of a select few classes found in the agent jar that is in this service's classpath.
Note that because this service is deployed with the agent jars in it, you must deploy it in exploded form.
| Field Summary |
|---|
| Fields inherited from interface org.rhq.enterprise.server.agent.EmbeddedAgentBootstrapServiceMBean |
|---|
OBJECT_NAME |
| Constructor Summary | |
|---|---|
EmbeddedAgentBootstrapService()
|
|
| Method Summary | |
|---|---|
void |
cleanDataDirectory()
This will clean out the embedded agent's data directory. |
void |
executeAgentPromptCommand(java.lang.String command)
Passes the given prompt command to the agent so it can be executed. |
java.lang.String[] |
getAgentArguments()
Returns the arguments that are passed to the agent's main startup method. |
java.util.Properties |
getAgentConfiguration()
Returns the configuration preferencese the agent is or will be using. |
java.lang.String |
getAgentEnabled()
If true, this indicates that the agent should be started when the JON Server is started. |
java.lang.String |
getConfigurationFile()
Returns the location of the configuration file where all agent preferences are defined. |
java.util.Properties |
getConfigurationOverrides()
Returns a set of properties that will override the configuration preferences. |
java.io.File |
getEmbeddedAgentDirectory()
Indicates the location where the embedded agent and all its resources will be found. |
java.lang.String |
getPreferencesNodeName()
Returns the preferences node name used to identify the configuration set to use. |
java.lang.String |
getResetConfiguration()
Returns true if the embedded agent should reset its configuration at startup. |
boolean |
isAgentStarted()
true indicates that the agent has been started. |
void |
reloadAgentConfiguration()
This will clear any and all current configuration preferences and then reload the configuration file. |
void |
setAgentArguments(java.lang.String[] args)
Sets the arguments that will be passed to the agent's main startup method. |
void |
setAgentEnabled(java.lang.String flag)
If true, this indicates that the agent should be started when the JON Server is started. |
void |
setConfigurationFile(java.lang.String location)
Defines the location of the configuration file where all agent preferences are defined. |
void |
setConfigurationOverrides(java.util.Properties overrides)
This allows you to explicitly override configuration preferences found in the configuration file. |
void |
setEmbeddedAgentDirectory(java.io.File directory)
Indicates the location where the embedded agent and all its resources will be found. |
void |
setPreferencesNodeName(java.lang.String node)
Defines the preferences node name used to identify the configuration set to use. |
void |
setResetConfiguration(java.lang.String flag)
Sets the flag to determine if the agent should reset its configuration to its original configuration as defined in the configuration file, or if it should retain its configuration from when it last ran. |
void |
startAgent()
This starts the agent in a completely isolated classloader in a completely isolated thread. |
void |
stop()
Stops this service - if the agent has been started, it will also be
stopped. |
void |
stopAgent()
Stops the agent. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EmbeddedAgentBootstrapService()
| Method Detail |
|---|
public void startAgent()
throws java.lang.Exception
startAgent in interface EmbeddedAgentBootstrapServiceMBeanjava.lang.Exception - if failed to start the agent successfullyEmbeddedAgentBootstrapServiceMBean.startAgent()
public void stopAgent()
throws java.lang.Exception
EmbeddedAgentBootstrapServiceMBeanthe agent is not enabled or was
never started.
stopAgent in interface EmbeddedAgentBootstrapServiceMBeanjava.lang.Exception - if failed to stop the agent successfully
public void stop()
throws java.lang.Exception
EmbeddedAgentBootstrapServiceMBeanstarted, it will also be
stopped.
stop in interface EmbeddedAgentBootstrapServiceMBeanjava.lang.Exception - if failed to stop the agentpublic boolean isAgentStarted()
EmbeddedAgentBootstrapServiceMBeantrue indicates that the agent has been started. false means the
agent has not been started yet, or it was started but has since been stopped.
isAgentStarted in interface EmbeddedAgentBootstrapServiceMBeanpublic java.lang.String getAgentEnabled()
EmbeddedAgentBootstrapServiceMBeantrue, this indicates that the agent should be started when the JON Server is started. This
service is will not start the agent at its own startup, regardless of the value of this attribute. Instead, this
attribute is examined by the JON Server itself - if the JON Server sees that the embedded agent should be started
at startup, the JON Server will call EmbeddedAgentBootstrapServiceMBean.startAgent().
getAgentEnabled in interface EmbeddedAgentBootstrapServiceMBeanpublic void setAgentEnabled(java.lang.String flag)
EmbeddedAgentBootstrapServiceMBeantrue, this indicates that the agent should be started when the JON Server is started. This
service is will not start the agent at its own startup, regardless of the value of this attribute. Instead, this
attribute is examined by the JON Server itself - if the JON Server sees that the embedded agent should be started
at startup, the JON Server will call EmbeddedAgentBootstrapServiceMBean.startAgent().
setAgentEnabled in interface EmbeddedAgentBootstrapServiceMBeanflag - (a boolean string)public java.lang.String getResetConfiguration()
EmbeddedAgentBootstrapServiceMBeantrue if the embedded agent should reset its configuration at startup. Resetting the
configuration means to clear out any configuration settings currently persisted in the preferences store and
reload the configuration from its configuration file. If false, the embedded agent will retain the
configuration it had when it last was running - which may be different from its original configuration if a user
changed its configuration settings from the UI.
getResetConfiguration in interface EmbeddedAgentBootstrapServiceMBeanpublic void setResetConfiguration(java.lang.String flag)
EmbeddedAgentBootstrapServiceMBeanEmbeddedAgentBootstrapServiceMBean.getResetConfiguration() for more information.
setResetConfiguration in interface EmbeddedAgentBootstrapServiceMBeanpublic java.io.File getEmbeddedAgentDirectory()
EmbeddedAgentBootstrapServiceMBean
lib subdirectory under this directory which will include all jar files that are to be included in the
embedded agent's classloader.
getEmbeddedAgentDirectory in interface EmbeddedAgentBootstrapServiceMBeanpublic void setEmbeddedAgentDirectory(java.io.File directory)
EmbeddedAgentBootstrapServiceMBean
lib subdirectory under this directory which will include all jar files that are to be included in the
embedded agent's classloader.
setEmbeddedAgentDirectory in interface EmbeddedAgentBootstrapServiceMBeandirectory - location of the embedded agent and its resourcespublic java.lang.String getConfigurationFile()
EmbeddedAgentBootstrapServiceMBean
getConfigurationFile in interface EmbeddedAgentBootstrapServiceMBeanpublic void setConfigurationFile(java.lang.String location)
EmbeddedAgentBootstrapServiceMBean
setConfigurationFile in interface EmbeddedAgentBootstrapServiceMBeanpublic java.lang.String getPreferencesNodeName()
EmbeddedAgentBootstrapServiceMBean
getPreferencesNodeName in interface EmbeddedAgentBootstrapServiceMBeanpublic void setPreferencesNodeName(java.lang.String node)
EmbeddedAgentBootstrapServiceMBeanIf this isn't specified, a suitable default will be used.
setPreferencesNodeName in interface EmbeddedAgentBootstrapServiceMBeannode - the name of the Java Preferences node where the agent's configuration will or already livespublic java.util.Properties getConfigurationOverrides()
EmbeddedAgentBootstrapServiceMBeannull,
then the configuration preferences takes effect as-is.
getConfigurationOverrides in interface EmbeddedAgentBootstrapServiceMBeannull)public void setConfigurationOverrides(java.util.Properties overrides)
EmbeddedAgentBootstrapServiceMBean${jboss.server.data.dir}, in the configuration preference values).
setConfigurationOverrides in interface EmbeddedAgentBootstrapServiceMBeanoverrides - configuration settings that override the configuration preferences (may benull)public java.lang.String[] getAgentArguments()
EmbeddedAgentBootstrapServiceMBean
getAgentArguments in interface EmbeddedAgentBootstrapServiceMBeanpublic void setAgentArguments(java.lang.String[] args)
EmbeddedAgentBootstrapServiceMBean
setAgentArguments in interface EmbeddedAgentBootstrapServiceMBean
public void reloadAgentConfiguration()
throws java.lang.Exception
EmbeddedAgentBootstrapServiceMBeanconfiguration file. The agent will need to be restarted for the configuration to
take effect.
reloadAgentConfiguration in interface EmbeddedAgentBootstrapServiceMBeanjava.lang.Exception - if failed to clear and reload the configurationpublic void cleanDataDirectory()
EmbeddedAgentBootstrapServiceMBeanEmbeddedAgentBootstrapServiceMBean.reloadAgentConfiguration()).
cleanDataDirectory in interface EmbeddedAgentBootstrapServiceMBeanpublic java.util.Properties getAgentConfiguration()
EmbeddedAgentBootstrapServiceMBean
getAgentConfiguration in interface EmbeddedAgentBootstrapServiceMBeanpublic void executeAgentPromptCommand(java.lang.String command)
EmbeddedAgentBootstrapServiceMBean
executeAgentPromptCommand in interface EmbeddedAgentBootstrapServiceMBeancommand - the agent prompt command to execute
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||