01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * 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.deployment;
23:
24: import org.jboss.util.NestedException;
25:
26: /**
27: * Thrown by a deployer if an application component could not be
28: * deployed.
29: *
30: * @see DeployerMBean
31: *
32: * @author <a href="mailto:toby.allsopp@peace.com">Toby Allsopp</a>
33: * @version $Revision: 57205 $
34: */
35: public class DeploymentException extends NestedException {
36: /** @since 4.0.2 */
37: private static final long serialVersionUID = 1416258464473965574L;
38:
39: /**
40: * Rethrow a throwable as a deployment exception if it isn't already.
41: *
42: * @param message the message
43: * @param t the throwable
44: * @throws a DeploymentException
45: */
46: public static void rethrowAsDeploymentException(String message,
47: Throwable t) throws DeploymentException {
48: if (t instanceof DeploymentException)
49: throw (DeploymentException) t;
50: else
51: throw new DeploymentException(message, t);
52: }
53:
54: /**
55: * Construct a <tt>DeploymentException</tt> with the specified detail
56: * message.
57: *
58: * @param msg Detail message.
59: */
60: public DeploymentException(String msg) {
61: super (msg);
62: }
63:
64: /**
65: * Construct a <tt>DeploymentException</tt> with the specified detail
66: * message and nested <tt>Throwable</tt>.
67: *
68: * @param msg Detail message.
69: * @param nested Nested <tt>Throwable</tt>.
70: */
71: public DeploymentException(String msg, Throwable nested) {
72: super (msg, nested);
73: }
74:
75: /**
76: * Construct a <tt>DeploymentException</tt> with the specified
77: * nested <tt>Throwable</tt>.
78: *
79: * @param nested Nested <tt>Throwable</tt>.
80: */
81: public DeploymentException(Throwable nested) {
82: super (nested);
83: }
84:
85: /**
86: * Construct a <tt>DeploymentException</tt> with no detail.
87: */
88: public DeploymentException() {
89: super();
90: }
91: }
|