org.codehaus.wadi
Interface Contextualiser

All Superinterfaces:
Lifecycle
All Known Implementing Classes:
AbstractContextualiser, SimpleContextualiserStack

public interface Contextualiser
extends Lifecycle

Contextualising a request is realising/processing it within the correct Context, in other words, in the presence of the required HttpSession, if any. A Contextualiser can choose to either process the request within itself, or promote a Context to its caller, within which the request may be processed. It should indicate to its caller, via return code, whether said processing has already been carried out or not.

Version:
$Revision: 1430 $
Author:
Jules Gosnell

Method Summary
 boolean contextualise(InvocationContext invocationContext, String id, Immoter immoter, Sync motionLock, boolean exclusiveOnly)
           
 void destroy()
           
 void findRelevantSessionNames(int numPartitions, Collection[] resultSet)
           
 Immoter getDemoter(String name, Motable motable)
          Return a Demoter to the first Contextualiser which would be happy to accept this Motable - in other words - would not evict() it.
 int getLocalSessionCount()
           
 Immoter getSharedDemoter()
           
 void init(ContextualiserConfig config)
           
 boolean isExclusive()
           
 void load(Emoter emoter, Immoter immoter)
           
 void promoteToExclusive(Immoter immoter)
           
 void setLastAccessedTime(Evictable evictable, long oldTime, long newTime)
           
 void setMaxInactiveInterval(Evictable evictable, int oldInterval, int newInterval)
           
 
Methods inherited from interface org.codehaus.wadi.Lifecycle
start, stop
 

Method Detail

contextualise

public boolean contextualise(InvocationContext invocationContext,
                             String id,
                             Immoter immoter,
                             Sync motionLock,
                             boolean exclusiveOnly)
                      throws InvocationException
Throws:
InvocationException

setLastAccessedTime

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

setMaxInactiveInterval

public void setMaxInactiveInterval(Evictable evictable,
                                   int oldInterval,
                                   int newInterval)

isExclusive

public boolean isExclusive()

getDemoter

public Immoter getDemoter(String name,
                          Motable motable)
Return a Demoter to the first Contextualiser 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

getSharedDemoter

public Immoter getSharedDemoter()

promoteToExclusive

public void promoteToExclusive(Immoter immoter)

load

public void load(Emoter emoter,
                 Immoter immoter)

init

public void init(ContextualiserConfig config)

destroy

public void destroy()

findRelevantSessionNames

public void findRelevantSessionNames(int numPartitions,
                                     Collection[] resultSet)

getLocalSessionCount

public int getLocalSessionCount()


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