List of usage examples for java.security GuardedObject GuardedObject
public GuardedObject(Object object, Guard guard)
From source file:Main.java
public static void main(String[] argv) throws Exception { String secretObj = "secret"; Guard guard = new PropertyPermission("java.home", "read"); GuardedObject gobj = new GuardedObject(secretObj, guard); try {/*from ww w . j a v a 2 s . co m*/ Object o = gobj.getObject(); } catch (AccessControlException e) { e.printStackTrace(); } }