* 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
|
@Override
|
||||||
public SessionData load(String id) throws Exception
|
public SessionData load(String id) throws Exception
|
||||||
{
|
{
|
||||||
|
if (!isStarted())
|
||||||
|
throw new IllegalStateException ("Not started");
|
||||||
|
|
||||||
final AtomicReference<SessionData> reference = new AtomicReference<SessionData>();
|
final AtomicReference<SessionData> reference = new AtomicReference<SessionData>();
|
||||||
final AtomicReference<Exception> exception = new AtomicReference<Exception>();
|
final AtomicReference<Exception> exception = new AtomicReference<Exception>();
|
||||||
|
|
||||||
|
@ -109,6 +112,9 @@ public abstract class AbstractSessionDataStore extends ContainerLifeCycle implem
|
||||||
@Override
|
@Override
|
||||||
public void store(String id, SessionData data) throws Exception
|
public void store(String id, SessionData data) throws Exception
|
||||||
{
|
{
|
||||||
|
if (!isStarted())
|
||||||
|
throw new IllegalStateException("Not started");
|
||||||
|
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -154,6 +160,9 @@ public abstract class AbstractSessionDataStore extends ContainerLifeCycle implem
|
||||||
@Override
|
@Override
|
||||||
public Set<String> getExpired(Set<String> candidates)
|
public Set<String> getExpired(Set<String> candidates)
|
||||||
{
|
{
|
||||||
|
if (!isStarted())
|
||||||
|
throw new IllegalStateException ("Not started");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return doGetExpired(candidates);
|
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
|
@Override
|
||||||
public Set<SessionHandler> getSessionHandlers()
|
public Set<SessionHandler> getSessionHandlers()
|
||||||
|
@ -484,6 +484,7 @@ public class DefaultSessionIdManager extends ContainerLifeCycle implements Sessi
|
||||||
{
|
{
|
||||||
for (Handler h : tmp)
|
for (Handler h : tmp)
|
||||||
{
|
{
|
||||||
|
if (h.isStarted())
|
||||||
handlers.add((SessionHandler)h);
|
handlers.add((SessionHandler)h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue