* Issue #4027 Ensure AbstractSessionDataStore started or throws exception. Signed-off-by: Jan Bartel <janb@webtide.com>
This commit is contained in:
parent
a2fc9b113b
commit
37712d75a2
|
@ -80,6 +80,9 @@ public abstract class AbstractSessionDataStore extends ContainerLifeCycle implem
|
|||
@Override
|
||||
public SessionData load(String id) throws Exception
|
||||
{
|
||||
if (!isStarted())
|
||||
throw new IllegalStateException ("Not started");
|
||||
|
||||
final AtomicReference<SessionData> reference = new AtomicReference<SessionData>();
|
||||
final AtomicReference<Exception> exception = new AtomicReference<Exception>();
|
||||
|
||||
|
@ -109,6 +112,9 @@ public abstract class AbstractSessionDataStore extends ContainerLifeCycle implem
|
|||
@Override
|
||||
public void store(String id, SessionData data) throws Exception
|
||||
{
|
||||
if (!isStarted())
|
||||
throw new IllegalStateException("Not started");
|
||||
|
||||
if (data == null)
|
||||
return;
|
||||
|
||||
|
@ -154,6 +160,9 @@ public abstract class AbstractSessionDataStore extends ContainerLifeCycle implem
|
|||
@Override
|
||||
public Set<String> getExpired(Set<String> candidates)
|
||||
{
|
||||
if (!isStarted())
|
||||
throw new IllegalStateException ("Not started");
|
||||
|
||||
try
|
||||
{
|
||||
return doGetExpired(candidates);
|
||||
|
|
|
@ -471,9 +471,9 @@ public class DefaultSessionIdManager extends ContainerLifeCycle implements Sessi
|
|||
}
|
||||
|
||||
/**
|
||||
* Get SessionManager for every context.
|
||||
* Get SessionHandler for every context.
|
||||
*
|
||||
* @return all session managers
|
||||
* @return all SessionHandlers that are running
|
||||
*/
|
||||
@Override
|
||||
public Set<SessionHandler> getSessionHandlers()
|
||||
|
@ -484,7 +484,8 @@ public class DefaultSessionIdManager extends ContainerLifeCycle implements Sessi
|
|||
{
|
||||
for (Handler h : tmp)
|
||||
{
|
||||
handlers.add((SessionHandler)h);
|
||||
if (h.isStarted())
|
||||
handlers.add((SessionHandler)h);
|
||||
}
|
||||
}
|
||||
return handlers;
|
||||
|
|
Loading…
Reference in New Issue