public class SessionScope extends ShutdownAwareScope
RequestContextListener is used for accessing
 the request and the session.| Modifier and Type | Class and Description | 
|---|---|
| class  | SessionScope.SessionBeansSession beans holder and manager. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected static java.lang.String | SESSION_BEANS_NAME | 
destroyableBeans| Constructor and Description | 
|---|
| SessionScope(PetiteContainer pc) | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | accept(Scope referenceScope)Returns  trueif a bean of referenced scope can be
 injected into target bean of this scope. | 
| protected javax.servlet.http.HttpSession | getCurrentHttpSession()Returns request from current thread. | 
| protected java.util.Map<java.lang.String,BeanData> | getSessionMap(javax.servlet.http.HttpSession session)Returns instance map from http session. | 
| java.lang.Object | lookup(java.lang.String name)Lookups for bean name. | 
| void | register(BeanDefinition beanDefinition,
        java.lang.Object bean)Registers the bean within the current scope. | 
| protected java.util.Map<java.lang.String,BeanData> | registerSessionBeans(javax.servlet.http.HttpSession httpSession)Registers new session destroy callback if not already registered. | 
| void | remove(java.lang.String name)Removes the bean from the scope entirely. | 
| void | shutdown()Shutdowns the Session scope. | 
destroyBean, isBeanDestroyable, registerDestroyableBeans, totalRegisteredDestroyableBeanspublic SessionScope(PetiteContainer pc)
protected java.util.Map<java.lang.String,BeanData> registerSessionBeans(javax.servlet.http.HttpSession httpSession)
protected java.util.Map<java.lang.String,BeanData> getSessionMap(javax.servlet.http.HttpSession session)
public void shutdown()
shutdown in interface Scopeshutdown in class ShutdownAwareScopepublic java.lang.Object lookup(java.lang.String name)
Scopenull if bean is not
 found or yet registered.public void register(BeanDefinition beanDefinition, java.lang.Object bean)
ScopeBeanDefinition.
 Also it may register destroy methods of a bean within this scope.public void remove(java.lang.String name)
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.
 
Helpful is to ask the following question: "May the reference scope bean be injected into bean of this scope?".
protected javax.servlet.http.HttpSession getCurrentHttpSession()
Copyright © 2003-present Jodd Team