org.codehaus.wadi.core.contextualiser
Class SharedStoreContextualiser

java.lang.Object
  extended by org.codehaus.wadi.core.contextualiser.AbstractChainedContextualiser
      extended by org.codehaus.wadi.core.contextualiser.AbstractMotingContextualiser
          extended by org.codehaus.wadi.core.contextualiser.AbstractSharedContextualiser
              extended by org.codehaus.wadi.core.contextualiser.SharedStoreContextualiser
All Implemented Interfaces:
Contextualiser, Lifecycle

public class SharedStoreContextualiser
extends AbstractSharedContextualiser

A Contextualiser which stores its Contexts in a shared database via JDBC. On shutdown of the cluster's last node, all extant sessions will be demoted to here. On startup of the cluster's first node, all sessions stored here will be promoted upwards.

Version:
$Revision: 2533 $
Author:
Jules Gosnell

Nested Class Summary
protected  class SharedStoreContextualiser.SharedImmoter
          An Emoter that deals in terms of StoreMotables
protected  class SharedStoreContextualiser.SharedPutter
           
 
Field Summary
 
Fields inherited from class org.codehaus.wadi.core.contextualiser.AbstractChainedContextualiser
next
 
Constructor Summary
SharedStoreContextualiser(Contextualiser next, Store store, StateManager stateManager, ReplicationManager replicationManager, SessionMonitor sessionMonitor)
           
 
Method Summary
protected  Motable get(java.lang.String id, boolean exclusiveOnly)
          Shared Contextualisers do nothing at runtime.
 Emoter getEmoter()
           
 Immoter getImmoter()
           
protected  void load(Emoter emoter, Immoter immoter)
           
 
Methods inherited from class org.codehaus.wadi.core.contextualiser.AbstractSharedContextualiser
contextualise, getDemoter, getSessionNames, getSharedDemoter, promoteToExclusive
 
Methods inherited from class org.codehaus.wadi.core.contextualiser.AbstractMotingContextualiser
getPromoter, handle, promote
 
Methods inherited from class org.codehaus.wadi.core.contextualiser.AbstractChainedContextualiser
doFindRelevantSessionNames, doStart, doStop, findRelevantSessionNames, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SharedStoreContextualiser

public SharedStoreContextualiser(Contextualiser next,
                                 Store store,
                                 StateManager stateManager,
                                 ReplicationManager replicationManager,
                                 SessionMonitor sessionMonitor)
Method Detail

getImmoter

public Immoter getImmoter()
Specified by:
getImmoter in class AbstractMotingContextualiser
Returns:
- an Immoter that facilitates insertion of Motables into this Contextualiser's own store

getEmoter

public Emoter getEmoter()
Specified by:
getEmoter in class AbstractMotingContextualiser
Returns:
- an Emoter that facilitates removal of Motables from this Contextualiser's own store

get

protected Motable get(java.lang.String id,
                      boolean exclusiveOnly)
Shared Contextualisers do nothing at runtime. They exist only to load data at startup and store it at shutdown.

Specified by:
get in class AbstractMotingContextualiser

load

protected void load(Emoter emoter,
                    Immoter immoter)
Overrides:
load in class AbstractSharedContextualiser


Copyright © 2010. All Rights Reserved.