tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r562626 - in /incubator/tuscany/java/sca/modules/core: ./ src/main/java/org/apache/tuscany/sca/core/work/
Date Sat, 04 Aug 2007 00:15:59 GMT
Author: jsdelfino
Date: Fri Aug  3 17:15:58 2007
New Revision: 562626

URL: http://svn.apache.org/viewvc?view=rev&rev=562626
Log:
Changed to use the geronimo commonj-work API which is almost identical to the one we had in
Tuscany.

Modified:
    incubator/tuscany/java/sca/modules/core/pom.xml
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManager.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java

Modified: incubator/tuscany/java/sca/modules/core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/pom.xml?view=diff&rev=562626&r1=562625&r2=562626
==============================================================================
--- incubator/tuscany/java/sca/modules/core/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/core/pom.xml Fri Aug  3 17:15:58 2007
@@ -54,9 +54,9 @@
         </dependency>
         
         <dependency>
-            <groupId>org.apache.tuscany</groupId>
-            <artifactId>commonj-api</artifactId>
-            <version>1.0-incubating-SNAPSHOT</version>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-commonj_1.1_spec</artifactId>
+            <version>1.0</version>
         </dependency>
         
         <dependency>

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java?view=diff&rev=562626&r1=562625&r2=562626
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java
(original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java
Fri Aug  3 17:15:58 2007
@@ -23,10 +23,8 @@
 import org.apache.tuscany.sca.work.WorkSchedulerException;
 
 import commonj.work.WorkEvent;
-import commonj.work.WorkException;
 import commonj.work.WorkListener;
 import commonj.work.WorkManager;
-import commonj.work.WorkRejectedException;
 
 /**
  * A work scheduler implementation based on a JSR 237 work manager.
@@ -87,13 +85,13 @@
                 Jsr237WorkListener<T> jsr237WorkListener = new Jsr237WorkListener<T>(listener,
work);
                 jsr237WorkManager.schedule(jsr237Work, jsr237WorkListener);
             }
-        } catch (WorkRejectedException ex) {
+        } catch (IllegalArgumentException ex) {
             if (listener != null) {
                 listener.workRejected(work);
             } else {
                 throw new WorkSchedulerException(ex);
             }
-        } catch (WorkException ex) {
+        } catch (Exception ex) {
             throw new WorkSchedulerException(ex);
         }
 

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManager.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManager.java?view=diff&rev=562626&r1=562625&r2=562626
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManager.java
(original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManager.java
Fri Aug  3 17:15:58 2007
@@ -35,7 +35,6 @@
 import commonj.work.WorkItem;
 import commonj.work.WorkListener;
 import commonj.work.WorkManager;
-import commonj.work.WorkRejectedException;
 
 /**
  * A thread-pool based implementation for the JSR-237 work manager.
@@ -68,7 +67,7 @@
      * @param work Work that needs to be scheduled.
      * @return Work Work item representing the asynchronous work
      */
-    public WorkItem schedule(Work work) throws WorkException {
+    public WorkItem schedule(Work work) throws IllegalArgumentException {
         return schedule(work, null);
     }
 
@@ -79,7 +78,7 @@
      * @param workListener Work listener for callbacks.
      * @return Work Work item representing the asynchronous work
      */
-    public WorkItem schedule(Work work, WorkListener workListener) throws WorkRejectedException
{
+    public WorkItem schedule(Work work, WorkListener workListener) throws IllegalArgumentException
{
 
         WorkItemImpl workItem = new WorkItemImpl(new UID().toString(), work);
         if (workListener != null) {
@@ -93,7 +92,7 @@
             if (workListener != null) {
                 workListener.workRejected(new WorkEventImpl(workItem));
             }
-            throw new WorkRejectedException("Unable to schedule work");
+            throw new IllegalArgumentException("Unable to schedule work");
         }
     }
 

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java?view=diff&rev=562626&r1=562625&r2=562626
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java
(original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java
Fri Aug  3 17:15:58 2007
@@ -78,7 +78,7 @@
      * @return Work.
      * @throws WorkException If the work completed with an exception.
      */
-    public Work getResult() throws WorkException {
+    public Work getResult() {
         return result;
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message