public final class ScopeObserver extends java.lang.Object implements ScopePublisher
ScopeObserver
is bound to a session and manages the scope changes of a user within the
session.
All scopes are maintained in a stack. If the ScopeObserver
gets notified about entering a new scope, the new scope is pushed
a the top of this stack. Exiting a scope will cause the observer to
remove the exited scope from the stack.
| Constructor and Description |
|---|
ScopeObserver()
Constructs a new object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addScopeSubscriber(ScopeSubscriber subscriber)
Add the given subscriber to the list of known
ScopeSubscribers. |
Scope |
currentScope()
Retrieve the current scope.
|
void |
enterScope(Scope scope)
The application has entered the given scope.
|
void |
exitScope(Scope scope)
The application has left the given scope.
|
void |
removeScopeSubscriber(ScopeSubscriber subscriber)
Remove the given subscriber from the list of known
ScopeSubscribers. |
public void enterScope(Scope scope)
scope - The new scope.public void exitScope(Scope scope)
scope - The scope to exit.public Scope currentScope()
null if there is none.public void addScopeSubscriber(ScopeSubscriber subscriber)
ScopeSubscribers.addScopeSubscriber in interface ScopePublishersubscriber - The subscriber to add.public void removeScopeSubscriber(ScopeSubscriber subscriber)
ScopeSubscribers.removeScopeSubscriber in interface ScopePublishersubscriber - The subscriber to remove.