/** * Get the current server status * * @return The current server status * @throws AxisFault If an error occurs while getting the ConfigurationContext */ public static String getCurrentStatus() { ConfigurationContext configCtx = CarbonConfigurationContextFactory.getConfigurationContext(); String currentStatus = (String) configCtx.getProperty(CURRENT_SERVER_STATUS); if (currentStatus == null) { configCtx.setProperty(CURRENT_SERVER_STATUS, STATUS_RUNNING); return STATUS_RUNNING; } return currentStatus; }
/** * Set server to maintenace mode * * @throws AxisFault If an error occurs while getting the ConfigurationContext */ public static void setServerInMaintenance() throws AxisFault { ConfigurationContext configCtx = CarbonConfigurationContextFactory.getConfigurationContext(); configCtx.setProperty(CURRENT_SERVER_STATUS, STATUS_IN_MAINTENANCE); }
/** * Set server to restarting-down mode * * @throws AxisFault If an error occurs while getting the ConfigurationContext */ public static void setServerRestarting() throws AxisFault { ConfigurationContext configCtx = CarbonConfigurationContextFactory.getConfigurationContext(); configCtx.setProperty(CURRENT_SERVER_STATUS, STATUS_RESTARTING); }
/** * Set server to shutting-down mode * * @throws AxisFault If an error occurs while getting the ConfigurationContext */ public static void setServerShuttingDown() throws AxisFault { ConfigurationContext configCtx = CarbonConfigurationContextFactory.getConfigurationContext(); configCtx.setProperty(CURRENT_SERVER_STATUS, STATUS_SHUTTING_DOWN); }