tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r720913 - in /tuscany/java/sca/modules/core: ./ META-INF/ src/main/java/org/apache/tuscany/sca/core/work/ src/main/resources/META-INF/services/ src/test/java/org/apache/tuscany/sca/core/work/
Date Wed, 26 Nov 2008 16:38:19 GMT
Author: antelder
Date: Wed Nov 26 08:38:18 2008
New Revision: 720913

URL: http://svn.apache.org/viewvc?rev=720913&view=rev
Log:
Remove core dependency on commonj workmanager

Added:
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/DefaultWorkScheduler.java
  (contents, props changed)
      - copied, changed from r720147, tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Work.java
  (contents, props changed)
      - copied, changed from r720147, tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237Work.java
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEvent.java
  (contents, props changed)
      - copied, changed from r720147, tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEventImpl.java
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItem.java
  (contents, props changed)
      - copied, changed from r720147, tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkListener.java
Removed:
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237Work.java
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEventImpl.java
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java
Modified:
    tuscany/java/sca/modules/core/META-INF/MANIFEST.MF
    tuscany/java/sca/modules/core/pom.xml
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManager.java
    tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.work.WorkScheduler
    tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/FailingWork.java
    tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/Jsr237WorkSchedulerTestCase.java
    tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/TestWorkListener.java
    tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/TimeDelayWork.java

Modified: tuscany/java/sca/modules/core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/META-INF/MANIFEST.MF?rev=720913&r1=720912&r2=720913&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/META-INF/MANIFEST.MF (original)
+++ tuscany/java/sca/modules/core/META-INF/MANIFEST.MF Wed Nov 26 08:38:18 2008
@@ -11,7 +11,7 @@
  cany.sca.interfacedef,org.apache.tuscany.sca.invocation,org.apache.tu
  scany.sca.work,org.apache.tuscany.sca.contribution.processor";version
  ="1.4",org.apache.tuscany.sca.core.work;uses:="javax.naming,org.osoa.
- sca.annotations,commonj.work,org.apache.tuscany.sca.work";version="1.
+ sca.annotations,org.apache.tuscany.sca.work";version="1.
  4",org.apache.tuscany.sca.core.context;uses:="org.apache.tuscany.sca.
  runtime,org.apache.tuscany.sca.assembly,org.apache.tuscany.sca.contex
  t,javax.security.auth,org.apache.tuscany.sca.monitor,org.apache.tusca
@@ -47,8 +47,7 @@
 Bundle-ManifestVersion: 2
 Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
 Bundle-Description: Apache Tuscany SCA Core Runtime
-Import-Package: commonj.work,
- javax.naming,
+Import-Package: javax.naming,
  javax.security.auth,
  javax.xml.namespace,
  javax.xml.stream,

Modified: tuscany/java/sca/modules/core/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/pom.xml?rev=720913&r1=720912&r2=720913&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/pom.xml (original)
+++ tuscany/java/sca/modules/core/pom.xml Wed Nov 26 08:38:18 2008
@@ -60,12 +60,6 @@
         </dependency>
         
         <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-commonj_1.1_spec</artifactId>
-            <version>1.0</version>
-        </dependency>
-
-        <dependency>
             <groupId>org.codehaus.woodstox</groupId>
             <artifactId>wstx-asl</artifactId>
             <version>3.2.4</version>

