org.wso2.carbon.server.admin.service
Class ServerAdmin

java.lang.Object
  extended by org.wso2.carbon.core.AbstractAdmin
      extended by org.wso2.carbon.server.admin.service.ServerAdmin
All Implemented Interfaces:
org.wso2.carbon.server.admin.common.IServerAdmin, ServerAdminMBean

public class ServerAdmin
extends org.wso2.carbon.core.AbstractAdmin
implements ServerAdminMBean, org.wso2.carbon.server.admin.common.IServerAdmin

Admin service to manage server related operations


Field Summary
 
Fields inherited from class org.wso2.carbon.core.AbstractAdmin
axisConfig, configurationContext
 
Constructor Summary
ServerAdmin()
           
 
Method Summary
 void endMaintenance()
          Method to change the state of a node from "maintenance" to "normal"
 org.wso2.carbon.server.admin.common.ServerData getServerData()
           
 String getServerDataAsString()
          Get information about this WSAS instance
 String getServerStatus()
          Get the current status of this WSAS instance
 String getServerVersion()
          Get the version of this WSAS instance
 boolean isAlive()
          Method to check whether this WSAS instance is alive
 boolean restart()
          Forcefully restart this WSAS instance
 boolean restartGracefully()
          Gracefully restart this WSAS instance.
 boolean shutdown()
          Forcefully shutdown this WSAS instance
 boolean 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.carbon.core.AbstractAdmin
getAxisConfig, getConfigContext, getConfigSystemRegistry, getConfigUserRegistry, getGovernanceRegistry, getGovernanceSystemRegistry, getGovernanceUserRegistry, getHttpSession, getLocalRepo, getRegistry, getTenantDomain, getUsername, getUserRealm, setConfigurationContext, setPermissionUpdateTimestamp
 
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 org.wso2.carbon.server.admin.common.ServerData getServerData()
                                                             throws Exception
Specified by:
getServerData in interface org.wso2.carbon.server.admin.common.IServerAdmin
Throws:
Exception

getServerDataAsString

public String getServerDataAsString()
                             throws 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:
Exception - If an error occurred while retrieving server information

getServerVersion

public 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

restart

public boolean restart()
                throws Exception
Description copied from interface: ServerAdminMBean
Forcefully restart this WSAS instance

Specified by:
restart in interface org.wso2.carbon.server.admin.common.IServerAdmin
Specified by:
restart in interface ServerAdminMBean
Returns:
true - If successful, false otherwise
Throws:
Exception - If an error occurs while restarting

restartGracefully

public boolean restartGracefully()
                          throws Exception
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 org.wso2.carbon.server.admin.common.IServerAdmin
Specified by:
restartGracefully in interface ServerAdminMBean
Returns:
true - If successful, false otherwise
Throws:
Exception - If an error occurs while restarting

shutdown

public boolean shutdown()
                 throws org.apache.axis2.AxisFault
Description copied from interface: ServerAdminMBean
Forcefully shutdown this WSAS instance

Specified by:
shutdown in interface org.wso2.carbon.server.admin.common.IServerAdmin
Specified by:
shutdown in interface ServerAdminMBean
Returns:
true - If successful, false otherwise
Throws:
org.apache.axis2.AxisFault

shutdownGracefully

public boolean shutdownGracefully()
                           throws org.apache.axis2.AxisFault
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 org.wso2.carbon.server.admin.common.IServerAdmin
Specified by:
shutdownGracefully in interface ServerAdminMBean
Returns:
true - If successful, false otherwise
Throws:
org.apache.axis2.AxisFault

startMaintenance

public void startMaintenance()
                      throws 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:
    Exception - If an error occurred while switching to maintenace mode

    endMaintenance

    public void endMaintenance()
                        throws 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:
    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 String getServerStatus()
                           throws 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,
    ServerStatus.STATUS_RUNNING,
    ServerStatus.STATUS_SHUTTING_DOWN,
    ServerStatus.STATUS_RESTARTING,
    ServerStatus.STATUS_IN_MAINTENANCE
    Throws:
    Exception - If an error occurs while retrieving the status
    See Also:
    ServerStatus


    Copyright © 2014 WSO2 Inc. All rights reserved.