org.wso2.wsas.admin.service
Class ServerAdmin

java.lang.Object
  extended by org.wso2.utils.AbstractAdmin
      extended by org.wso2.wsas.admin.service.ServerAdmin
All Implemented Interfaces:
ServerAdminMBean

public class ServerAdmin
extends org.wso2.utils.AbstractAdmin
implements ServerAdminMBean

Admin service to manage server related operations


Constructor Summary
ServerAdmin()
           
 
Method Summary
 void endMaintenance()
          Method to change the state of a node from "maintenance" to "normal"
 ServerData getServerData()
           
 java.lang.String getServerDataAsString()
          Get information about this WSAS instance
 java.lang.String getServerStatus()
          Get the current status of this WSAS instance
 java.lang.String getServerVersion()
          Get the version of this WSAS instance
 ServerStatus getStatus()
           
 boolean isAlive()
          Method to check whether this WSAS instance is alive
 void restart()
          Forcefully restart this WSAS instance
 void restartGracefully()
          Gracefully restart this WSAS instance.
 void shutdown()
          Forcefully shutdown this WSAS instance
 void shutdownGracefully()
          Gracefully shutdown this WSAS instance All client connections will be served before shutting down the server
 void startMaintenance()
          Method to switch a node to maintenance mode.
 
Methods inherited from class org.wso2.utils.AbstractAdmin
getAxisConfig, getConfigContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerAdmin

public ServerAdmin()
Method Detail

getServerData

public ServerData getServerData()
                         throws org.apache.axis2.AxisFault
Throws:
org.apache.axis2.AxisFault

getServerDataAsString

public java.lang.String getServerDataAsString()
                                       throws java.lang.Exception
Description copied from interface: ServerAdminMBean
Get information about this WSAS instance

Specified by:
getServerDataAsString in interface ServerAdminMBean
Returns:
The server information as a string
Throws:
java.lang.Exception - If an error occurred while retrieving server information

getServerVersion

public java.lang.String getServerVersion()
Description copied from interface: ServerAdminMBean
Get the version of this WSAS instance

Specified by:
getServerVersion in interface ServerAdminMBean
Returns:
The version of this WSAS instance

getStatus

public ServerStatus getStatus()
                       throws org.apache.axis2.AxisFault
Throws:
org.apache.axis2.AxisFault

restart

public void restart()
Description copied from interface: ServerAdminMBean
Forcefully restart this WSAS instance

Specified by:
restart in interface ServerAdminMBean

restartGracefully

public void restartGracefully()
Description copied from interface: ServerAdminMBean
Gracefully restart this WSAS instance. All client connections will be served before restarting the server

Specified by:
restartGracefully in interface ServerAdminMBean

shutdown

public void shutdown()
Description copied from interface: ServerAdminMBean
Forcefully shutdown this WSAS instance

Specified by:
shutdown in interface ServerAdminMBean

shutdownGracefully

public void shutdownGracefully()
Description copied from interface: ServerAdminMBean
Gracefully shutdown this WSAS instance All client connections will be served before shutting down the server

Specified by:
shutdownGracefully in interface ServerAdminMBean

startMaintenance

public void startMaintenance()
                      throws java.lang.Exception
Description copied from interface: ServerAdminMBean
Method to switch a node to maintenance mode.

Here is the sequence of events:

  • Client calls this method
  • The server stops accepting new requests/connections, but continues to stay alive so that old requests & connections can be served
  • Once all requests have been processed, the method returns
  • Specified by:
    startMaintenance in interface ServerAdminMBean
    Throws:
    java.lang.Exception - If an error occurred while switching to maintenace mode

    endMaintenance

    public void endMaintenance()
                        throws java.lang.Exception
    Description copied from interface: ServerAdminMBean
    Method to change the state of a node from "maintenance" to "normal"

    Specified by:
    endMaintenance in interface ServerAdminMBean
    Throws:
    java.lang.Exception - If an error occurred while switching to normal mode

    isAlive

    public boolean isAlive()
    Description copied from interface: ServerAdminMBean
    Method to check whether this WSAS instance is alive

    Specified by:
    isAlive in interface ServerAdminMBean
    Returns:
    True always

    getServerStatus

    public java.lang.String getServerStatus()
                                     throws java.lang.Exception
    Description copied from interface: ServerAdminMBean
    Get the current status of this WSAS instance

    Specified by:
    getServerStatus in interface ServerAdminMBean
    Returns:
    The current server status.
    Possible values are,
    org.wso2.wsas.ServerStatus#RUNNING,
    org.wso2.wsas.ServerStatus#SHUTTING_DOWN,
    org.wso2.wsas.ServerStatus#RESTARTING,
    org.wso2.wsas.ServerStatus#IN_MAINTENANCE
    Throws:
    java.lang.Exception
    See Also:
    ServerStatus