|
JSF-Spring | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.mindmatters.faces.spring.factory.ApplicationScope
public final class ApplicationScope
Alternative singleton Scope implementation. This Scope relies on a ServletContext and a PortletContext repectively and therefore will work with Servlet and Portlet environments.
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
logger
For logging. |
Constructor Summary | |
---|---|
ApplicationScope(java.lang.Object context)
Creates a scope relying on a ServletContext or a PortletContext respectively (depends on the type of context ). |
Method Summary | |
---|---|
void |
clear()
Clears the scope. |
java.lang.Object |
get(java.lang.String name,
ObjectFactory objectFactory)
Return the object from the underlying scope, creating it if not found. |
java.lang.String |
getConversationId()
Return the conversation id for the current underlying scope, if any. |
void |
registerDestructionCallback(java.lang.String name,
java.lang.Runnable callback)
Register a callback to be executed at destruction of the specified object (or at destruction of the entire scope, if the scope does not destroy individual objects but rather only terminate in its entirety). |
java.lang.Object |
remove(java.lang.String name)
Remove the object with the given name from the underlying scope. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.commons.logging.Log logger
Constructor Detail |
---|
public ApplicationScope(java.lang.Object context)
context
).
context
- The ServletContext or the PortletContext respectivelyMethod Detail |
---|
public java.lang.Object get(java.lang.String name, ObjectFactory objectFactory)
get
in interface Scope
name
- the name to bind withobjectFactory
- the ObjectFactory
used to create the scoped object if not present
public java.lang.Object remove(java.lang.String name)
Returns 'null
' if no object was found; otherwise
returns the removed Object
.
remove
in interface Scope
name
- the name of the object to remove
public void registerDestructionCallback(java.lang.String name, java.lang.Runnable callback)
Implementations should do their best to execute the callback at the appropriate time. If such a callback is not supported by the underlying runtime environment, the callback must be ignored and a corresponding warning should be logged.
registerDestructionCallback
in interface Scope
name
- the name of the object to execute the destruction callback forcallback
- the destruction callback to be executedpublic java.lang.String getConversationId()
getConversationId
in interface Scope
null
if there is no
conversation id concept for this scopepublic void clear()
|
JSF-Spring | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |