KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > mx > util > JBossNotCompliantMBeanException


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, 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.mx.util;
23
24
25
26 import javax.management.NotCompliantMBeanException JavaDoc;
27 import java.io.PrintStream JavaDoc;
28 import java.io.PrintWriter JavaDoc;
29 //import org.jboss.util.NestedThrowable;
30

31
32
33 /**
34  * JBossNotCompliantMBeanException.java
35  *
36  *
37  * Created: Tues Feb 18 22:45:03 2003
38  *
39  * @author <a HREF="mailto:d_jencks@users.sourceforge.net">David Jencks</a>
40  * @version $Revision: 37459 $
41  */

42
43 public class JBossNotCompliantMBeanException
44    extends NotCompliantMBeanException JavaDoc
45            //implements NestedThrowable
46
{
47
48    private final Throwable JavaDoc t;
49
50    public JBossNotCompliantMBeanException()
51    {
52       super();
53       t = null;
54    }
55
56    public JBossNotCompliantMBeanException(String JavaDoc message)
57    {
58       super(message);
59       t = null;
60    }
61
62    public JBossNotCompliantMBeanException(Throwable JavaDoc t)
63    {
64       super();
65       this.t = t;
66    }
67
68    public JBossNotCompliantMBeanException(String JavaDoc message, Throwable JavaDoc t)
69    {
70       super(message);
71       this.t = t;
72    }
73
74    // Implementation of org.jboss.util.NestedThrowable
75

76    public Throwable JavaDoc getNested()
77    {
78       return t;
79    }
80
81    public Throwable JavaDoc getCause()
82    {
83       return t;
84    }
85
86    /**
87     * Returns the composite throwable message.
88     *
89     * @return The composite throwable message.
90     */

91    public String JavaDoc getMessage()
92    {
93       //return NestedThrowable.Util.getMessage(super.getMessage(), t);
94
return super.getMessage();
95    }
96
97    /**
98     * Prints the composite message and the embedded stack trace to the
99     * specified print stream.
100     *
101     * @param stream Stream to print to.
102     */

103    public void printStackTrace(final PrintStream JavaDoc stream)
104    {
105       //if (t == null || NestedThrowable.PARENT_TRACE_ENABLED)
106
{
107          super.printStackTrace(stream);
108       }
109       //NestedThrowable.Util.print(t, stream);
110
}
111
112    /**
113     * Prints the composite message and the embedded stack trace to the
114     * specified print writer.
115     *
116     * @param writer Writer to print to.
117     */

118    public void printStackTrace(final PrintWriter JavaDoc writer)
119    {
120       //if (t == null || NestedThrowable.PARENT_TRACE_ENABLED)
121
{
122          super.printStackTrace(writer);
123       }
124       //NestedThrowable.Util.print(t, writer);
125
}
126
127    /**
128     * Prints the composite message and the embedded stack trace to
129     * <tt>System.err</tt>.
130     */

131    public void printStackTrace()
132    {
133       printStackTrace(System.err);
134    }
135
136 }// JBossNotCompliantMBeanException
137

138
Popular Tags