Source Code Cross Referenced for SaslException.java in  » 6.0-JDK-Core » security » javax » security » sasl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » security » javax.security.sasl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 1999-2003 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025
026        package javax.security.sasl;
027
028        import java.io.IOException;
029
030        /**
031         * This class represents an error that has occurred when using SASL.
032         *
033         * @since 1.5
034         *
035         * @author Rosanna Lee
036         * @author Rob Weltman
037         */
038
039        public class SaslException extends IOException {
040            /**
041             * The possibly null root cause exception.
042             * @serial
043             */
044            // Required for serialization interoperability with JSR 28
045            private Throwable _exception;
046
047            /**
048             * Constructs a new instance of <tt>SaslException</tt>.
049             * The root exception and the detailed message are null.
050             */
051            public SaslException() {
052                super ();
053            }
054
055            /**
056             * Constructs a new instance of <tt>SaslException</tt> with a detailed message.
057             * The root exception is null.
058             * @param detail A possibly null string containing details of the exception.
059             *
060             * @see java.lang.Throwable#getMessage
061             */
062            public SaslException(String detail) {
063                super (detail);
064            }
065
066            /**
067             * Constructs a new instance of <tt>SaslException</tt> with a detailed message
068             * and a root exception.
069             * For example, a SaslException might result from a problem with
070             * the callback handler, which might throw a NoSuchCallbackException if
071             * it does not support the requested callback, or throw an IOException
072             * if it had problems obtaining data for the callback. The
073             * SaslException's root exception would be then be the exception thrown
074             * by the callback handler.
075             *
076             * @param detail A possibly null string containing details of the exception.
077             * @param ex A possibly null root exception that caused this exception.
078             *
079             * @see java.lang.Throwable#getMessage
080             * @see #getCause
081             */
082            public SaslException(String detail, Throwable ex) {
083                super (detail);
084                if (ex != null) {
085                    initCause(ex);
086                }
087            }
088
089            /*
090             * Override Throwable.getCause() to ensure deserialized object from
091             * JSR 28 would return same value for getCause() (i.e., _exception).
092             */
093            public Throwable getCause() {
094                return _exception;
095            }
096
097            /*
098             * Override Throwable.initCause() to match getCause() by updating
099             * _exception as well.
100             */
101            public Throwable initCause(Throwable cause) {
102                super .initCause(cause);
103                _exception = cause;
104                return this ;
105            }
106
107            /**
108             * Returns the string representation of this exception.
109             * The string representation contains
110             * this exception's class name, its detailed messsage, and if
111             * it has a root exception, the string representation of the root
112             * exception. This string representation
113             * is meant for debugging and not meant to be interpreted
114             * programmatically.
115             * @return The non-null string representation of this exception.
116             * @see java.lang.Throwable#getMessage
117             */
118            // Override Throwable.toString() to conform to JSR 28
119            public String toString() {
120                String answer = super .toString();
121                if (_exception != null && _exception != this ) {
122                    answer += " [Caused by " + _exception.toString() + "]";
123                }
124                return answer;
125            }
126
127            /** Use serialVersionUID from JSR 28 RI for interoperability */
128            private static final long serialVersionUID = 4579784287983423626L;
129        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.