java.security
Class AccessControlException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by java.lang.SecurityException
                  extended by java.security.AccessControlException
All Implemented Interfaces:
Serializable

public class AccessControlException
extends SecurityException

This exception is thrown when the AccessController denies an attempt to perform an operation. This often keeps track of the permission that was not granted.

See Also:
AccessController, Serialized Form

Constructor Summary
AccessControlException(String msg)
          Create a new instance with a descriptive error message, and a null Permission object.
AccessControlException(String msg, Permission perm)
          Create a new instance with a descriptive error message and an associated Permission object.
 
Method Summary
 Permission getPermission()
          This method returns the Permission object that caused this exception to be thrown.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AccessControlException

public AccessControlException(String msg)
Create a new instance with a descriptive error message, and a null Permission object.

Parameters:
msg - the descriptive error message

AccessControlException

public AccessControlException(String msg,
                              Permission perm)
Create a new instance with a descriptive error message and an associated Permission object.

Parameters:
msg - the descriptive error message
perm - the permission that caused this
Method Detail

getPermission

public Permission getPermission()
This method returns the Permission object that caused this exception to be thrown.

Returns:
the denied permission, or null