Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
ATTR_NAME |
Constructor and Description |
---|
RequestScope(PetiteContainer pc) |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Scope referenceScope)
Returns
true if a bean of referenced scope can be
injected into target bean of this scope. |
protected java.util.Map<java.lang.String,jodd.petite.scope.RequestScope.TransientBeanData> |
createRequestMap(javax.servlet.http.HttpServletRequest servletRequest)
Creates instance map and stores it in the request.
|
protected javax.servlet.http.HttpServletRequest |
getCurrentHttpRequest()
Returns request from current thread.
|
protected java.util.Map<java.lang.String,jodd.petite.scope.RequestScope.TransientBeanData> |
getRequestMap(javax.servlet.http.HttpServletRequest servletRequest)
Returns instance map from http request.
|
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.
|
void |
remove(java.lang.String name)
Removes the bean from the scope entirely.
|
protected void |
removeRequestMap(javax.servlet.http.HttpServletRequest servletRequest)
Removes instance map from the request.
|
void |
shutdown()
Shutdowns the scope by removing all beans and calling
destroy methods.
|
public RequestScope(PetiteContainer pc)
protected java.util.Map<java.lang.String,jodd.petite.scope.RequestScope.TransientBeanData> getRequestMap(javax.servlet.http.HttpServletRequest servletRequest)
protected void removeRequestMap(javax.servlet.http.HttpServletRequest servletRequest)
protected java.util.Map<java.lang.String,jodd.petite.scope.RequestScope.TransientBeanData> createRequestMap(javax.servlet.http.HttpServletRequest servletRequest)
public void shutdown()
Scope
public java.lang.Object lookup(java.lang.String name)
Scope
null
if bean is not
found or yet registered.public void register(BeanDefinition beanDefinition, java.lang.Object bean)
Scope
BeanDefinition
.
Also it may register destroy methods of a bean within this scope.public void remove(java.lang.String name)
Scope
public boolean accept(Scope referenceScope)
Scope
true
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.HttpServletRequest getCurrentHttpRequest()
Copyright © 2003-present Jodd Team