org.mortbay.j2ee.session
Class AbstractReplicatedStore

java.lang.Object
  extended by org.mortbay.j2ee.session.AbstractStore
      extended by org.mortbay.j2ee.session.AbstractReplicatedStore
All Implemented Interfaces:
Cloneable, Store

public abstract class AbstractReplicatedStore
extends AbstractStore

Maintain synchronisation with other States representing the same session by publishing changes made to ourself and updating ourself according to notifications published by the other State objects.

Version:
1.0
Author:
Jules Gosnell

Field Summary
protected static Method[] _integerToMethod
           
protected  ClassLoader _loader
           
protected static org.jboss.logging.Logger _log
           
protected static Map _methodToInteger
           
protected  Map _sessions
           
protected  Map _subscribers
           
protected static Method CREATE_SESSION
           
protected static Method DESTROY_SESSION
           
protected static Method SET_LAST_ACCESSED_TIME
           
protected static Method TOUCH_SESSIONS
           
 
Fields inherited from class org.mortbay.j2ee.session.AbstractStore
_actualMaxInactiveInterval, _manager, _scavenger, _scavengerExtraTime, _scavengerPeriod
 
Constructor Summary
AbstractReplicatedStore()
           
 
Method Summary
 Object clone()
           
 void createSession(String id, long creationTime, int maxInactiveInterval, int actualMaxInactiveInterval)
           
 void destroy()
           
 void destroySession(String id)
           
protected  void dispatch(String id, Integer methodId, Object[] argInstances)
           
 String getContextPath()
           
 ClassLoader getLoader()
           
static boolean getReplicating()
           
 int getSessions()
           
 boolean isDistributed()
           
 State loadState(String id)
           
 State newState(String id, int maxInactiveInterval)
           
 void passivateSession(StateAdaptor sa)
           
protected abstract  void publish(String id, Method method, Object[] argInstances)
           
 void removeState(State state)
           
 void scavenge()
           
 void setLoader(ClassLoader loader)
           
static void setReplicating(boolean replicating)
           
 void storeState(State state)
           
 void subscribe(String id, Object o)
           
 void touchSessions(String[] ids, long time)
           
 void unsubscribe(String id)
           
 
Methods inherited from class org.mortbay.j2ee.session.AbstractStore
allocateId, deallocateId, getActualMaxInactiveInterval, getManager, getScavengerExtraTime, getScavengerPeriod, setActualMaxInactiveInterval, setManager, setScavengerExtraTime, setScavengerPeriod, start, stop
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log

protected static final org.jboss.logging.Logger _log

_loader

protected ClassLoader _loader

_sessions

protected Map _sessions

_methodToInteger

protected static Map _methodToInteger

_integerToMethod

protected static Method[] _integerToMethod

CREATE_SESSION

protected static Method CREATE_SESSION

DESTROY_SESSION

protected static Method DESTROY_SESSION

TOUCH_SESSIONS

protected static Method TOUCH_SESSIONS

SET_LAST_ACCESSED_TIME

protected static Method SET_LAST_ACCESSED_TIME

_subscribers

protected Map _subscribers
Constructor Detail

AbstractReplicatedStore

public AbstractReplicatedStore()
Method Detail

getLoader

public ClassLoader getLoader()

setLoader

public void setLoader(ClassLoader loader)

getReplicating

public static boolean getReplicating()

setReplicating

public static void setReplicating(boolean replicating)

clone

public Object clone()
Specified by:
clone in interface Store
Overrides:
clone in class AbstractStore

getSessions

public int getSessions()

destroy

public void destroy()
Specified by:
destroy in interface Store
Overrides:
destroy in class AbstractStore

newState

public State newState(String id,
                      int maxInactiveInterval)
               throws Exception
Throws:
Exception

loadState

public State loadState(String id)

storeState

public void storeState(State state)

removeState

public void removeState(State state)
                 throws Exception
Throws:
Exception

scavenge

public void scavenge()
              throws Exception
Throws:
Exception

passivateSession

public void passivateSession(StateAdaptor sa)

isDistributed

public boolean isDistributed()

getContextPath

public String getContextPath()

publish

protected abstract void publish(String id,
                                Method method,
                                Object[] argInstances)

dispatch

protected void dispatch(String id,
                        Integer methodId,
                        Object[] argInstances)

createSession

public void createSession(String id,
                          long creationTime,
                          int maxInactiveInterval,
                          int actualMaxInactiveInterval)

destroySession

public void destroySession(String id)

touchSessions

public void touchSessions(String[] ids,
                          long time)

subscribe

public void subscribe(String id,
                      Object o)

unsubscribe

public void unsubscribe(String id)


Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.