001: /**
002: * $Id: PortletMembershipException.java,v 1.3 2005/06/03 19:31:58 mjain Exp $
003: * Copyright 2005 Sun Microsystems, Inc. All
004: * rights reserved. Use of this product is subject
005: * to license terms. Federal Acquisitions:
006: * Commercial Software -- Government Users
007: * Subject to Standard License Terms and
008: * Conditions.
009: *
010: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011: * are trademarks or registered trademarks of Sun Microsystems,
012: * Inc. in the United States and other countries.
013: */package com.sun.portal.portlet.service.provision;
014:
015: import java.lang.Exception;
016:
017: import java.io.PrintWriter;
018: import java.io.BufferedReader;
019: import java.io.PrintStream;
020: import java.io.PrintWriter;
021:
022: /**
023: * A ProviderPortletMembershipException is thrown when there is an unrecoverable error
024: * in implementation.
025: **/
026: public class PortletMembershipException extends Exception {
027:
028: protected Throwable wrapped = null;
029:
030: /**
031: * Constructs a new exception with the specified message, indicating an
032: * error in the provider as happened.<br><br>
033: *
034: * @param msg The descriptive message.
035: */
036: public PortletMembershipException(String msg) {
037: super (msg);
038: }
039:
040: /**
041: * Constructs a new exception with the specified message, and the original
042: * <code>exception</code> or <code>error</code>, indicating an error in the
043: * WSRP as happened.<br><br>
044: *
045: * @param msg The descriptive message.
046: * @param e The original <code>exception</code> or <code>error</code>.
047: */
048: public PortletMembershipException(String msg, Throwable t) {
049: super (msg);
050: wrapped = t;
051: }
052:
053: /**
054: *
055: * @param t
056: */
057: public PortletMembershipException(Throwable t) {
058: super ();
059: wrapped = t;
060: }
061:
062: /**
063: *
064: * @return
065: */
066: public Throwable getWrapped() {
067: return wrapped;
068: }
069:
070: /**
071: *
072: * @return
073: */
074: public String toString() {
075: StringBuffer b = new StringBuffer();
076:
077: b.append(super .toString());
078: if (getWrapped() != null) {
079: b.append(wrapped.toString());
080: }
081:
082: return b.toString();
083: }
084:
085: public void printStackTrace() {
086: super .printStackTrace();
087: if (getWrapped() != null) {
088: wrapped.printStackTrace();
089: }
090: }
091:
092: /**
093: *
094: * @param s
095: */
096: public void printStackTrace(PrintStream s) {
097: super .printStackTrace(s);
098: if (getWrapped() != null) {
099: wrapped.printStackTrace(s);
100: }
101: }
102:
103: /**
104: *
105: * @param s
106: */
107: public void printStackTrace(PrintWriter s) {
108: super.printStackTrace(s);
109: if (getWrapped() != null) {
110: wrapped.printStackTrace(s);
111: }
112: }
113: }
|