Class 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

      Constructors 
      Constructor Description
      ServerAdmin()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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, getUserId, getUsername, getUserRealm, setConfigurationContext, setPermissionUpdateTimestamp
    • 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
      • 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