org.codehaus.wadi.impl
Class MemoryContextualiser

java.lang.Object
  extended byorg.codehaus.wadi.impl.AbstractContextualiser
      extended byorg.codehaus.wadi.impl.AbstractChainedContextualiser
          extended byorg.codehaus.wadi.impl.AbstractMotingContextualiser
              extended byorg.codehaus.wadi.impl.AbstractExclusiveContextualiser
                  extended byorg.codehaus.wadi.impl.MemoryContextualiser
All Implemented Interfaces:
Config, Contextualiser, EvicterConfig, Lifecycle

public class MemoryContextualiser
extends AbstractExclusiveContextualiser

A Contextualiser that stores its state in Memory as Java Objects

Version:
$Revision: 1430 $
Author:
Jules Gosnell

Field Summary
protected  Emoter _emoter
           
protected  Emoter _evictionEmoter
           
protected  Immoter _immoter
           
protected  Log _lockLog
           
protected  ContextPool _pool
           
protected  PoolableInvocationWrapperPool _requestPool
           
protected  Streamer _streamer
           
 
Fields inherited from class org.codehaus.wadi.impl.AbstractExclusiveContextualiser
_evicter, _map, _stringPrefix, _stringSuffix
 
Fields inherited from class org.codehaus.wadi.impl.AbstractMotingContextualiser
_clean, _config, _locker
 
Fields inherited from class org.codehaus.wadi.impl.AbstractChainedContextualiser
_next
 
Fields inherited from class org.codehaus.wadi.impl.AbstractContextualiser
_log
 
Constructor Summary
MemoryContextualiser(Contextualiser next, Evicter evicter, Map map, Streamer streamer, ContextPool pool, PoolableInvocationWrapperPool requestPool)
           
 
Method Summary
 boolean contextualiseLocally(InvocationContext invocationContext, String id, Sync invocationLock, Motable motable)
           
 void expire(Motable motable)
           
 Emoter getEmoter()
           
 Emoter getEvictionEmoter()
           
 Sync getEvictionLock(String id, Motable motable)
           
 Immoter getImmoter()
           
 Immoter getPromoter(Immoter immoter)
           
 boolean handle(InvocationContext invocationContext, String id, Immoter immoter, Sync motionLock)
           
 boolean isExclusive()
           
 void setLastAccessTime(Evictable evictable, long oldTime, long newTime)
           
 void setMaxInactiveInterval(Evictable evictable, int oldInterval, int newInterval)
           
 
Methods inherited from class org.codehaus.wadi.impl.AbstractExclusiveContextualiser
demote, destroy, findRelevantSessionNames, get, getDemoter, getEvicter, getLocalSessionCount, getMap, getMaxInactiveInterval, getSize, getTimer, init, load, start, stop, toString, unload
 
Methods inherited from class org.codehaus.wadi.impl.AbstractMotingContextualiser
contextualise, getSharedDemoter, promote, promoteToExclusive
 
Methods inherited from class org.codehaus.wadi.impl.AbstractChainedContextualiser
setLastAccessedTime
 
Methods inherited from class org.codehaus.wadi.impl.AbstractContextualiser
getStartInfo, getStopInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_pool

protected final ContextPool _pool

_streamer

protected final Streamer _streamer

_immoter

protected final Immoter _immoter

_emoter

protected final Emoter _emoter

_evictionEmoter

protected final Emoter _evictionEmoter

_requestPool

protected final PoolableInvocationWrapperPool _requestPool

_lockLog

protected final Log _lockLog
Constructor Detail

MemoryContextualiser

public MemoryContextualiser(Contextualiser next,
                            Evicter evicter,
                            Map map,
                            Streamer streamer,
                            ContextPool pool,
                            PoolableInvocationWrapperPool requestPool)
Method Detail

isExclusive

public boolean isExclusive()

handle

public boolean handle(InvocationContext invocationContext,
                      String id,
                      Immoter immoter,
                      Sync motionLock)
               throws InvocationException
Overrides:
handle in class AbstractExclusiveContextualiser
Throws:
InvocationException

contextualiseLocally

public boolean contextualiseLocally(InvocationContext invocationContext,
                                    String id,
                                    Sync invocationLock,
                                    Motable motable)
                             throws InvocationException
Throws:
InvocationException

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

getPromoter

public Immoter getPromoter(Immoter immoter)
Overrides:
getPromoter in class AbstractMotingContextualiser

getEvictionLock

public Sync getEvictionLock(String id,
                            Motable motable)
Specified by:
getEvictionLock in interface EvicterConfig
Overrides:
getEvictionLock in class AbstractExclusiveContextualiser

getEvictionEmoter

public Emoter getEvictionEmoter()
Specified by:
getEvictionEmoter in interface EvicterConfig
Overrides:
getEvictionEmoter in class AbstractExclusiveContextualiser

setLastAccessTime

public void setLastAccessTime(Evictable evictable,
                              long oldTime,
                              long newTime)

setMaxInactiveInterval

public void setMaxInactiveInterval(Evictable evictable,
                                   int oldInterval,
                                   int newInterval)
Specified by:
setMaxInactiveInterval in interface Contextualiser
Overrides:
setMaxInactiveInterval in class AbstractChainedContextualiser

expire

public void expire(Motable motable)


Copyright © 2004-2006 Core Developers Network Ltd.. All Rights Reserved.