com.caucho.boot
Class WatchdogServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by com.caucho.hessian.server.HessianServlet
          extended by com.caucho.boot.WatchdogServlet
All Implemented Interfaces:
WatchdogAPI, java.io.Serializable, Servlet, ServletConfig

public class WatchdogServlet
extends HessianServlet
implements WatchdogAPI

Process responsible for watching a backend server.

See Also:
Serialized Form

Constructor Summary
WatchdogServlet()
           
 
Method Summary
 void init()
          Initialize the servlet.
 void kill(java.lang.String password, java.lang.String serverId)
          Kills the named server, terminating the process.
 void restart(java.lang.String password, java.lang.String serverId, java.lang.String[] argv)
          Restarts the server with the given arguments.
 boolean shutdown(java.lang.String password)
          Shuts the entire watchdog manager down.
 void start(java.lang.String password, java.lang.String[] argv)
          Starts the server with the given arguments.
 java.lang.String status(java.lang.String password)
          Returns the status of the watchdog manager
 void stop(java.lang.String password, java.lang.String serverId)
          Stops the named server
 
Methods inherited from class com.caucho.hessian.server.HessianServlet
createHessian2Input, getAPIClass, getSerializerFactory, getServletInfo, init, service, setAPIClass, setDebug, setHome, setHomeAPI, setLogName, setObject, setObjectAPI, setSendCollectionType, setSerializerFactory, setService
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, log, log, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WatchdogServlet

public WatchdogServlet()
Method Detail

init

public void init()
Description copied from class: GenericServlet
Initialize the servlet. Servlets should override this method if they need any initialization like opening pooled database connections.

Overrides:
init in class GenericServlet

status

public java.lang.String status(java.lang.String password)
                        throws ConfigException,
                               java.lang.IllegalStateException
Description copied from interface: WatchdogAPI
Returns the status of the watchdog manager

Specified by:
status in interface WatchdogAPI
Parameters:
password - the watchdog password
Returns:
a user-readable status report
Throws:
ConfigException
java.lang.IllegalStateException

start

public void start(java.lang.String password,
                  java.lang.String[] argv)
           throws ConfigException,
                  java.lang.IllegalStateException
Description copied from interface: WatchdogAPI
Starts the server with the given arguments. If the start fails, a ConfigException is thrown.

Specified by:
start in interface WatchdogAPI
Throws:
ConfigException
java.lang.IllegalStateException

restart

public void restart(java.lang.String password,
                    java.lang.String serverId,
                    java.lang.String[] argv)
Description copied from interface: WatchdogAPI
Restarts the server with the given arguments.

Specified by:
restart in interface WatchdogAPI
Parameters:
password - watchdog password
serverId - the server to be restarted
argv - the new arguments for the server

stop

public void stop(java.lang.String password,
                 java.lang.String serverId)
Description copied from interface: WatchdogAPI
Stops the named server

Specified by:
stop in interface WatchdogAPI
Parameters:
password - the watchdog password
serverId - the server to stop

kill

public void kill(java.lang.String password,
                 java.lang.String serverId)
Description copied from interface: WatchdogAPI
Kills the named server, terminating the process.

Specified by:
kill in interface WatchdogAPI
Parameters:
password - the watchdog password
serverId - the server to kill

shutdown

public boolean shutdown(java.lang.String password)
Description copied from interface: WatchdogAPI
Shuts the entire watchdog manager down.

Specified by:
shutdown in interface WatchdogAPI
Returns:
true on success