org.codehaus.wadi.core.contextualiser
Class AbstractExclusiveContextualiser

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.AbstractExclusiveContextualiser
All Implemented Interfaces:
Contextualiser, Lifecycle
Direct Known Subclasses:
ExclusiveStoreContextualiser, MemoryContextualiser

public abstract class AbstractExclusiveContextualiser
extends AbstractMotingContextualiser

Basic implementation for Contextualisers which maintain a local Map of references to Motables.

Version:
$Revision: 2499 $
Author:
Jules Gosnell

Nested Class Summary
protected  class AbstractExclusiveContextualiser.BasicEvictionStrategy
           
 
Field Summary
protected  ConcurrentMotableMap map
           
 
Fields inherited from class org.codehaus.wadi.core.contextualiser.AbstractChainedContextualiser
next
 
Constructor Summary
AbstractExclusiveContextualiser(Contextualiser next, Evicter evicter, ConcurrentMotableMap map)
           
 
Method Summary
protected  void doFindRelevantSessionNames(PartitionMapper mapper, java.util.Map keyToSessionNames)
           
protected  void doStart()
           
protected  void doStop()
           
protected  Motable get(java.lang.String id, boolean exclusiveOnly)
           
 Immoter getDemoter(java.lang.String name, Motable motable)
          Return an immoter to the first Contextualiser below us, which would be happy to accept this Motable - in other words - would not evict() it.
 java.util.Set getSessionNames()
           
 Immoter getSharedDemoter()
          Return an Immoter to the first SharedContextualiser below us.
 boolean handle(Invocation invocation, java.lang.String id, Immoter immoter, boolean exclusiveOnly)
           
protected  boolean handleLocally(Invocation invocation, java.lang.String id, Motable motable)
           
 void promoteToExclusive(Immoter immoter)
          Pass this Immoter up to the first ExclusiveContextualiser above us, where...
protected  void unload()
           
 
Methods inherited from class org.codehaus.wadi.core.contextualiser.AbstractMotingContextualiser
contextualise, getEmoter, getImmoter, getPromoter, promote
 
Methods inherited from class org.codehaus.wadi.core.contextualiser.AbstractChainedContextualiser
findRelevantSessionNames, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

protected final ConcurrentMotableMap map
Constructor Detail

AbstractExclusiveContextualiser

public AbstractExclusiveContextualiser(Contextualiser next,
                                       Evicter evicter,
                                       ConcurrentMotableMap map)
Method Detail

promoteToExclusive

public void promoteToExclusive(Immoter immoter)
Description copied from interface: Contextualiser
Pass this Immoter up to the first ExclusiveContextualiser above us, where...

Parameters:
immoter - the Immoter

getSharedDemoter

public Immoter getSharedDemoter()
Description copied from interface: Contextualiser
Return an Immoter to the first SharedContextualiser below us.

Returns:
the Immoter

getSessionNames

public java.util.Set getSessionNames()

get

protected Motable get(java.lang.String id,
                      boolean exclusiveOnly)
Specified by:
get in class AbstractMotingContextualiser

handle

public final boolean handle(Invocation invocation,
                            java.lang.String id,
                            Immoter immoter,
                            boolean exclusiveOnly)
                     throws InvocationException
Overrides:
handle in class AbstractMotingContextualiser
Throws:
InvocationException

doStart

protected void doStart()
                throws java.lang.Exception
Overrides:
doStart in class AbstractChainedContextualiser
Throws:
java.lang.Exception

doStop

protected void doStop()
               throws java.lang.Exception
Overrides:
doStop in class AbstractChainedContextualiser
Throws:
java.lang.Exception

getDemoter

public Immoter getDemoter(java.lang.String name,
                          Motable motable)
Description copied from interface: Contextualiser
Return an immoter to the first Contextualiser below us, which would be happy to accept this Motable - in other words - would not evict() it.

Parameters:
name - - uid of the Motable
motable - - the Motable in question
Returns:
- a Demoter - a delegate capable of arranging immotion into the correct Contextualiser

doFindRelevantSessionNames

protected void doFindRelevantSessionNames(PartitionMapper mapper,
                                          java.util.Map keyToSessionNames)
Overrides:
doFindRelevantSessionNames in class AbstractChainedContextualiser

handleLocally

protected boolean handleLocally(Invocation invocation,
                                java.lang.String id,
                                Motable motable)
                         throws InvocationException
Throws:
InvocationException

unload

protected void unload()


Copyright © 2010. All Rights Reserved.