Class ServerAdmin

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

@Capability(namespace="osgi.service", attribute={"objectClass=org.wso2.carbon.server.admin.common.IServerAdmin","service.scope=singleton"}) 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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Method to change the state of a node from "maintenance" to "normal"
    org.wso2.carbon.server.admin.common.ServerData
     
    Get information about this WSAS instance
    Get the current status of this WSAS instance
    Get the version of this WSAS instance
    boolean
    Method to check whether this WSAS instance is alive
    boolean
    Forcefully restart this WSAS instance
    boolean
    Gracefully restart this WSAS instance.
    boolean
    Forcefully shutdown this WSAS instance
    boolean
    Gracefully shutdown this WSAS instance All client connections will be served before shutting down the server
    void
    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, getUserId, getUsername, getUserRealm, setConfigurationContext, setPermissionUpdateTimestamp

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ServerAdmin

      public ServerAdmin()
  • Method Details

    • 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 invalid input: '&' connections can be served
    • Once all requests have been processed, the method returnsinvalid input: '<'/li
    • 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