commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ozeigerm...@apache.org
Subject svn commit: r560622 - /jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceException.java
Date Sat, 28 Jul 2007 21:35:51 GMT
Author: ozeigermann
Date: Sat Jul 28 14:35:51 2007
New Revision: 560622

URL: http://svn.apache.org/viewvc?view=rev&rev=560622
Log:
Added code concept

Modified:
    jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceException.java

Modified: jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceException.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceException.java?view=diff&rev=560622&r1=560621&r2=560622
==============================================================================
--- jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceException.java
(original)
+++ jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceException.java
Sat Jul 28 14:35:51 2007
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.transaction.resource;
 
+
 public class ResourceException extends Exception {
 
     /**
@@ -23,6 +24,12 @@
      */
     private static final long serialVersionUID = 7650329971392401844L;
 
+    public enum Code {
+        COULD_NOT_CREATE, COULD_NOT_DELETE, CANT_MOVE_OR_COPY
+    }
+
+    protected Code code;
+
     public ResourceException(String message, Throwable cause) {
         super(message, cause);
     }
@@ -30,8 +37,23 @@
     public ResourceException(Throwable cause) {
         super(cause);
     }
+
     public ResourceException(String message) {
         super(message);
+    }
+
+    public ResourceException(Code code, String message) {
+        super(message);
+        this.code = code;
+    }
+
+    /**
+     * Returns the formal reason for the exception.
+     * 
+     * @return the reason code
+     */
+    public Code getCode() {
+        return code;
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message