View Javadoc

    1   /* Copyright 2004, 2005 Acegi Technology Pty Limited
    2    *
    3    * Licensed under the Apache License, Version 2.0 (the "License");
    4    * you may not use this file except in compliance with the License.
    5    * You may obtain a copy of the License at
    6    *
    7    *     http://www.apache.org/licenses/LICENSE-2.0
    8    *
    9    * 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}
    20   * object being invalid for whatever reason.
    21   *
    22   * @author Ben Alex
    23   * @version $Id: AuthenticationException.java,v 1.6 2005/11/17 00:55:49 benalex Exp $
    24   */
    25  public abstract class AuthenticationException extends AcegiSecurityException {
    26      //~ Instance fields ========================================================
    27
    28      /***
    29       * The authentication that related to this exception (may be
    30       * <code>null</code>)
    31       */
    32      private Authentication authentication;
    33
    34      //~ Constructors ===========================================================
    35
    36      /***
    37       * Constructs an <code>AuthenticationException</code> with the specified
    38       * message and root cause.
    39       *
    40       * @param msg the detail message
    41       * @param t the root cause
    42       */
    43      public AuthenticationException(String msg, Throwable t) {
    44          super(msg, t);
    45      }
    46
    47      /***
    48       * Constructs an <code>AuthenticationException</code> with the specified
    49       * message and no root cause.
    50       *
    51       * @param msg the detail message
    52       */
    53      public AuthenticationException(String msg) {
    54          super(msg);
    55      }
    56
    57      //~ Methods ================================================================
    58
    59      public Authentication getAuthentication() {
    60          return authentication;
    61      }
    62
    63      void setAuthentication(Authentication authentication) {
    64          this.authentication = authentication;
    65      }
    66  }