org.apache.catalina.ha.session

Class BackupManager

public class BackupManager extends StandardManager implements ClusterManager, AbstractReplicatedMap.MapOwner

Version: 1.0

Author: Filip Hanik

Field Summary
protected CatalinaClustercluster
A reference to the cluster
protected static longDEFAULT_REPL_TIMEOUT
static Loglog
protected booleanmExpireSessionsOnShutdown
Set to true if we don't want the sessions to expire on shutdown
protected Stringname
The name of this manager
Constructor Summary
BackupManager()
Constructor, just calls super()
Method Summary
ClusterManagercloneFromTemplate()
SessioncreateEmptySession()
booleandoDomainReplication()
intgetActiveSessionsFull()
ClassLoader[]getClassLoaders()
CatalinaClustergetCluster()
booleangetDistributable()
booleangetExpireSessionsOnShutdown()
String[]getInvalidatedSessions()
StringgetMapName()
intgetMapSendOptions()
StringgetName()
ReplicationStreamgetReplicationStream(byte[] data)
Open Stream and use correct ClassLoader (Container) Switch ThreadClassLoader
ReplicationStreamgetReplicationStream(byte[] data, int offset, int length)
booleanisDefaultMode()
booleanisNotifyListenersOnReplication()
StringlistSessionIdsFull()
voidmessageDataReceived(ClusterMessage msg)
voidobjectMadePrimay(Object key, Object value)
ClusterMessagerequestCompleted(String sessionId)
voidsetCluster(CatalinaCluster cluster)
voidsetDefaultMode(boolean defaultMode)
voidsetDistributable(boolean dist)
voidsetDomainReplication(boolean sendClusterDomainOnly)
voidsetExpireSessionsOnShutdown(boolean expireSessionsOnShutdown)
voidsetMapSendOptions(int mapSendOptions)
voidsetName(String name)
voidsetNotifyListenersOnReplication(boolean notifyListenersOnReplication)
voidstart()
Prepare for the beginning of active use of the public methods of this component.
voidstop()
Gracefully terminate the active use of the public methods of this component.
voidunload()
Override persistence since they don't go hand in hand with replication for now.

Field Detail

cluster

protected CatalinaCluster cluster
A reference to the cluster

DEFAULT_REPL_TIMEOUT

protected static long DEFAULT_REPL_TIMEOUT

log

public static Log log

mExpireSessionsOnShutdown

protected boolean mExpireSessionsOnShutdown
Set to true if we don't want the sessions to expire on shutdown

name

protected String name
The name of this manager

Constructor Detail

BackupManager

public BackupManager()
Constructor, just calls super()

Method Detail

cloneFromTemplate

public ClusterManager cloneFromTemplate()

createEmptySession

public Session createEmptySession()

doDomainReplication

public boolean doDomainReplication()

getActiveSessionsFull

public int getActiveSessionsFull()

getClassLoaders

public ClassLoader[] getClassLoaders()

getCluster

public CatalinaCluster getCluster()

getDistributable

public boolean getDistributable()

getExpireSessionsOnShutdown

public boolean getExpireSessionsOnShutdown()

getInvalidatedSessions

public String[] getInvalidatedSessions()

getMapName

public String getMapName()

getMapSendOptions

public int getMapSendOptions()

getName

public String getName()

getReplicationStream

public ReplicationStream getReplicationStream(byte[] data)
Open Stream and use correct ClassLoader (Container) Switch ThreadClassLoader

Parameters: data

Returns: The object input stream

Throws: IOException

getReplicationStream

public ReplicationStream getReplicationStream(byte[] data, int offset, int length)

isDefaultMode

public boolean isDefaultMode()

Returns: Returns the defaultMode.

isNotifyListenersOnReplication

public boolean isNotifyListenersOnReplication()

listSessionIdsFull

public String listSessionIdsFull()

messageDataReceived

public void messageDataReceived(ClusterMessage msg)

objectMadePrimay

public void objectMadePrimay(Object key, Object value)

requestCompleted

public ClusterMessage requestCompleted(String sessionId)

setCluster

public void setCluster(CatalinaCluster cluster)

setDefaultMode

public void setDefaultMode(boolean defaultMode)

Parameters: defaultMode The defaultMode to set.

setDistributable

public void setDistributable(boolean dist)

setDomainReplication

public void setDomainReplication(boolean sendClusterDomainOnly)

Parameters: sendClusterDomainOnly The sendClusterDomainOnly to set.

setExpireSessionsOnShutdown

public void setExpireSessionsOnShutdown(boolean expireSessionsOnShutdown)

setMapSendOptions

public void setMapSendOptions(int mapSendOptions)

setName

public void setName(String name)

setNotifyListenersOnReplication

public void setNotifyListenersOnReplication(boolean notifyListenersOnReplication)

start

public void start()
Prepare for the beginning of active use of the public methods of this component. This method should be called after configure(), and before any of the public methods of the component are utilized.
Starts the cluster communication channel, this will connect with the other nodes in the cluster, and request the current session state to be transferred to this node.

Throws: IllegalStateException if this component has already been started LifecycleException if this component detects a fatal error that prevents this component from being used

stop

public void stop()
Gracefully terminate the active use of the public methods of this component. This method should be the last one called on a given instance of this component.
This will disconnect the cluster communication channel and stop the listener thread.

Throws: IllegalStateException if this component has not been started LifecycleException if this component detects a fatal error that needs to be reported

unload

public void unload()
Override persistence since they don't go hand in hand with replication for now.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.