01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /**
19: * @author Alexander V. Astapchuk
20: * @version $Revision$
21: */package java.security;
22:
23: /**
24: * This runtime exception is thrown when an access control check indicates that
25: * access should not be granted.
26: *
27: */
28: public class AccessControlException extends SecurityException {
29:
30: private static final long serialVersionUID = 5138225684096988535L;
31:
32: /**
33: * @com.intel.drl.spec_ref
34: */
35: private Permission perm; // Named as demanded by Serialized Form.
36:
37: /**
38: * Constructs a new instance of this class with its walkback and message
39: * filled in.
40: *
41: *
42: * @param message
43: * String The detail message for the exception.
44: */
45: public AccessControlException(String message) {
46: super (message);
47: }
48:
49: /**
50: * Constructs a new instance of this class with its walkback, message and
51: * associated permission all filled in.
52: *
53: *
54: * @param message
55: * String The detail message for the exception.
56: * @param perm
57: * Permission The failed permission.
58: */
59: public AccessControlException(String message, Permission perm) {
60: super (message);
61: this .perm = perm;
62: }
63:
64: /**
65: * Answers the receiver's permission.
66: *
67: *
68: * @return Permission the receiver's permission
69: */
70: public Permission getPermission() {
71: return perm;
72: }
73: }
|