|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.ha.hasessionstate.server.HASessionStateImpl
public class HASessionStateImpl
Default implementation of HASessionState
Revisions:
2002/01/09: billb
HASessionState
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jboss.ha.hasessionstate.interfaces.HASessionState |
---|
HASessionState.HASessionStateListener |
Field Summary | |
---|---|
protected ConcurrentMap<String,Set<HASessionState.HASessionStateListener>> |
appListenerMap
|
protected Map<String,ConcurrentMap<Object,PackagedSession>> |
appSessionMap
|
Constructor Summary | |
---|---|
HASessionStateImpl(String sessionStateName,
org.jboss.ha.framework.interfaces.HAPartition partition,
long beanCleaningDelay)
|
Method Summary | |
---|---|
PackagedSession |
_createSession(String appName,
Object keyId)
|
void |
_removeSession(String appName,
Object keyId)
|
Boolean |
_setOwnership(String appName,
Object keyId,
String newOwner,
Long remoteVersion)
|
void |
_setState(String appName,
PackagedSession session)
|
protected void |
bind(String jndiName,
Object who,
Class<?> classType,
Context ctx)
|
void |
createSession(String appName,
Object keyId)
Share a new session state in the sub-partition of this cluster |
protected byte[] |
deflate(Object object)
|
void |
destroy()
|
protected ConcurrentMap<Object,PackagedSession> |
getAppMap(String appName)
|
org.jboss.ha.framework.interfaces.HAPartition |
getCurrentHAPartition()
|
Serializable |
getCurrentState()
|
String |
getNodeName()
Return the name of this node as used in the computations |
PackagedSession |
getState(String appName,
Object keyId)
Get a particular state |
PackagedSession |
getStateWithOwnership(String appName,
Object keyId)
Get a state and, if it is not already the case, takes its ownership (a state is always owned by a node) |
protected Object |
inflate(byte[] compressedContent)
|
void |
init()
|
PackagedSession |
localTakeOwnership(String appName,
Object keyId)
|
void |
ownedObjectExternallyModified(String appName,
Object key,
PackagedSession oldSession,
PackagedSession newSession)
|
void |
purgeState()
|
void |
removeSession(String appName,
Object keyId)
Remove a session from the sub-partition |
void |
setCurrentState(Serializable newState)
|
void |
setState(String appName,
Object keyId,
byte[] state)
Modifies a state already shared |
void |
start()
|
void |
stop()
|
void |
subscribe(String appName,
HASessionState.HASessionStateListener listener)
Subscribe to receive notifications when objects gets modified on another node. |
void |
takeOwnership(String appName,
Object keyId)
Take ownership of a state. |
void |
unsubscribe(String appName,
HASessionState.HASessionStateListener listener)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Map<String,ConcurrentMap<Object,PackagedSession>> appSessionMap
protected ConcurrentMap<String,Set<HASessionState.HASessionStateListener>> appListenerMap
Constructor Detail |
---|
public HASessionStateImpl(String sessionStateName, org.jboss.ha.framework.interfaces.HAPartition partition, long beanCleaningDelay)
Method Detail |
---|
public void init() throws Exception
init
in interface HASessionState
Exception
public void start() throws Exception
start
in interface HASessionState
Exception
protected void bind(String jndiName, Object who, Class<?> classType, Context ctx) throws Exception
Exception
public void stop()
public void destroy() throws Exception
Exception
public String getNodeName()
HASessionState
getNodeName
in interface HASessionState
public Serializable getCurrentState()
getCurrentState
in interface org.jboss.ha.framework.interfaces.HAPartition.HAPartitionStateTransfer
public void setCurrentState(Serializable newState)
setCurrentState
in interface org.jboss.ha.framework.interfaces.HAPartition.HAPartitionStateTransfer
public void purgeState()
protected byte[] deflate(Object object) throws IOException
IOException
protected Object inflate(byte[] compressedContent) throws IOException
IOException
protected ConcurrentMap<Object,PackagedSession> getAppMap(String appName)
public void createSession(String appName, Object keyId)
HASessionState
createSession
in interface HASessionState
appName
- Application name for which is state is sharedkeyId
- Key identifier of the statepublic PackagedSession _createSession(String appName, Object keyId)
public void setState(String appName, Object keyId, byte[] state) throws RemoteException
HASessionState
setState
in interface HASessionState
appName
- Application name hosting this statekeyId
- Key identifier of the state to modifystate
- New state
RemoteException
public void _setState(String appName, PackagedSession session)
public PackagedSession getState(String appName, Object keyId)
HASessionState
getState
in interface HASessionState
appName
- Application hosting the statekeyId
- Key identifier of the state
public PackagedSession getStateWithOwnership(String appName, Object keyId) throws RemoteException
HASessionState
getStateWithOwnership
in interface HASessionState
appName
- Application hosting the statekeyId
- Key identifier of the state
RemoteException
- Thrown if an exception occurs while getting the ownership of the statepublic PackagedSession localTakeOwnership(String appName, Object keyId) throws RemoteException
RemoteException
public Boolean _setOwnership(String appName, Object keyId, String newOwner, Long remoteVersion)
public void takeOwnership(String appName, Object keyId) throws RemoteException
HASessionState
takeOwnership
in interface HASessionState
appName
- Application hosting the statekeyId
- Key identifier of the state
RemoteException
- Trown if a communication exception occurs while asking other node to get the ownershippublic void removeSession(String appName, Object keyId)
HASessionState
removeSession
in interface HASessionState
appName
- Application hosting the statekeyId
- Key identifier of the statepublic void _removeSession(String appName, Object keyId)
public void subscribe(String appName, HASessionState.HASessionStateListener listener)
HASessionState
subscribe
in interface HASessionState
public void unsubscribe(String appName, HASessionState.HASessionStateListener listener)
unsubscribe
in interface HASessionState
public void ownedObjectExternallyModified(String appName, Object key, PackagedSession oldSession, PackagedSession newSession)
public org.jboss.ha.framework.interfaces.HAPartition getCurrentHAPartition()
getCurrentHAPartition
in interface HASessionState
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |