|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Scope
A Scope is a collection of arbitrary Java objects,
keyed by String-valued names. Specialized workflow implementations
will register their own Scope
implementations to connect
the workflow engine processing to their own execution environments.
For example, a web layer implementation would most likely adapt
Scopes to the request attributes, session attributes, and servlet
context attributes provided by the Servlet API.
A Scope implements the API contracts of java.util.Map
with the following additional rules:
java.lang.String
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry |
Method Summary | |
---|---|
void |
addScopeListener(ScopeListener listener)
Add a listener that is notified each time beans are added, replaced, or removed in this scope. |
void |
clear()
Remove all beans from this Map and call scopeCleared() on
all registered |
Object |
put(String key,
Object bean)
Add the specified bean, associated with the specified key, to this scope and replace any previous bean associated with this key. |
Object |
remove(String key)
Remove the bean associated with the specified key (if any). |
void |
removeScopeListener(ScopeListener listener)
Remove a listener that is notified each time beans are added, replaced, or removed in this scope. |
Methods inherited from interface java.util.Map |
---|
containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Method Detail |
---|
void clear()
scopeCleared() on
all registered ScopeListeners
.
- Specified by:
clear
in interface Map
Object put(String key, Object bean)
beanAdded()
on all registered
listeners after the add is done. If an old bean was replaced,
call beanReplaced()
(passing the old value in the event)
on all registered ScopeListeners
after the removal
is done. If a bean was replaced, the old value is also returned;
otherwise null
is returned.
key
- Key with which the new value should be associated
(cannot be null)bean
- Bean to be associated with this key (cannot be null)
IllegalArgumentException
- if key
or
bean
is nullObject remove(String key)
beanRemoved()
on all
registered ScopeListeners
after the removal is done.
Return the old value (if any); otherwise return null
.
key
- Key of the bean to remove (cannot be null)
IllegalArgumentException
- if key
is nullvoid addScopeListener(ScopeListener listener)
listener
- The ScopeListener to be addedvoid removeScopeListener(ScopeListener listener)
listener
- The ScopeListener to be removed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |