org.codehaus.wadi.core.manager
Class StandardManager

java.lang.Object
  extended by org.codehaus.wadi.core.manager.StandardManager
All Implemented Interfaces:
Lifecycle, Manager
Direct Known Subclasses:
DistributableManager

public class StandardManager
extends java.lang.Object
implements Lifecycle, Manager

Version:
$Revision: 2415 $
Author:
Jules Gosnell

Field Summary
 
Fields inherited from interface org.codehaus.wadi.core.manager.Manager
NAME
 
Constructor Summary
StandardManager(SessionFactory sessionFactory, SessionIdFactory sessionIdFactory, Contextualiser contextualiser, ConcurrentMotableMap motableMap, Router router, SessionMonitor sessionMonitor)
           
 
Method Summary
 boolean contextualise(Invocation invocation)
          Contextualise an Invocation - somehow colocate the Invocation and the relevant Session within the same JVM somewhere in the Cluster, give the Invocation the Session and invoke() it.
 Session create(Invocation invocation)
          Create a new Session
protected  Session createSession(java.lang.String name)
           
 Session createWithName(java.lang.String name)
           
 void destroy(Session session)
          Destroy a Session
 int getMaxInactiveInterval()
           
 SessionIdFactory getSessionIdFactory()
           
 void init(ManagerConfig config)
          Initialise the Manager with information not readily available at construction time.
protected  void onSessionCreation(Session session)
           
protected  void onSessionDestruction(Session session)
           
protected  boolean processStateful(Invocation invocation)
           
protected  boolean processStateless(Invocation invocation)
           
 void setMaxInactiveInterval(int interval)
           
 void start()
           
 void stop()
           
 void triggerCallback()
           
protected  boolean validateSessionName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardManager

public StandardManager(SessionFactory sessionFactory,
                       SessionIdFactory sessionIdFactory,
                       Contextualiser contextualiser,
                       ConcurrentMotableMap motableMap,
                       Router router,
                       SessionMonitor sessionMonitor)
Method Detail

init

public void init(ManagerConfig config)
Description copied from interface: Manager
Initialise the Manager with information not readily available at construction time.

Specified by:
init in interface Manager
Parameters:
config - An object carrying configuration informations

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface Lifecycle
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Specified by:
stop in interface Lifecycle
Throws:
java.lang.Exception

createWithName

public Session createWithName(java.lang.String name)
                       throws SessionAlreadyExistException
Specified by:
createWithName in interface Manager
Throws:
SessionAlreadyExistException

create

public Session create(Invocation invocation)
Description copied from interface: Manager
Create a new Session

Specified by:
create in interface Manager
Parameters:
invocation - the Invocation
Returns:
the Session

destroy

public void destroy(Session session)
Description copied from interface: Manager
Destroy a Session

Specified by:
destroy in interface Manager
Parameters:
session - the Session

getMaxInactiveInterval

public int getMaxInactiveInterval()
Specified by:
getMaxInactiveInterval in interface Manager
Returns:
The maximum amount of time (in seconds) that a Session may lie inactive (i.e. without receiving an Invocation) before it should be garbage collected.

setMaxInactiveInterval

public void setMaxInactiveInterval(int interval)
Specified by:
setMaxInactiveInterval in interface Manager

getSessionIdFactory

public SessionIdFactory getSessionIdFactory()
Specified by:
getSessionIdFactory in interface Manager
Returns:
The factory responsible for the generation of Session IDs

triggerCallback

public void triggerCallback()

contextualise

public boolean contextualise(Invocation invocation)
                      throws InvocationException
Description copied from interface: Manager
Contextualise an Invocation - somehow colocate the Invocation and the relevant Session within the same JVM somewhere in the Cluster, give the Invocation the Session and invoke() it. The Manager possesses a stack of Contextualisers, down which the Invocation is passed in order to achieve this.

Specified by:
contextualise in interface Manager
Throws:
InvocationException

processStateful

protected boolean processStateful(Invocation invocation)
                           throws InvocationException
Throws:
InvocationException

processStateless

protected boolean processStateless(Invocation invocation)
                            throws InvocationException
Throws:
InvocationException

validateSessionName

protected boolean validateSessionName(java.lang.String name)

createSession

protected Session createSession(java.lang.String name)

onSessionCreation

protected void onSessionCreation(Session session)

onSessionDestruction

protected void onSessionDestruction(Session session)


Copyright © 2010. All Rights Reserved.