加载中...
The Wayback Machine - https://sup1a9wrlpyh5li9ro.vcoronado.top/web/20090326194301/http://developer.android.com:80/reference/java/security/GuardedObject.html
public class

GuardedObject

extends Object
implements Serializable
java.lang.Object
   ↳ java.security.GuardedObject

Class Overview

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 GuardedObject to protect access to the specified Object using the specified Guard.
Public Methods
Object getObject()
Checks whether access should be granted to the object.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public GuardedObject (Object object, Guard guard)

Constructs a GuardedObject to protect access to the specified Object using the specified Guard.

Parameters
object the Object to guard
guard the Guard

Public Methods

public Object getObject ()

Checks whether access should be granted to the object. If access is granted, this method returns the object. If it is not granted, then a SecurityException is thrown.

Returns
  • the guarded object
Throws
SecurityException If access is not granted to the object