From 8c769bae2d6d71677ce71a299d618957029ab4ac Mon Sep 17 00:00:00 2001
From: "(no author)" <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d>
Date: Mon, 10 Apr 2006 08:46:26 +0000
Subject: This commit was manufactured by cvs2svn to create tag
'Build_ID-1_3_1'.
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/tags/Build_ID-1_3_1@704 d688527b-c9ab-4aba-bd8d-4036d912da1d
---
.../egovernment/moa/spss/MOARuntimeException.java | 163 ---------------------
1 file changed, 163 deletions(-)
delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/MOARuntimeException.java
(limited to 'spss.server/src/at/gv/egovernment/moa/spss/MOARuntimeException.java')
diff --git a/spss.server/src/at/gv/egovernment/moa/spss/MOARuntimeException.java b/spss.server/src/at/gv/egovernment/moa/spss/MOARuntimeException.java
deleted file mode 100644
index 0ff175b50..000000000
--- a/spss.server/src/at/gv/egovernment/moa/spss/MOARuntimeException.java
+++ /dev/null
@@ -1,163 +0,0 @@
-package at.gv.egovernment.moa.spss;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import at.gv.egovernment.moa.spss.util.MessageProvider;
-import at.gv.egovernment.moa.util.Constants;
-
-/**
- * Base class of MOA specific runtime exceptions.
- *
- * This class has the ability to wrap other exceptions which may be seen
- * as the root cause for this exception. A similar mechanism is in place
- * since JDK1.4 (see the getClause()
method) but will not be used
- * because of required compatibility with JDK1.3.
- *
- * @author Patrick Peck
- * @version $Id$
- */
-public class MOARuntimeException extends RuntimeException {
- /** The message ID. */
- private String messageId;
- /** The wrapped Throwable
. */
- private Throwable wrapped;
-
- /**
- * Create a MOAException
.
- *
- * @param messageId The message ID of the message contained in the created
- * MOAException
.
- * @param parameters The parameters needed to fill in the message arguments.
- */
- public MOARuntimeException(String messageId, Object[] parameters) {
- super(MessageProvider.getInstance().getMessage(messageId, parameters));
- this.messageId = messageId;
- }
-
- /**
- * Create a MOAException
.
- *
- * @param messageId The message ID of the message contained in the created
- * MOAException
.
- * @param parameters The parameters needed to fill in the message arguments.
- * @param wrapped The exception wrapped by the created
- * MOAException
.
- */
- public MOARuntimeException(
- String messageId,
- Object[] parameters,
- Throwable wrapped) {
-
- super(MessageProvider.getInstance().getMessage(messageId, parameters));
- this.messageId = messageId;
- this.wrapped = wrapped;
- }
-
- /**
- * Returns the message ID of this exception.
- *
- * @return The message ID as provided in the constructor.
- */
- public String getMessageId() {
- return messageId;
- }
-
- /**
- * Returns the exception wrapped by this MOARuntimeException
.
- *
- * @return The exception wrapped by this exception. Possibly
- * null
, if none was provided at construction time.
- */
- public Throwable getWrapped() {
- return wrapped;
- }
-
- /**
- * Convert this MOARuntimeException
to an ErrorResponse
- * element from the MOA namespace.
- *
- * @return An ErrorResponse
element, containing the subelements
- * ErrorCode
and Info
required by the MOA schema.
- */
- public Element toErrorResponse() {
- DocumentBuilder builder;
- DOMImplementation impl;
- Document doc;
- Element errorResponse;
- Element errorCode;
- Element info;
-
- // create a new document
- try {
- builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- impl = builder.getDOMImplementation();
- } catch (ParserConfigurationException e) {
- return null;
- }
-
- // build the ErrorResponse element
- doc = impl.createDocument(Constants.MOA_NS_URI, "ErrorResponse", null);
- errorResponse = doc.getDocumentElement();
-
- // add MOA namespace declaration
- errorResponse.setAttributeNS(
- Constants.XMLNS_NS_URI,
- "xmlns",
- Constants.MOA_NS_URI);
-
- // build the child elements
- errorCode = doc.createElementNS(Constants.MOA_NS_URI, "ErrorCode");
- errorCode.appendChild(doc.createTextNode(messageId));
- info = doc.createElementNS(Constants.MOA_NS_URI, "Info");
- info.appendChild(doc.createTextNode(getMessage()));
- errorResponse.appendChild(errorCode);
- errorResponse.appendChild(info);
- return errorResponse;
- }
-
- /**
- * Print a stack trace of this exception to System.err
.
- *
- * @see java.lang.Throwable#printStackTrace()
- */
- public void printStackTrace() {
- printStackTrace(System.err);
- }
-
- /**
- * Print a stack trace of this exception, including the wrapped exception.
- *
- * @param s The stream to write the stack trace to.
- * @see java.lang.Throwable#printStackTrace(java.io.PrintStream)
- */
- public void printStackTrace(PrintStream s) {
- super.printStackTrace(s);
- if (getWrapped() != null) {
- s.print("Caused by: ");
- getWrapped().printStackTrace(s);
- }
- }
-
- /**
- * Print a stack trace of this exception, including the wrapped exception.
- *
- * @param s The stream to write the stacktrace to.
- * @see java.lang.Throwable#printStackTrace(java.io.PrintWriter)
- */
- public void printStackTrace(PrintWriter s) {
- super.printStackTrace(s);
- if (getWrapped() != null) {
- s.print("Caused by: ");
- getWrapped().printStackTrace(s);
- }
- }
-
-}
--
cgit v1.2.3