001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.cocoon.components.notification;
018:
019: import org.apache.avalon.framework.CascadingRuntimeException;
020:
021: import java.util.Map;
022:
023: /**
024: * A CascadingRuntimeException that is also Notifying.
025: *
026: * @author <a href="mailto:barozzi@nicolaken.com">Nicola Ken Barozzi</a>
027: * @version CVS $Id: NotifyingCascadingRuntimeException.java 433543 2006-08-22 06:22:54Z crossley $
028: */
029: public class NotifyingCascadingRuntimeException extends
030: CascadingRuntimeException implements Notifying {
031:
032: /**
033: * The Notifying Object used internally to keep Notifying fields
034: */
035: Notifying n;
036:
037: /**
038: * Construct a new <code>NotifyingCascadingRuntimeException</code> instance.
039: */
040: public NotifyingCascadingRuntimeException(String message) {
041: super (message, null);
042: n = new DefaultNotifyingBuilder().build(this , message);
043: }
044:
045: /**
046: * Creates a new <code>ProcessingException</code> instance.
047: *
048: * @param ex an <code>Exception</code> value
049: */
050: public NotifyingCascadingRuntimeException(Exception ex) {
051: super (ex.getMessage(), ex);
052: n = new DefaultNotifyingBuilder().build(this , ex);
053: }
054:
055: /**
056: * Construct a new <code>ProcessingException</code> that references
057: * a parent Exception.
058: */
059: public NotifyingCascadingRuntimeException(String message,
060: Throwable t) {
061: super (message, t);
062: n = new DefaultNotifyingBuilder().build(this , t);
063: }
064:
065: /**
066: * Gets the Type attribute of the Notifying object
067: */
068: public String getType() {
069: return n.getType();
070: }
071:
072: /**
073: * Gets the Title attribute of the Notifying object
074: */
075: public String getTitle() {
076: return n.getTitle();
077: }
078:
079: /**
080: * Gets the Source attribute of the Notifying object
081: */
082: public String getSource() {
083: return n.getSource();
084: }
085:
086: /**
087: * Gets the Sender attribute of the Notifying object
088: */
089: public String getSender() {
090: return n.getSender();
091: }
092:
093: /**
094: * Gets the Message attribute of the Notifying object
095: */
096: public String getMessage() {
097: return n.getMessage();
098: }
099:
100: /**
101: * Gets the Description attribute of the Notifying object
102: */
103: public String getDescription() {
104: return n.getDescription();
105: }
106:
107: /**
108: * Gets the ExtraDescriptions attribute of the Notifying object
109: */
110: public Map getExtraDescriptions() {
111: return n.getExtraDescriptions();
112: }
113:
114: }
|