| This method to be invoked in the Thread's constructor. The first argument
(thread) must be Thread's this and the second must be a snapshot of the
current AccessControlContext:
Thread() {
SecurityUtils.putContext(this,AccessController.getContext());
...do the stuff you need...
}
The method throws SecurityException if the method is called more than
once for a given thread. The first call to putContext is
always performed in the Thread's constructor so this effectively means
that no one can replace the snapshot taken.
throws: SecurityException - if a context for the passed thread already exists in the map. throws: NullPointerException - if thread is null throws: Error - if context is null AND if null context is already stored in the map |