org.hyperic.hq.product
Class ServerControlPlugin
java.lang.Object
org.hyperic.hq.product.GenericPlugin
org.hyperic.hq.product.ControlPlugin
org.hyperic.hq.product.ServerControlPlugin
- Direct Known Subclasses:
- MxServerControlPlugin, ScriptControlPlugin
public abstract class ServerControlPlugin
- extends ControlPlugin
This class is mainly helpful for control plugins which are
script/process driven.
Fields inherited from class org.hyperic.hq.product.ControlPlugin |
DEFAULT_TIMEOUT, manager, PROP_TIMEOUT, RESULT_FAILURE, RESULT_SUCCESS, STATE_RESTARTING, STATE_STARTED, STATE_STARTING, STATE_STOPPED, STATE_STOPPING, STATE_UNKNOWN |
Methods inherited from class org.hyperic.hq.product.ControlPlugin |
detectState, doAction, doAction, getActions, getManager, getMessage, getResult, getTimeout, getTimeoutMillis, init, setManager, setMessage, setResult, setTimeout, setTimeout, waitForState |
Methods inherited from class org.hyperic.hq.product.GenericPlugin |
adjustClassPath, getAbsoluteFiles, getConfig, getConfig, getCustomPropertiesSchema, getCustomPropertiesSchema, getCustomPropertiesSchema, getDefaultInstallPath, getLog, getLogName, getManagerProperty, getName, getPlatformName, getPluginClassName, getPluginData, getPluginProperty, getProductPlugin, getProperties, getScriptExtension, getScriptExtension, getScriptExtension, getTypeInfo, getTypeNameProperty, getTypeNameProperty, getTypeProperties, getTypeProperty, getTypeProperty, getTypeProperty, isNetStatEnabled, isWin32, openResource, setData, setName, setTypeInfo, toFileList |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PROP_PIDFILE
public static final java.lang.String PROP_PIDFILE
- See Also:
- Constant Field Values
PROP_PROGRAM
public static final java.lang.String PROP_PROGRAM
- See Also:
- Constant Field Values
PROP_PROGRAMPREFIX
public static final java.lang.String PROP_PROGRAMPREFIX
- See Also:
- Constant Field Values
ServerControlPlugin
public ServerControlPlugin()
getInstallPrefix
public java.lang.String getInstallPrefix()
setInstallPrefix
public void setInstallPrefix(java.lang.String val)
getControlProgram
public java.lang.String getControlProgram()
setControlProgram
public void setControlProgram(java.lang.String val)
getControlProgramPrefix
public java.lang.String getControlProgramPrefix()
setControlProgramPrefix
public void setControlProgramPrefix(java.lang.String val)
getPidFile
public java.lang.String getPidFile()
setPidFile
public void setPidFile(java.lang.String val)
useSigar
protected boolean useSigar()
configure
public void configure(ConfigResponse config)
throws PluginException
- Overrides:
configure
in class GenericPlugin
- Throws:
PluginException
shutdown
public void shutdown()
throws PluginException
- Description copied from class:
GenericPlugin
- Called when the server or agent is shutdown.
Use this method to cleanup any resources that were created
during the init() method.
- Overrides:
shutdown
in class GenericPlugin
- Throws:
PluginException
getServerConfigSchema
protected void getServerConfigSchema(TypeInfo info,
ConfigSchema schema,
ConfigResponse response)
getConfigSchema
public ConfigSchema getConfigSchema(TypeInfo info,
ConfigResponse config)
- Description copied from class:
GenericPlugin
- The ConfigSchema used to render config options for this resource
in the UI and client shell.
- Overrides:
getConfigSchema
in class ControlPlugin
- Parameters:
info
- The TypeInfo of this plugin from ProductPlugin.getTypesconfig
- ConfigReponse of the parent resource (if any).
- Returns:
- ConfigSchema for this resource.
useConfigSchema
protected boolean useConfigSchema(TypeInfo info)
isRunning
protected boolean isRunning()
- Overrides:
isRunning
in class ControlPlugin
isProcessRunning
protected boolean isProcessRunning(int pid)
isProcessRunning
protected boolean isProcessRunning(java.lang.String pidFile)
getWorkingDirectory
protected java.io.File getWorkingDirectory()
getControlProgramDir
protected java.lang.String getControlProgramDir()
validateControlProgram
protected void validateControlProgram(java.lang.String name)
throws PluginException
- Throws:
PluginException
isBackgroundCommand
protected boolean isBackgroundCommand()
getBackgroundWaitTime
protected int getBackgroundWaitTime()
- Returns:
- Seconds to wait on a background process
setBackgroundWaitTime
protected void setBackgroundWaitTime(int seconds)
getCommandArgs
protected java.lang.String[] getCommandArgs()
- Override to add any additional arguments to the command line.
getCommandEnv
protected java.lang.String[] getCommandEnv()
- Override to pass any addition environment variables to the command.
doCommand
protected int doCommand()
doCommand
protected int doCommand(java.lang.String command)
doCommand
protected int doCommand(java.lang.String[] args)
doCommand
protected int doCommand(java.lang.String program,
java.lang.String arg)
doCommand
protected int doCommand(java.lang.String program,
java.lang.String[] params)
getExitCode
protected int getExitCode()
- Returns:
- program exit code from doCommand()
handleResult
protected void handleResult(java.lang.String stateWanted)
start
protected int start(java.lang.String command)
Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.