From 5468794fed6c16015f40499439b68cd245cfb822 Mon Sep 17 00:00:00 2001 From: mdb Date: Wed, 20 Dec 2006 23:28:01 +0000 Subject: [PATCH] Allow RepositoryUnit and RepositoryListenerUnit to throw any exception. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2003 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../jdbc/RepositoryListenerUnit.java | 16 +++++++--------- .../com/samskivert/jdbc/RepositoryUnit.java | 18 ++++++++---------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/java/com/samskivert/jdbc/RepositoryListenerUnit.java b/src/java/com/samskivert/jdbc/RepositoryListenerUnit.java index ce6ae4b4..ac31bfa1 100644 --- a/src/java/com/samskivert/jdbc/RepositoryListenerUnit.java +++ b/src/java/com/samskivert/jdbc/RepositoryListenerUnit.java @@ -22,14 +22,13 @@ import com.samskivert.io.PersistenceException; import com.samskivert.util.ResultListener; /** - * Extends the {@link RepositoryUnit} and integrates with a {@link - * ResultListener}. + * Extends the {@link RepositoryUnit} and integrates with a {@link ResultListener}. */ public abstract class RepositoryListenerUnit extends RepositoryUnit { /** - * Creates a repository listener unit that will report its results to the - * supplied result listener. + * Creates a repository listener unit that will report its results to the supplied result + * listener. */ public RepositoryListenerUnit (ResultListener listener) { @@ -37,9 +36,8 @@ public abstract class RepositoryListenerUnit extends RepositoryUnit } /** - * Creates a repository listener unit that will report its results to the - * supplied result listener and report the supplied name in - * {@link #toString}. + * Creates a repository listener unit that will report its results to the supplied result + * listener and report the supplied name in {@link #toString}. */ public RepositoryListenerUnit (String name, ResultListener listener) { @@ -51,11 +49,11 @@ public abstract class RepositoryListenerUnit extends RepositoryUnit * Called to perform our persistent action and generate our result. */ public abstract T invokePersistResult () - throws PersistenceException; + throws Exception; @Override // from RepositoryUnit public void invokePersist () - throws PersistenceException + throws Exception { _result = invokePersistResult(); } diff --git a/src/java/com/samskivert/jdbc/RepositoryUnit.java b/src/java/com/samskivert/jdbc/RepositoryUnit.java index 9b7a9d0f..ec828d0c 100644 --- a/src/java/com/samskivert/jdbc/RepositoryUnit.java +++ b/src/java/com/samskivert/jdbc/RepositoryUnit.java @@ -22,8 +22,8 @@ import com.samskivert.io.PersistenceException; import com.samskivert.util.Invoker; /** - * Extends the {@link com.samskivert.util.Invoker.Unit} and specializes it for - * doing database repository manipulation. + * Extends the {@link com.samskivert.util.Invoker.Unit} and specializes it for doing database + * repository manipulation. */ public abstract class RepositoryUnit extends Invoker.Unit { @@ -33,8 +33,7 @@ public abstract class RepositoryUnit extends Invoker.Unit } /** - * Create a RepositoryUnit which will report the supplied name - * in {@link #toString}. + * Create a RepositoryUnit which will report the supplied name in {@link #toString}. */ public RepositoryUnit (String name) { @@ -66,18 +65,17 @@ public abstract class RepositoryUnit extends Invoker.Unit * Called to perform our persistent actions. */ public abstract void invokePersist () - throws PersistenceException; + throws Exception; /** - * Called if our persistent actions have succeeded, back on the non-invoker - * thread. + * Called if our persistent actions have succeeded, back on the non-invoker thread. */ public abstract void handleSuccess (); /** - * Called if our persistent actions failed, back on the non-invoker thread. - * Note that this may be either a {@link PersistenceException} thrown by - * {@link #invokePersist} or a {@link RuntimeException} thrown by same. + * Called if our persistent actions failed, back on the non-invoker thread. Note that this may + * be either an {@link Exception} thrown by {@link #invokePersist} or a {@link + * RuntimeException} thrown by same. */ public abstract void handleFailure (Exception pe);