net.hyperic.hq.product
Class ServerControlPlugin
java.lang.Object
net.hyperic.hq.product.GenericPlugin
net.hyperic.hq.product.ControlPlugin
net.hyperic.hq.product.ServerControlPlugin
- public abstract class ServerControlPlugin
- extends ControlPlugin
This class is mainly helpful for control plugins which are
script/process driven.
Fields inherited from class net.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 net.hyperic.hq.product.ControlPlugin |
detectState, doAction, getActions, getErrorStr, getManager, getResult, getTimeout, getTimeoutMillis, init, setErrorStr, setManager, setResult, setTimeout, setTimeout, waitForState |
Methods inherited from class net.hyperic.hq.product.GenericPlugin |
getAbsoluteFiles, getConfig, getConfig, getCustomPropertiesSchema, getCustomPropertiesSchema, getCustomPropertiesSchema, getDefaultInstallPath, getLog, getLogName, getName, getPlatformName, getPluginClassName, getProductPlugin, getProperties, getProperty, getTypeInfo, getTypeNameProperty, getTypeNameProperty, getTypeProperty, getTypeProperty, getTypeProperty, isWin32, openResource, 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
stdOut
protected java.io.ByteArrayOutputStream stdOut
stdErr
protected java.io.ByteArrayOutputStream stdErr
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
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)
doCommand
protected int doCommand(java.lang.String command)
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()
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(java.lang.String program,
java.lang.String command)
handleResult
protected void handleResult(int result,
java.lang.String stateWanted)
start
protected int start(java.lang.String command)
Copyright © 2004-2005 Hyperic LLC support@hyperic.net, All Rights Reserved.