Copied: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/DefaultWorkScheduler.java
(from r720147, tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/DefaultWorkScheduler.java?p2=tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/DefaultWorkScheduler.java&p1=tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java&r1=720147&r2=720913&rev=720913&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java
(original)
+++ tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/DefaultWorkScheduler.java
Wed Nov 26 08:38:18 2008
@@ -21,17 +21,10 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
 import org.apache.tuscany.sca.work.NotificationListener;
 import org.apache.tuscany.sca.work.WorkScheduler;
 import org.apache.tuscany.sca.work.WorkSchedulerException;
 
-import commonj.work.WorkEvent;
-import commonj.work.WorkListener;
-import commonj.work.WorkManager;
-
 /**
  * A work scheduler implementation based on a JSR 237 work manager.
  * <p/>
@@ -43,31 +36,31 @@
  *
  * @version $Rev$ $Date$
  */
-public class Jsr237WorkScheduler implements WorkScheduler {
+public class DefaultWorkScheduler implements WorkScheduler {
 
     /**
      * Underlying JSR-237 work manager
      */
-    private WorkManager jsr237WorkManager;
+    private ThreadPoolWorkManager jsr237WorkManager;
 
     /**
      * Initializes the JSR 237 work manager.
      *
      * @param jsr237WorkManager JSR 237 work manager.
      */
-    public Jsr237WorkScheduler() {
+    public DefaultWorkScheduler() {
     }
 
-    private synchronized WorkManager getWorkManager() {
+    private synchronized ThreadPoolWorkManager getWorkManager() {
         if (jsr237WorkManager != null) {
             return jsr237WorkManager;
         }
-        try {
-            InitialContext ctx = new InitialContext();
-            jsr237WorkManager = (WorkManager)ctx.lookup("java:comp/env/wm/TuscanyWorkManager");
-        } catch (Throwable e) {
-            // ignore
-        }
+//        try {
+//            InitialContext ctx = new InitialContext();
+//            jsr237WorkManager = (ThreadPoolWorkManager)ctx.lookup("java:comp/env/wm/TuscanyWorkManager");
+//        } catch (Throwable e) {
+//            // ignore
+//        }
         if (jsr237WorkManager == null) {
             jsr237WorkManager = new ThreadPoolWorkManager(10);
         }
@@ -97,7 +90,7 @@
             throw new IllegalArgumentException("Work cannot be null");
         }
 
-        Jsr237Work<T> jsr237Work = new Jsr237Work<T>(work);
+        Work<T> jsr237Work = new Work<T>(work);
         try {
             if (listener == null) {
                 getWorkManager().schedule(jsr237Work);

Propchange: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/DefaultWorkScheduler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/DefaultWorkScheduler.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Nov 26 08:38:18 2008
@@ -0,0 +1,3 @@
+/tuscany/branches/sca-java-1.3/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java:671193
+/tuscany/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java:713805-714043
+/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java:694816-713804

Modified: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManager.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManager.java?rev=720913&r1=720912&r2=720913&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManager.java
(original)
+++ tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManager.java
Wed Nov 26 08:38:18 2008
@@ -27,15 +27,9 @@
 import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.ThreadFactory;
 
+import org.apache.tuscany.sca.work.WorkSchedulerException;
 import org.osoa.sca.annotations.Destroy;
 
-import commonj.work.Work;
-import commonj.work.WorkEvent;
-import commonj.work.WorkException;
-import commonj.work.WorkItem;
-import commonj.work.WorkListener;
-import commonj.work.WorkManager;
-
 /**
  * A thread-pool based implementation for the JSR-237 work manager.
  * <p/>
@@ -46,10 +40,10 @@
  *
  * @version $Rev$ $Date$
  */
-public class ThreadPoolWorkManager implements WorkManager {
+public class ThreadPoolWorkManager {
 
     // Map of work items currently handled by the work manager
-    private Map<WorkItemImpl, WorkListener> workItems = new ConcurrentHashMap<WorkItemImpl,
WorkListener>();
+    private Map<WorkItem, WorkListener> workItems = new ConcurrentHashMap<WorkItem,
WorkListener>();
 
     // Thread-pool
     private ExecutorService executor;
@@ -96,7 +90,7 @@
      */
     public WorkItem schedule(Work work, WorkListener workListener) throws IllegalArgumentException
{
 
-        WorkItemImpl workItem = new WorkItemImpl(new UID().toString(), work);
+        WorkItem workItem = new WorkItem(new UID().toString(), work);
         if (workListener != null) {
             workItems.put(workItem, workListener);
         }
@@ -106,7 +100,7 @@
         } else {
             workItem.setStatus(WorkEvent.WORK_REJECTED);
             if (workListener != null) {
-                workListener.workRejected(new WorkEventImpl(workItem));
+                workListener.workRejected(new WorkEvent(workItem));
             }
             throw new IllegalArgumentException("Unable to schedule work");
         }
@@ -138,11 +132,11 @@
      * @param workItem Work item representing the work that was accepted.
      * @param work     Work that was accepted.
      */
-    private void workAccepted(final WorkItemImpl workItem, final Work work) {
+    private void workAccepted(final WorkItem workItem, final Work work) {
         WorkListener listener = workItems.get(workItem);
         if (listener != null) {
             workItem.setStatus(WorkEvent.WORK_ACCEPTED);
-            WorkEvent event = new WorkEventImpl(workItem);
+            WorkEvent event = new WorkEvent(workItem);
             listener.workAccepted(event);
         }
     }
@@ -150,11 +144,11 @@
     /*
      * Method to indicate a work start.
      */
-    private void workStarted(final WorkItemImpl workItem, final Work work) {
+    private void workStarted(final WorkItem workItem, final Work work) {
         WorkListener listener = workItems.get(workItem);
         if (listener != null) {
             workItem.setStatus(WorkEvent.WORK_STARTED);
-            WorkEvent event = new WorkEventImpl(workItem);
+            WorkEvent event = new WorkEvent(workItem);
             listener.workStarted(event);
         }
     }
@@ -162,20 +156,20 @@
     /*
      * Method to indicate a work completion.
      */
-    private void workCompleted(final WorkItemImpl workItem, final Work work) {
+    private void workCompleted(final WorkItem workItem, final Work work) {
         workCompleted(workItem, work, null);
     }
 
     /*
      * Method to indicate a work completion.
      */
-    private void workCompleted(final WorkItemImpl workItem, final Work work, final WorkException
exception) {
+    private void workCompleted(final WorkItem workItem, final Work work, final WorkSchedulerException
exception) {
         WorkListener listener = workItems.get(workItem);
         if (listener != null) {
             workItem.setStatus(WorkEvent.WORK_COMPLETED);
             workItem.setResult(work);
             workItem.setException(exception);
-            WorkEvent event = new WorkEventImpl(workItem);
+            WorkEvent event = new WorkEvent(workItem);
             listener.workCompleted(event);
             workItems.remove(workItem);
         }
@@ -184,7 +178,7 @@
     /*
      * Schedules the work using the ThreadPool.
      */
-    private boolean scheduleWork(final Work work, final WorkItemImpl workItem) {
+    private boolean scheduleWork(final Work work, final WorkItem workItem) {
         try {
             executor.execute(new DecoratingWork(workItem, work));
             return true;
@@ -199,7 +193,7 @@
     private final class DecoratingWork implements Runnable {
 
         // Work item for this work.
-        private WorkItemImpl workItem;
+        private WorkItem workItem;
 
         // The original work.
         private Work decoratedWork;
@@ -207,7 +201,7 @@
         /*
          * Initializes the work item and underlying work.
          */
-        private DecoratingWork(final WorkItemImpl workItem, final Work decoratedWork) {
+        private DecoratingWork(final WorkItem workItem, final Work decoratedWork) {
             this.workItem = workItem;
             this.decoratedWork = decoratedWork;
         }
@@ -221,7 +215,7 @@
                 decoratedWork.run();
                 workCompleted(workItem, decoratedWork);
             } catch (Throwable th) {
-                workCompleted(workItem, decoratedWork, new WorkException(th.getMessage(),
th));
+                workCompleted(workItem, decoratedWork, new WorkSchedulerException(th.getMessage(),
th));
             }
         }
 

Copied: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Work.java
(from r720147, tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237Work.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Work.java?p2=tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Work.java&p1=tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237Work.java&r1=720147&r2=720913&rev=720913&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237Work.java
(original)
+++ tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Work.java
Wed Nov 26 08:38:18 2008
@@ -24,7 +24,7 @@
  *
  * @version $Rev$ $Date$
  */
-public class Jsr237Work<T extends Runnable> implements commonj.work.Work {
+public class Work<T extends Runnable> {
 
     // Work that is being executed.
     private T work;
@@ -32,7 +32,7 @@
     /*
      * Initializes the work instance.
      */
-    public Jsr237Work(T work) {
+    public Work(T work) {
         this.work = work;
     }
 

Propchange: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Work.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Work.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Nov 26 08:38:18 2008
@@ -0,0 +1,3 @@
+/tuscany/branches/sca-java-1.3/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237Work.java:671193
+/tuscany/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237Work.java:713805-714043
+/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237Work.java:694816-713804

Copied: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEvent.java
(from r720147, tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEventImpl.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEvent.java?p2=tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEvent.java&p1=tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEventImpl.java&r1=720147&r2=720913&rev=720913&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEventImpl.java
(original)
+++ tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEvent.java
Wed Nov 26 08:38:18 2008
@@ -18,30 +18,34 @@
  */
 package org.apache.tuscany.sca.core.work;
 
+import org.apache.tuscany.sca.work.WorkSchedulerException;
+
 
-import commonj.work.WorkEvent;
-import commonj.work.WorkException;
-import commonj.work.WorkItem;
 
 /**
  * Default immutable implementation of the <code>WorkEvent</code> class.
  *
  * @version $Rev$ $Date$
  */
-class WorkEventImpl implements WorkEvent {
+class WorkEvent {
     
+    public static final int WORK_ACCEPTED = 1;
+    public static final int WORK_REJECTED = 2;
+    public static final int WORK_STARTED = 3;
+    public static final int WORK_COMPLETED = 4;
+
     // Work item for this event
     private WorkItem workItem;
 
     // Exception if something has gone wrong
-    private WorkException exception;
+    private WorkSchedulerException exception;
 
     /**
      * Instantiates the event.
      *
      * @param workItem Work item for this event.
      */
-    public WorkEventImpl(final WorkItemImpl workItem) {
+    public WorkEvent(final WorkItem workItem) {
         this.workItem = workItem;
         this.exception = workItem.getException();
     }
@@ -70,7 +74,7 @@
      *
      * @return Work exception.
      */
-    public WorkException getException() {
+    public WorkSchedulerException getException() {
         return exception;
     }
 }

Propchange: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEvent.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Nov 26 08:38:18 2008
@@ -0,0 +1,3 @@
+/tuscany/branches/sca-java-1.3/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEventImpl.java:671193
+/tuscany/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEventImpl.java:713805-714043
+/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEventImpl.java:694816-713804

Copied: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItem.java
(from r720147, tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItem.java?p2=tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItem.java&p1=tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java&r1=720147&r2=720913&rev=720913&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java
(original)
+++ tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItem.java
Wed Nov 26 08:38:18 2008
@@ -18,9 +18,7 @@
  */
 package org.apache.tuscany.sca.core.work;
 
-import commonj.work.Work;
-import commonj.work.WorkException;
-import commonj.work.WorkItem;
+import org.apache.tuscany.sca.work.WorkSchedulerException;
 
 /**
  * An identity based immutable implementation of the <code>WorkItem</code>
@@ -28,7 +26,7 @@
  *
  * @version $Rev$ $Date$
  */
-class WorkItemImpl implements WorkItem {
+class WorkItem {
     
     // Id scoped for the VM
     private String id;
@@ -43,14 +41,14 @@
     private Work originalWork;
 
     // Exception
-    private WorkException exception;
+    private WorkSchedulerException exception;
 
     /**
      * Instantiates an id for this item.
      *
      * @param id of this work event.
      */
-    protected WorkItemImpl(final String id, final Work orginalWork) {
+    protected WorkItem(final String id, final Work orginalWork) {
         this.id = id;
         this.originalWork = orginalWork;
     }
@@ -97,7 +95,7 @@
      *
      * @return Work exception.
      */
-    protected WorkException getException() {
+    protected WorkSchedulerException getException() {
         return exception;
     }
 
@@ -106,7 +104,7 @@
      *
      * @param exception Exception.
      */
-    protected void setException(final WorkException exception) {
+    protected void setException(final WorkSchedulerException exception) {
         this.exception = exception;
     }
 
@@ -146,7 +144,7 @@
      */
     @Override
     public boolean equals(final Object obj) {
-        return (obj != null) && (obj.getClass() == WorkItemImpl.class) &&
((WorkItemImpl) obj).id.equals(id);
+        return (obj != null) && (obj.getClass() == WorkItem.class) && ((WorkItem)
obj).id.equals(id);
     }
 
     /**
@@ -160,10 +158,10 @@
      * @throws ClassCastException needs better documentation.
      */
     public int compareTo(final Object o) {
-        if (o.getClass() != WorkItemImpl.class) {
+        if (o.getClass() != WorkItem.class) {
             throw new ClassCastException(o.getClass().getName());
         } else {
-            return ((WorkItemImpl) o).getId().compareTo(getId());
+            return ((WorkItem) o).getId().compareTo(getId());
         }
     }
 }

Propchange: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItem.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItem.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Nov 26 08:38:18 2008
@@ -0,0 +1,3 @@
+/tuscany/branches/sca-java-1.3/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java:671193
+/tuscany/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java:713805-714043
+/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java:694816-713804

Added: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkListener.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkListener.java?rev=720913&view=auto
==============================================================================
--- tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkListener.java
(added)
+++ tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkListener.java
Wed Nov 26 08:38:18 2008
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.core.work;
+
+public interface WorkListener {
+
+    static long IMMEDIATE = 0;
+    static long INDEFINITE = java.lang.Long.MAX_VALUE;
+
+    void workAccepted(WorkEvent event);
+    void workCompleted(WorkEvent event);
+    void workRejected(WorkEvent event);
+    void workStarted(WorkEvent event);
+
+}

Modified: tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.work.WorkScheduler
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.work.WorkScheduler?rev=720913&r1=720912&r2=720913&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.work.WorkScheduler
(original)
+++ tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.work.WorkScheduler
Wed Nov 26 08:38:18 2008
@@ -15,4 +15,4 @@
 # specific language governing permissions and limitations
 # under the License.
 
-org.apache.tuscany.sca.core.work.Jsr237WorkScheduler
+org.apache.tuscany.sca.core.work.DefaultWorkScheduler

Modified: tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/FailingWork.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/FailingWork.java?rev=720913&r1=720912&r2=720913&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/FailingWork.java
(original)
+++ tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/FailingWork.java
Wed Nov 26 08:38:18 2008
@@ -18,14 +18,17 @@
  */
 package org.apache.tuscany.sca.core.work;
 
-import commonj.work.Work;
 
 /**
  * Simple Work item that will throw an exception
  * 
  * @version $Rev$ $Date$
  */
-public class FailingWork implements Work {
+public class FailingWork extends Work {
+
+    public FailingWork() {
+        super(null);
+    }
 
     /**
      * {@inheritDoc}

Modified: tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/Jsr237WorkSchedulerTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/Jsr237WorkSchedulerTestCase.java?rev=720913&r1=720912&r2=720913&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/Jsr237WorkSchedulerTestCase.java
(original)
+++ tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/Jsr237WorkSchedulerTestCase.java
Wed Nov 26 08:38:18 2008
@@ -38,14 +38,14 @@
     /**
      * This is the shared instance of the ThreadPoolWorkManager used by the tests
      */
-    private static Jsr237WorkScheduler workSchedular = null;
+    private static DefaultWorkScheduler workSchedular = null;
 
     /**
      * Setup the Jsr237WorkScheduler
      */
     @BeforeClass
     public static void setup() {
-        workSchedular = new Jsr237WorkScheduler();
+        workSchedular = new DefaultWorkScheduler();
     }
 
     /**

Modified: tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/TestWorkListener.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/TestWorkListener.java?rev=720913&r1=720912&r2=720913&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/TestWorkListener.java
(original)
+++ tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/TestWorkListener.java
Wed Nov 26 08:38:18 2008
@@ -23,12 +23,9 @@
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import org.apache.tuscany.sca.work.WorkSchedulerException;
 import org.junit.Assert;
 
-import commonj.work.WorkEvent;
-import commonj.work.WorkException;
-import commonj.work.WorkListener;
-
 /**
  * A simple WorkListener that tracks invocations to it.
  * 
@@ -59,7 +56,7 @@
     /**
      * List of all exceptions thrown by Work items
      */
-    private List<WorkException> workExceptions = Collections.synchronizedList(new ArrayList<WorkException>());
+    private List<WorkSchedulerException> workExceptions = Collections.synchronizedList(new
ArrayList<WorkSchedulerException>());
 
     /**
      * {@inheritDoc}
@@ -150,7 +147,7 @@
      * 
      * @return A List of all exceptions that are thrown by the Work items
      */
-    public List<WorkException> getWorkExceptions() {
+    public List<WorkSchedulerException> getWorkExceptions() {
         return Collections.unmodifiableList(workExceptions);
     }
 }

Modified: tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/TimeDelayWork.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/TimeDelayWork.java?rev=720913&r1=720912&r2=720913&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/TimeDelayWork.java
(original)
+++ tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/work/TimeDelayWork.java
Wed Nov 26 08:38:18 2008
@@ -20,15 +20,13 @@
 
 import java.util.concurrent.atomic.AtomicInteger;
 
-import commonj.work.Work;
-
 /**
  * Simple Work item that will sleep in the run() method for the specified 
  * period of time
  * 
  * @version $Rev$ $Date$
  */
-public class TimeDelayWork implements Work {
+public class TimeDelayWork extends Work {
 
     /**
      * Count of completed run() method calls
@@ -46,6 +44,7 @@
      * @param sleepTime The amount of time to sleep (in milliseconds) in the run() method
      */
     public TimeDelayWork(long sleepTime) {
+        super(null);
         this.sleepTime = sleepTime;
     }
 



Mime
View raw message