/** * {@inheritDoc} */ @Override public void stopInternal() throws LifecycleException { setState(LifecycleState.STOPPING); if ( _msm.isSticky() ) { _log.info( "Removing sessions from local session map." ); for( final Session session : sessions.values() ) { swapOut( (StandardSession) session ); } } _msm.shutdown(); super.stopInternal(); }
/** * {@inheritDoc} */ @Override public void stopInternal() throws LifecycleException { setState(LifecycleState.STOPPING); if ( _msm.isSticky() ) { _log.info( "Removing sessions from local session map." ); for( final Session session : sessions.values() ) { swapOut( (StandardSession) session ); } } _msm.shutdown(); super.stopInternal(); }
/** * {@inheritDoc} */ @Override public void stopInternal() throws LifecycleException { setState(LifecycleState.STOPPING); if ( _msm.isSticky() ) { _log.info( "Removing sessions from local session map." ); for( final Session session : sessions.values() ) { swapOut( (StandardSession) session ); } } _msm.shutdown(); super.stopInternal(); }
/** * {@inheritDoc} */ @Override public void stop() throws LifecycleException { if (log.isDebugEnabled()) { log.debug("Stopping"); } // Validate and update our current component state if (!_started) { throw new LifecycleException (sm.getString("standardManager.notStarted")); } _lifecycle.fireLifecycleEvent(STOP_EVENT, null); _started = false; // Require a new random number generator if we are restarted random = null; if ( initialized ) { if ( _msm.isSticky() ) { _log.info( "Removing sessions from local session map." ); for( final Session session : sessions.values() ) { swapOut( (StandardSession) session ); } } _msm.shutdown(); destroy(); } }
/** * Test for issue #105: Make memcached node optional for single-node setup * http://code.google.com/p/memcached-session-manager/issues/detail?id=105 */ @Test public void testConfigurationFormatMemcachedNodesFeature105() throws LifecycleException { _service.setMemcachedNodes( "127.0.0.1:11211" ); _service.startInternal(new MemcachedStorageClient(_memcachedMock)); assertEquals(_service.getMemcachedNodesManager().getCountNodes(), 1); assertEquals(_service.getMemcachedNodesManager().isEncodeNodeIdInSessionId(), false); assertEquals(_service.getMemcachedNodesManager().isValidForMemcached("123456"), true); _service.shutdown(); _service.setMemcachedNodes( "n1:127.0.0.1:11211" ); _service.startInternal(new MemcachedStorageClient(_memcachedMock)); assertEquals(_service.getMemcachedNodesManager().getCountNodes(), 1); assertEquals(_service.getMemcachedNodesManager().isEncodeNodeIdInSessionId(), true); assertEquals(_service.getMemcachedNodesManager().isValidForMemcached("123456"), false); assertEquals(_service.getMemcachedNodesManager().isValidForMemcached("123456-n1"), true); }
/** * {@inheritDoc} */ @Override public void stopInternal() throws LifecycleException { setState(LifecycleState.STOPPING); if ( _msm.isSticky() ) { _log.info( "Removing sessions from local session map." ); for( final Session session : sessions.values() ) { swapOut( (StandardSession) session ); } } _msm.shutdown(); super.stopInternal(); }