java.security
Class GuardedObject
java.lang.Object
|
+--java.security.GuardedObject
All Implemented Interfaces:
Serializable
This class is an object that is guarded by a Guard
object.
The object that is being guarded is retrieved by a call to the only
method in this class - getObject
. That method returns the
guarded Object
after first checking with the
Guard
. If the Guard
disallows access, an
exception will be thrown.
Since:Author:- Aaron M. Renn <arenn@urbanophile.com>
GuardedObject
public GuardedObject(java.lang.Object object, java.security.Guard guard)
This method initializes a new instance of GuardedObject
that protects the specified Object
using the specified
Guard
. A null guard means there are no restrictions on
accessing the object.
Parameters:
getObject
public Object getObject()
This method first call the checkGuard
method on the
Guard
object protecting the guarded object. If the
Guard
disallows access, an exception is thrown, otherwise
the Object
is returned.
Returns:
Throws:
Guard
object. The object that is being guarded is retrieved by a call to the only method in this class -getObject
. That method returns the guardedObject
after first checking with theGuard
. If theGuard
disallows access, an exception will be thrown.