|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjodd.petite.scope.SessionScope
public class SessionScope
Session scope stores unique object instances per single http session.
Upon creation, new session listener is registered (dynamically) that will
keep track on active sessions. RequestContextListener is used for accessing
the request and HttpSessionListenerBroadcaster is used for listening
session lifecycle.
| Field Summary | |
|---|---|
protected Map<String,Map<String,Object>> |
sessionInstances
|
protected HttpSessionListenerBroadcaster |
sessionListeners
|
| Constructor Summary | |
|---|---|
SessionScope()
|
|
| Method Summary | |
|---|---|
boolean |
accept(Scope referenceScope)
Returns true if a bean of referenced scope can be
injected into target bean of this scope. |
protected String |
getHttpSessionId()
Returns request from current thread. |
Object |
lookup(String name)
Lookups for bean name. |
void |
register(String name,
Object bean)
Registers the bean within the current scope. |
void |
remove(String name)
Removes the bean from the scope entirely. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Map<String,Map<String,Object>> sessionInstances
protected final HttpSessionListenerBroadcaster sessionListeners
| Constructor Detail |
|---|
public SessionScope()
| Method Detail |
|---|
public Object lookup(String name)
Scoperegistration,
therefore it should returns null if object is not
yet registered.
lookup in interface Scope
public void register(String name,
Object bean)
Scope
register in interface Scopepublic void remove(String name)
Scope
remove in interface Scopepublic boolean accept(Scope referenceScope)
Scopetrue if a bean of referenced scope can be
injected into target bean of this scope. Otherwise, returns
false, which may be a sign for scoped proxy to be
injected.
In general, injection of 'shorter' reference scopes
into the 'longer' target scopes should not be accepted.
In other words, if reference scope is 'longer' or equal (same),
this method should return true.
accept in interface Scopeprotected String getHttpSessionId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||