Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.security

Class GuardedObject

java.lang.Object
|
+--java.security.GuardedObject

All Implemented Interfaces:

Serializable


public class GuardedObject

extends Object

implements 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:

Constructor Summary

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.

Method Summary

java.lang.ObjectgetObject()

This method first call the checkGuard method on the Guard object protecting the guarded object.

Constructor Details

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:


Method Details

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: