Microsoft SDK for Java

ExecutionRequest Class

The ExecutionRequest Class of the com.ms.security.permissions package represents a request to execute an application. It is intended to be used as the security request object for a parameterized security check involving the execution permission. The ExecutionPermission.check method expects an ExecutionRequest object as its parameter.

public class ExecutionRequest implements ISecurityRequest
{
  // Constructors
  public ExecutionRequest(String torun);

  // Methods
  public PermissionID getPermissionID();
  public String toString();
}

Example

The following example uses an ExecutionRequest object to perform a security check:

  ...

  // Create an ExecutionRequest object that indicates that you want
  // to execute the application "notepad.exe".

  ExecutionRequest sreq = new ExecutionRequest("notepad.exe");

  // Check to see that all of your callers have the rights to
  // execute the notepad program.

  PolicyEngine.checkPermission(sreq);

  ...

For more information about checking execution permissions, see the PolicyEngine class and the ExecutionPermission class.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.