craigmcc 2002/12/27 16:51:46
Modified: resources/src/java/org/apache/commons/resources
ResourcesException.java ResourcesFactory.java
Log:
Update ResourcesException to have a constructor with just a Throwable.
Update ResourcesFactory to allow release() to throw an exception.
Revision Changes Path
1.2 +13 -12
jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/ResourcesException.java
Index: ResourcesException.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/ResourcesException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ResourcesException.java 24 Oct 2001 19:35:55 -0000 1.1
+++ ResourcesException.java 28 Dec 2002 00:51:45 -0000 1.2
@@ -75,13 +75,18 @@
protected String message = "";
- protected Exception rootCause = null;
+ protected Throwable rootCause = null;
public ResourcesException(String message) {
this(message, null);
}
- public ResourcesException(String message, Exception rootCause) {
+ public ResourcesException(Throwable rootCause) {
+ this.message = rootCause.getMessage();
+ this.rootCause = rootCause;
+ }
+
+ public ResourcesException(String message, Throwable rootCause) {
this.message = message;
this.rootCause = rootCause;
}
@@ -90,11 +95,7 @@
return message;
}
- public void setMessage(String message) {
- this.message = message;
- }
-
- public Exception getRootCause() {
+ public Throwable getRootCause() {
return rootCause;
}
-}
\ No newline at end of file
+}
1.4 +9 -6
jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/ResourcesFactory.java
Index: ResourcesFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/resources/src/java/org/apache/commons/resources/ResourcesFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ResourcesFactory.java 28 Dec 2002 00:04:07 -0000 1.3
+++ ResourcesFactory.java 28 Dec 2002 00:51:45 -0000 1.4
@@ -123,9 +123,12 @@
/**
* <p>Release any internal references to {@link Resources} instances
- * that have been returned previously.</p>
+ * that have been returned previously, after calling the
+ * <code>destroy()</code> method of each such instance.</p>
+ *
+ * @exception ResourcesException if an error occurs while releasing
*/
- public void release();
+ public void release() throws ResourcesException;
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>