001: /**
002: * $Id: DesktopDataException.java,v 1.3 2005/04/21 19:39:57 cathywu Exp $
003: * Copyright 2004 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.desktop.admin.mbeans.tasks;
014:
015: public class DesktopDataException extends Exception {
016:
017: private Object[] tokens = null;
018:
019: /**
020: * Constructs a new desktopdata exception with <code>null</code>
021: * as its detail message. The cause is not initialized, and may
022: * subsequently be initialized by a call to {@link #initCause}.
023: */
024: public DesktopDataException() {
025: super ();
026: }
027:
028: /**
029: * Constructs a new desktopdata exception with the specified
030: * detail message. The cause is not initialized, and may
031: * subsequently be initialized by a call to {@link #initCause}.
032: *
033: * @param message the detail message. The detail message is
034: * saved for later retrieval by the {@link
035: * #getMessage()} method.
036: */
037: public DesktopDataException(String message) {
038: super (message);
039: }
040:
041: /**
042: * Constructs a new desktopdata exception with the specified
043: * detail message and object array of tokens.
044: *
045: * @param message the detail message. The detail message is
046: * saved for later retrieval by the {@link
047: * #getMessage()} method.
048: * @param tokens the tokens to be inserted in the localized
049: * message (which is saved for later
050: * retrieval by the {@link #getTokens()} method).
051: */
052: public DesktopDataException(String message, Object[] tokens) {
053: super (message);
054: this .tokens = tokens;
055: }
056:
057: /**
058: * Constructs a new desktopdata exception with the specified
059: * detail message and cause. <p>Note that the detail message
060: * associated with <code>cause</code> is <i>not</i> automatically
061: * incorporated in this exception's detail message.
062: *
063: * @param message the detail message (which is saved for later
064: * retrieval by the {@link #getMessage()} method).
065: * @param cause the cause (which is saved for later retrieval by
066: * the {@link #getCause()} method). (A
067: * <tt>null</tt> value is permitted, and indicates
068: * that the cause is nonexistent or unknown.)
069: */
070: public DesktopDataException(String message, Throwable cause) {
071: super (message, cause);
072: }
073:
074: /**
075: * Constructs a new desktopdata exception with the specified
076: * detail message, cause, and object array of tokens.
077: *
078: * @param message the detail message. The detail message is
079: * saved for later retrieval by the {@link
080: * #getMessage()} method.
081: * @param cause the cause (which is saved for later retrieval by
082: * the {@link #getCause()} method). (A
083: * <tt>null</tt> value is permitted, and indicates
084: * that the cause is nonexistent or unknown.)
085: * @param tokens the tokens to be inserted in the localized
086: * message (which is saved for later
087: * retrieval by the {@link #getTokens()} method).
088: */
089: public DesktopDataException(String message, Throwable cause,
090: Object[] tokens) {
091: super (message, cause);
092: this .tokens = tokens;
093: }
094:
095: /**
096: * Constructs a new desktopdata exception with the specified
097: * cause and a detail message of <tt>((cause == null) ? null :
098: * cause.toString())</tt> (which typically contains the class and
099: * detail message of <tt>cause</tt>).
100: *
101: * @param cause the cause (which is saved for later retrieval by
102: * the {@link #getCause()} method). (A
103: * <tt>null</tt> value is permitted, and indicates
104: * that the cause is nonexistent or unknown.)
105: */
106: public DesktopDataException(Throwable cause) {
107: super (cause);
108: }
109:
110: /**
111: * Returns the object array of tokens which can be later used to insert in
112: * localzed messages
113: *
114: * @return the tokens as an object array.
115: */
116: public Object[] getTokens() {
117: return tokens;
118: }
119: }
|