Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mortbay.j2ee.session
Class BindingInterceptor  view BindingInterceptor download BindingInterceptor.java

java.lang.Object
  extended byorg.mortbay.j2ee.session.StateInterceptor
      extended byorg.mortbay.j2ee.session.BindingInterceptor
All Implemented Interfaces:
java.lang.Cloneable, State

public class BindingInterceptor
extends StateInterceptor

A BindingInterceptor is responsible for notifying HttpSessionAttributeListeners when Attributes are added to, removed from or replaced in a Session and HttpSessionBindingListeners when attributes are bound into or unbound from a Session.

This is an expensive Interceptor to use since it requires that on rebinding an attribute in the Session, the old value is returned in case it is a Listener requiring notification of it's removal.If you are using a distributed store, this requirement will result in a serialisation and network traffic overhead which may not actually be necessary. Unfortunately it would be expensive to decide at runtime whether to add this interceptor since one of these Listeners might be bound into the session at any time from any node. This may be addressed in a future release.

Version:
1.0

Field Summary
protected static org.jboss.logging.Logger _log
           
 
Fields inherited from class org.mortbay.j2ee.session.StateInterceptor
 
Constructor Summary
BindingInterceptor()
           
 
Method Summary
protected  java.lang.Object notifyValueBound(java.lang.String name, java.lang.Object value)
           
protected  java.lang.Object notifyValueUnbound(java.lang.String name, java.lang.Object value)
           
 java.lang.Object removeAttribute(java.lang.String name, boolean returnValue)
          removeAttribute is overriden in order to notify HttpSessionAttribute and HttpSessionBindingListeners of relative Attribute changes.
 java.lang.Object setAttribute(java.lang.String name, java.lang.Object value, boolean returnValue)
          setAttribute is overriden in order to notify HttpSessionAttribute and HttpSessionBindingListeners of relative Attribute changes.
 
Methods inherited from class org.mortbay.j2ee.session.StateInterceptor
clone, getActualMaxInactiveInterval, getAttribute, getAttributeNameEnumeration, getAttributeNameStringArray, getAttributes, getCreationTime, getId, getLastAccessedTime, getManager, getMaxInactiveInterval, getSession, getState, isValid, setAttributes, setLastAccessedTime, setManager, setMaxInactiveInterval, setSession, setState, start, stop, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_log

protected static final org.jboss.logging.Logger _log
Constructor Detail

BindingInterceptor

public BindingInterceptor()
Method Detail

notifyValueUnbound

protected java.lang.Object notifyValueUnbound(java.lang.String name,
                                              java.lang.Object value)

notifyValueBound

protected java.lang.Object notifyValueBound(java.lang.String name,
                                            java.lang.Object value)

setAttribute

public java.lang.Object setAttribute(java.lang.String name,
                                     java.lang.Object value,
                                     boolean returnValue)
                              throws java.rmi.RemoteException
setAttribute is overriden in order to notify HttpSessionAttribute and HttpSessionBindingListeners of relative Attribute changes.

Specified by:
setAttribute in interface State
Overrides:
setAttribute in class StateInterceptor

removeAttribute

public java.lang.Object removeAttribute(java.lang.String name,
                                        boolean returnValue)
                                 throws java.rmi.RemoteException
removeAttribute is overriden in order to notify HttpSessionAttribute and HttpSessionBindingListeners of relative Attribute changes.

Specified by:
removeAttribute in interface State
Overrides:
removeAttribute in class StateInterceptor