KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > common > domains > registry > DomainRegistryException


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.admin.common.domains.registry;
25 /**
26    Instances of this class represent an exception from the domain
27    registry abstraction.
28    <p>
29    Subclasses indicate specific issues from that abstraction
30 */

31 import java.security.PrivilegedActionException JavaDoc;
32
33 public class DomainRegistryException extends Exception JavaDoc
34 {
35       /**
36          Constructs a new exception with null as its detail
37    message. The cause is not initialized, and may subsequently be
38    initialized by a call to {@link Throwable#initCause(Throwable)}
39       */

40
41   public DomainRegistryException(){
42     super();
43   }
44
45       /**
46          Constructs a new exception with the specified detail
47          message. The cause is not initialized, and may subsequently
48          be initialized by a call to {@link Throwable#initCause(Throwable)}
49
50          @param message - the detail message. The detail message is
51          saved for later retrieval by the {@link Throwable#getMessage()} method.
52       */

53   public DomainRegistryException(String JavaDoc message){
54     super(message);
55   }
56
57       /**
58          Constructs a new exception with the specified detail message and cause.
59          <p>
60          Note that the detail message associated with cause is not
61          automatically incorporated in this exception's detail
62          message.
63
64          @param message - the detail message (which is saved for later
65          retrieval by the {@link Throwable#getMessage()} method).
66          @param cause - the cause (which is saved for later retrieval by the
67          {@link Throwable#getCause()} method). (A null value is
68          permitted, and indicates that the cause is nonexistent or
69          unknown.)
70       */

71   public DomainRegistryException(String JavaDoc message,
72                    Throwable JavaDoc cause){
73     super(message+" "+cause.getMessage());
74     this.cause = cause;
75   }
76
77       /**
78          Constructs a new exception with the specified cause detail
79          message. The
80          detail message will be <code>(cause==null ? null :
81          cause.toString())</code> (which typically contains the class
82          and detail message of cause). This constructor is useful for
83          exceptions that are little more than wrappers for other
84          throwables (for example, {@link PrivilegedActionException}).
85
86          @param cause - the cause (which is saved for later retrieval
87          by the {@link Throwable#getCause()} method). (A null value is
88          permitted, and indicates that the cause is nonexistent or
89          unknown.)
90       */

91   public DomainRegistryException(Throwable JavaDoc cause){
92     super(cause.getMessage());
93     this.cause = cause;
94   }
95
96   private Throwable JavaDoc cause;
97          
98 }
99
Popular Tags