Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
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 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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public GuardedObject ( Object object, Guard guard)

Added in API level 1

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

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

Public Methods

public Object getObject ()

Added in API level 1

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

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