public void handleNotification(Notification notification, Object handback) { if (notification instanceof SleeStateChangeNotification) { SleeStateChangeNotification sleeStateChangeNotification = (SleeStateChangeNotification) notification; sleeState = sleeStateChangeNotification.getNewState(); } }
private void notifyStateChange(SleeState oldState, SleeState newState) { if (logger.isTraceEnabled()) { logger.trace("notifyStateChange( old = " + oldState + " , new = " + newState + " )"); } notificationBroadcaster .sendNotification(new SleeStateChangeNotification(this, newState, oldState, sleeStateChangeSequenceNumber++)); }
/** * Changes the SLEE container state and emits JMX notifications * * @param newState */ protected void changeSleeState(SleeState newState) { SleeState oldState = sleeContainer.getSleeState(); sleeContainer.setSleeState(newState); notificationBroadcaster .sendNotification(new SleeStateChangeNotification(this, newState, oldState, sleeStateChangeSequenceNumber++)); if (newState.equals(SleeState.RUNNING)) { String timerSt = ""; if (isFullSleeStop) { startupTime = System.currentTimeMillis() - startupTime; long startupSec = startupTime / 1000; long startupMillis = startupTime % 1000; timerSt = "in " + startupSec + "s:" + startupMillis + "ms "; } logger.info("[[[[[[[[[ " + mobicentsVersion + " Started " + timerSt + "]]]]]]]]]"); } else if (newState.equals(SleeState.STOPPED)) { logger.info("[[[[[[[[[[ " + mobicentsVersion + " Stopped ]]]]]]]]]"); } }