public class ProxiedSession extends Objectimplements Session
Session implementation that immediately delegates all corresponding calls to an underlying proxied session instance.
This class is mostly useful for framework subclassing to intercept certain
Session calls and perform additional logic.
| Modifier and Type | Field and Description |
|---|---|
protected Session |
delegate
The proxied instance
|
| Constructor and Description |
|---|
ProxiedSession(Session
Constructs an instance that proxies the specified
target.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(Object
Immediately delegates to the underlying proxied session.
|
Collection |
getAttributeKeys()
Immediately delegates to the underlying proxied session.
|
String |
getHost()
Immediately delegates to the underlying proxied session.
|
Serializable |
getId()
Immediately delegates to the underlying proxied session.
|
Date |
getLastAccessTime()
Immediately delegates to the underlying proxied session.
|
Date |
getStartTimestamp()
Immediately delegates to the underlying proxied session.
|
long |
getTimeout()
Immediately delegates to the underlying proxied session.
|
Object |
removeAttribute(Object
Immediately delegates to the underlying proxied session.
|
void |
setAttribute(Object
Immediately delegates to the underlying proxied session.
|
void |
setTimeout(long maxIdleTimeInMillis)
Immediately delegates to the underlying proxied session.
|
void |
stop()
Immediately delegates to the underlying proxied session.
|
void |
touch()
Immediately delegates to the underlying proxied session.
|
protected final Sessiondelegate
public ProxiedSession(Sessiontarget)
target. Subclasses may access this target via the
protected final 'delegate' attribute, i.e.
this.delegate.
target - the specified target
Session to proxy.
public SerializablegetId()
public DategetStartTimestamp()
getStartTimestamp in interface
Session
public DategetLastAccessTime()
getLastAccessTime in interface
Session
Session.touch()
public long getTimeout()
throws InvalidSessionException
getTimeout in interface
Session
InvalidSessionException - if the session has been stopped or expired prior to calling this method.
public void setTimeout(long maxIdleTimeInMillis)
throws InvalidSessionException
setTimeout in interface
Session
maxIdleTimeInMillis - the time in milliseconds that the session may remain idle before expiring.
InvalidSessionException - if the session has been stopped or expired prior to calling this method.
public StringgetHost()
public void touch()
throws InvalidSessionException
touch in interface
Session
InvalidSessionException - if this session has stopped or expired prior to calling this method.
public void stop()
throws InvalidSessionException
stop in interface
Session
InvalidSessionException - if this session has stopped or expired prior to calling this method.
public Collection<Object > getAttributeKeys() throws InvalidSessionException
getAttributeKeys in interface
Session
InvalidSessionException - if this session has stopped or expired prior to calling this method.
public ObjectgetAttribute(Object key) throws InvalidSessionException
getAttribute in interface
Session
key - the unique name of the object bound to this session
key name or
null if there is no object bound under that name.
InvalidSessionException - if this session has stopped or expired prior to calling this method.
public void setAttribute(Objectkey, Object value) throws InvalidSessionException
setAttribute in interface
Session
key - the name under which the
value object will be bound in this session
value - the object to bind in this session.
InvalidSessionException - if this session has stopped or expired prior to calling this method.
public ObjectremoveAttribute(Object key) throws InvalidSessionException
removeAttribute in interface
Session
key - the name uniquely identifying the object to remove
null if there was no object bound under the name
key.
InvalidSessionException - if this session has stopped or expired prior to calling this method.