01: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software
10: * distributed under the License is distributed on an "AS IS" BASIS,
11: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: * See the License for the specific language governing permissions and
13: * limitations under the License.
14: */
15:
16: package org.acegisecurity;
17:
18: /**
19: * Abstract superclass for all exceptions related an {@link Authentication} object being invalid for whatever
20: * reason.
21: *
22: * @author Ben Alex
23: * @version $Id: AuthenticationException.java 1496 2006-05-23 13:38:33Z benalex $
24: */
25: public abstract class AuthenticationException extends
26: AcegiSecurityException {
27: //~ Instance fields ================================================================================================
28:
29: /** The authentication that related to this exception (may be <code>null</code>) */
30: private Authentication authentication;
31:
32: //~ Constructors ===================================================================================================
33:
34: /**
35: * Constructs an <code>AuthenticationException</code> with the specified
36: * message and root cause.
37: *
38: * @param msg the detail message
39: * @param t the root cause
40: */
41: public AuthenticationException(String msg, Throwable t) {
42: super (msg, t);
43: }
44:
45: /**
46: * Constructs an <code>AuthenticationException</code> with the specified
47: * message and no root cause.
48: *
49: * @param msg the detail message
50: */
51: public AuthenticationException(String msg) {
52: super (msg);
53: }
54:
55: //~ Methods ========================================================================================================
56:
57: public Authentication getAuthentication() {
58: return authentication;
59: }
60:
61: void setAuthentication(Authentication authentication) {
62: this.authentication = authentication;
63: }
64: }
|