KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > deployers > spi > DeploymentException


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2006, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.deployers.spi;
23
24 /**
25  * DeploymentException.
26  *
27  * @author <a HREF="mailto:dimitris@jboss.org">Dimitris Andreadis</a>
28  * @author <a HREF="adrian@jboss.com">Adrian Brock</a>
29  * @version $Revision: 1.1 $
30  */

31 public class DeploymentException extends Exception JavaDoc
32 {
33    /** The serialVersionUID */
34    private static final long serialVersionUID = 4495361010574179178L;
35
36    /**
37     * Rethrow a throwable as a deployment exception if it isn't already.
38     *
39     * @param message the message
40     * @param t the throwable
41     * @return never
42     * @throws DeploymentException always
43     */

44    public static DeploymentException rethrowAsDeploymentException(String JavaDoc message, Throwable JavaDoc t) throws DeploymentException
45    {
46       if (t instanceof DeploymentException)
47          throw (DeploymentException) t;
48       else
49          throw new DeploymentException(message, t);
50    }
51
52    /**
53     * Constructs a <code>DeploymentException</code> with <code>null</code>
54     * as its error detail message.
55     */

56    public DeploymentException()
57    {
58    }
59
60    /**
61     * Constructs a <code>DeploymentException</code> with the specified detail
62     * message. The error message string <code>s</code> can later be
63     * retrieved by the <code>{@link java.lang.Throwable#getMessage}</code>
64     * method of class <code>java.lang.Throwable</code>.
65     *
66     * @param s the message
67     */

68    public DeploymentException(String JavaDoc s)
69    {
70       super(s);
71    }
72    
73    /**
74     * Constructs a <code>DeploymentException</code> with the specified detail message and
75     * cause. <p>Note that the detail message associated with
76     * <code>cause</code> is <i>not</i> automatically incorporated in
77     * this exception's detail message.
78     *
79     * @param s the message
80     * @param cause the underlying cause
81     */

82    public DeploymentException(String JavaDoc s, Throwable JavaDoc cause)
83    {
84       super(s, cause);
85    }
86    
87    /**
88      * Constructs a <code>DeploymentException</code> with the specified cause and a detail
89      * message of <tt>(cause==null ? null : cause.toString())</tt> (which
90      * typically contains the class and detail message of <tt>cause</tt>).
91      * This constructor is useful for exceptions that are little more than
92      * wrappers for other throwables (for example, {@link
93      * java.security.PrivilegedActionException}).
94      *
95      * @param cause the underlying cause
96     */

97    public DeploymentException(Throwable JavaDoc cause)
98    {
99       super(cause);
100    }
101 }
102
Popular Tags