@Override
  public void l2StateChanged(StateChangedEvent sce) {
    State state = sce.getCurrentState();

    if (state.equals(StateManager.ACTIVE_COORDINATOR)) {
      server.updateActivateTime();
    }

    debugPrintln(
        "*****  msg=["
            + stateChangeNotificationInfo.getMsg(state)
            + "] attrName=["
            + stateChangeNotificationInfo.getAttributeName(state)
            + "] attrType=["
            + stateChangeNotificationInfo.getAttributeType(state)
            + "] stateName=["
            + state.getName()
            + "]");

    _sendNotification(
        stateChangeNotificationInfo.getMsg(state),
        stateChangeNotificationInfo.getAttributeName(state),
        stateChangeNotificationInfo.getAttributeType(state),
        Boolean.FALSE,
        Boolean.TRUE);
  }
 @Override
 public String[] getProcessArguments() {
   String[] args = server.processArguments();
   List<String> inputArgs = ManagementFactory.getRuntimeMXBean().getInputArguments();
   if (args == null) {
     return inputArgs.toArray(new String[inputArgs.size()]);
   } else {
     List<String> l = new ArrayList<String>();
     l.add(StringUtil.toString(args, " ", null, null));
     l.addAll(inputArgs);
     return l.toArray(new String[l.size()]);
   }
 }
 /**
  * This schedules the shutdown to occur one second after we return from this call because
  * otherwise JMX will be shutdown and we'll get all sorts of other errors trying to return from
  * this call.
  */
 @Override
 public void shutdown() {
   if (!server.canShutdown()) {
     String msg = "Server cannot be shutdown because it is not fully started.";
     logger.error(msg);
     throw new RuntimeException(msg);
   }
   logger.warn("shutdown is invoked by MBean");
   final Timer timer = new Timer("TCServerInfo shutdown timer");
   final TimerTask task =
       new TimerTask() {
         @Override
         public void run() {
           server.shutdown();
         }
       };
   timer.schedule(task, 1000);
 }
 @Override
 public L2Info[] getL2Info() {
   return server.infoForAllL2s();
 }
 @Override
 public String getConfig() {
   return server.getConfig();
 }
 @Override
 public long getActivateTime() {
   return server.getActivateTime();
 }
 @Override
 public Map<String, String> getBackupStatuses() throws IOException {
   return server.getBackupStatuses();
 }
 @Override
 public String getBackupStatus(final String name) throws IOException {
   return server.getBackupStatus(name);
 }
 @Override
 public void backup(final String name) throws IOException {
   server.backup(name);
 }
 @Override
 public String getIntraL2Username() {
   return server.getIntraL2Username();
 }
 @Override
 public String getSecurityServiceLocation() {
   return server.getSecurityServiceLocation();
 }
 @Override
 public boolean isEnterprise() {
   return server.getClass().getSimpleName().equals("EnterpriseServerImpl");
 }
 @Override
 public String getDescriptionOfCapabilities() {
   return server.getDescriptionOfCapabilities();
 }
 @Override
 public void startBeanShell(int port) {
   server.startBeanShell(port);
 }
 @Override
 public boolean isShutdownable() {
   return server.canShutdown();
 }
 @Override
 public void stop() {
   server.stop();
   _sendNotification(
       "TCServer stopped", "Started", "java.lang.Boolean", Boolean.TRUE, Boolean.FALSE);
 }
 @Override
 public int getGarbageCollectionInterval() {
   return server.getGarbageCollectionInterval();
 }
 @Override
 public boolean isGarbageCollectionEnabled() {
   return server.isGarbageCollectionEnabled();
 }
 @Override
 public boolean isSecure() {
   return server.isSecure();
 }
 @Override
 public String getL2Identifier() {
   return server.getL2Identifier();
 }
 @Override
 public String getSecurityHostname() {
   server.getTSAListenPort();
   return server.getSecurityHostname();
 }
 @Override
 public ServerGroupInfo[] getServerGroupInfo() {
   return server.serverGroups();
 }
 @Override
 public Integer getSecurityServiceTimeout() {
   return server.getSecurityServiceTimeout();
 }
 @Override
 public int getTSAListenPort() {
   return server.getTSAListenPort();
 }
 @Override
 public String getRunningBackup() {
   return server.getRunningBackup();
 }
 @Override
 public int getTSAGroupPort() {
   return server.getTSAGroupPort();
 }
 @Override
 public String getBackupFailureReason(String name) throws IOException {
   return server.getBackupFailureReason(name);
 }
 @Override
 public boolean getRestartable() {
   return server.getRestartable();
 }
 @Override
 public String getResourceState() {
   return server.getResourceState();
 }
 @Override
 public long getStartTime() {
   return server.getStartTime();
 }