com.thoughtworks.proxy.toys.privilege
Class AccessControllerExecutor

java.lang.Object
  extended by com.thoughtworks.proxy.toys.privilege.AccessControllerExecutor
All Implemented Interfaces:
ActionExecutor

public class AccessControllerExecutor
extends Object
implements ActionExecutor

Execution of a PrivilegedExceptionAction with the AccessController.

Since:
1.0
Author:
Jörg Schaible

Constructor Summary
AccessControllerExecutor()
          Construct an AccessControllerExecutor that runs a PrivilegedExceptionAction with the privileges of the AccessControlContext of the caller.
AccessControllerExecutor(AccessControlContext context)
          Construct an AccessControllerExecutor that runs a PrivilegedExceptionAction with special privileges.
 
Method Summary
 Object execute(PrivilegedExceptionAction<Object> action)
          Execute a PrivilegedExceptionAction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessControllerExecutor

public AccessControllerExecutor()
Construct an AccessControllerExecutor that runs a PrivilegedExceptionAction with the privileges of the AccessControlContext of the caller.

Since:
1.0

AccessControllerExecutor

public AccessControllerExecutor(AccessControlContext context)
Construct an AccessControllerExecutor that runs a PrivilegedExceptionAction with special privileges.

Parameters:
context - the AccessControlContext defining the privileges used to run the action
Since:
1.0
Method Detail

execute

public Object execute(PrivilegedExceptionAction<Object> action)
               throws PrivilegedActionException
Description copied from interface: ActionExecutor
Execute a PrivilegedExceptionAction.

Specified by:
execute in interface ActionExecutor
Parameters:
action - the action to run
Returns:
the return value of the action
Throws:
PrivilegedActionException - if the execution of the action fails


Copyright © 2005-2010 Codehaus. All Rights Reserved.