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
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
-
-
Constructor Summary
Constructors Constructor Description ServerAdmin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendMaintenance()Method to change the state of a node from "maintenance" to "normal"org.wso2.carbon.server.admin.common.ServerDatagetServerData()StringgetServerDataAsString()Get information about this WSAS instanceStringgetServerStatus()Get the current status of this WSAS instanceStringgetServerVersion()Get the version of this WSAS instancebooleanisAlive()Method to check whether this WSAS instance is alivebooleanrestart()Forcefully restart this WSAS instancebooleanrestartGracefully()Gracefully restart this WSAS instance.booleanshutdown()Forcefully shutdown this WSAS instancebooleanshutdownGracefully()Gracefully shutdown this WSAS instance All client connections will be served before shutting down the servervoidstartMaintenance()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
-
-
-
-
Method Detail
-
getServerData
public org.wso2.carbon.server.admin.common.ServerData getServerData() throws Exception- Specified by:
getServerDatain interfaceorg.wso2.carbon.server.admin.common.IServerAdmin- Throws:
Exception
-
getServerDataAsString
public String getServerDataAsString() throws Exception
Description copied from interface:ServerAdminMBeanGet information about this WSAS instance- Specified by:
getServerDataAsStringin interfaceServerAdminMBean- 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:ServerAdminMBeanGet the version of this WSAS instance- Specified by:
getServerVersionin interfaceServerAdminMBean- Returns:
- The version of this WSAS instance
-
restart
public boolean restart() throws ExceptionDescription copied from interface:ServerAdminMBeanForcefully restart this WSAS instance- Specified by:
restartin interfaceorg.wso2.carbon.server.admin.common.IServerAdmin- Specified by:
restartin interfaceServerAdminMBean- Returns:
- true - If successful, false otherwise
- Throws:
Exception- If an error occurs while restarting
-
restartGracefully
public boolean restartGracefully() throws ExceptionDescription copied from interface:ServerAdminMBeanGracefully restart this WSAS instance. All client connections will be served before restarting the server- Specified by:
restartGracefullyin interfaceorg.wso2.carbon.server.admin.common.IServerAdmin- Specified by:
restartGracefullyin interfaceServerAdminMBean- Returns:
- true - If successful, false otherwise
- Throws:
Exception- If an error occurs while restarting
-
shutdown
public boolean shutdown() throws org.apache.axis2.AxisFaultDescription copied from interface:ServerAdminMBeanForcefully shutdown this WSAS instance- Specified by:
shutdownin interfaceorg.wso2.carbon.server.admin.common.IServerAdmin- Specified by:
shutdownin interfaceServerAdminMBean- Returns:
- true - If successful, false otherwise
- Throws:
org.apache.axis2.AxisFault
-
shutdownGracefully
public boolean shutdownGracefully() throws org.apache.axis2.AxisFaultDescription copied from interface:ServerAdminMBeanGracefully shutdown this WSAS instance All client connections will be served before shutting down the server- Specified by:
shutdownGracefullyin interfaceorg.wso2.carbon.server.admin.common.IServerAdmin- Specified by:
shutdownGracefullyin interfaceServerAdminMBean- Returns:
- true - If successful, false otherwise
- Throws:
org.apache.axis2.AxisFault
-
startMaintenance
public void startMaintenance() throws ExceptionDescription copied from interface:ServerAdminMBeanMethod 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:
startMaintenancein interfaceServerAdminMBean- Throws:
Exception- If an error occurred while switching to maintenace mode
-
endMaintenance
public void endMaintenance() throws ExceptionDescription copied from interface:ServerAdminMBeanMethod to change the state of a node from "maintenance" to "normal"- Specified by:
endMaintenancein interfaceServerAdminMBean- Throws:
Exception- If an error occurred while switching to normal mode
-
isAlive
public boolean isAlive()
Description copied from interface:ServerAdminMBeanMethod to check whether this WSAS instance is alive- Specified by:
isAlivein interfaceServerAdminMBean- Returns:
- True always
-
getServerStatus
public String getServerStatus() throws Exception
Description copied from interface:ServerAdminMBeanGet the current status of this WSAS instance- Specified by:
getServerStatusin interfaceServerAdminMBean- 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
-
-