org.objectweb.jac.aspects.session
Class SessionWrapper

java.lang.Object
  extended byorg.objectweb.jac.core.Wrapper
      extended byorg.objectweb.jac.aspects.session.SessionWrapper
All Implemented Interfaces:
Advice, ConstructorInterceptor, Interceptor, MethodInterceptor, Serializable

public class SessionWrapper
extends Wrapper

This wrapper handles the session for each object within the JAC system.

Author:
Renaud Pawlak
See Also:
handleSession(Interaction), Serialized Form

Field Summary
protected static Hashtable applications
          Stores the applications (sid -> applicationName)
protected static Hashtable sessions
          Stores the sessions and their contextual attributes (sid -> saved attributes).
 
Fields inherited from class org.objectweb.jac.core.Wrapper
ac, cr
 
Constructor Summary
SessionWrapper(AspectComponent ac)
           
 
Method Summary
 void clearCurrentSessionAttribute(String name)
          Removes a session attribute.
 Object construct(ConstructorInvocation invocation)
           
 Object handleSession(Interaction interaction)
          Handles sessions for the wrapped method.
 Object invoke(MethodInvocation invocation)
           
 
Methods inherited from class org.objectweb.jac.core.Wrapper
attr, attrdef, defines, getAspectComponent, getAspectComponentName, getExceptionHandlers, proceed, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sessions

protected static Hashtable sessions
Stores the sessions and their contextual attributes (sid -> saved attributes).


applications

protected static Hashtable applications
Stores the applications (sid -> applicationName)

Constructor Detail

SessionWrapper

public SessionWrapper(AspectComponent ac)
Method Detail

clearCurrentSessionAttribute

public void clearCurrentSessionAttribute(String name)
Removes a session attribute.

The given attribute will be forgotten for the current interaction and for all the forthcoming interactions of the same session. This can be used for instance to log-out a user.

Parameters:
name - the name of the attribute to forget

handleSession

public Object handleSession(Interaction interaction)
Handles sessions for the wrapped method.

The session handling algorithm is:

Returns:
the wrapped method return value

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Overrides:
invoke in class Wrapper
Throws:
Throwable

construct

public Object construct(ConstructorInvocation invocation)
                 throws Throwable
Specified by:
construct in interface ConstructorInterceptor
Overrides:
construct in class Wrapper
Throws:
Throwable