|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--net.larsan.norna.util.ThreadScope
The thread scope is used by Norna framework implementations to distinguish between the owners of excuting threads. The scope keeps executing IDs in a stack which can be entered and exited before and after calling any method.
The ID used by the thread scope is a Namespace ID (please refer to the Namespace
documentation for more information if framework IDs.
A service is be required by the Norna specification to enter a thread scope using its Namespace ID as soon
as it call a method on any object outside its own namespace. In particular a service should enter
the thread scope when dealing with: 1) Other services; 2) The ServiceRegistry, and; 3) When calling methods on its Context.
A service get its Namespace ID from the Context. The thread scope is
only used when services access each other and the registry, and any service that does so must implement
the Loadable interface.
The thread scope uses the ThreadScopePermission to access to the methods of this
class. In particual, no service should have access to the clear method.
net.larsan.norna.Context| Method Summary | |
static void |
clear()
Clear the current execution stack of all IDs. |
static java.lang.String |
current()
Get the ID of the current executing service. |
static void |
enter(java.lang.String nuid)
Enter thread scope from a particular ID. |
static void |
exit(java.lang.String nuid)
Exit current ID scope. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static void enter(java.lang.String nuid)
nuid - Namespace unique ID for the service entering the scopepublic static java.lang.String current()
public static void exit(java.lang.String nuid)
nuid - namespace unique ID to exit frompublic static void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||