Skip to content

Most visited

Recently visited

navigation
Added in API level 1

GuardedObject

public class GuardedObject
extends Object implements Serializable

java.lang.Object
   ↳ java.security.GuardedObject


GuardedObject controls access to an object, by checking all requests for the object with a Guard.

Summary

Public constructors

GuardedObject(Object object, Guard guard)

Constructs a new instance of GuardedObject which protects access to the specified Object using the specified Guard.

Public methods

Object getObject()

Returns the guarded Object if the associated Guard permits access.

Inherited methods

From class java.lang.Object

Public constructors

GuardedObject

Added in API level 1
GuardedObject (Object object, 
                Guard guard)

Constructs a new instance of GuardedObject which protects access to the specified Object using the specified Guard.

Parameters
object Object: the Object to protect.
guard Guard: the Guard which protects the specified Object, maybe null.

Public methods

getObject

Added in API level 1
Object getObject ()

Returns the guarded Object if the associated Guard permits access. If access is not granted, then a SecurityException is thrown.

Returns
Object the guarded object.
Throws
SecurityException if access is not granted to the guarded object.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.