Author: ips
Date: Wed Apr 27 13:18:29 2005
New Revision: 165038

URL: http://svn.apache.org/viewcvs?rev=165038&view=rev
Log:
from-scratch source files for the CommonJ TWM APIs

Added:
    incubator/apollo/trunk/commonj-twm/
    incubator/apollo/trunk/commonj-twm/project.properties
    incubator/apollo/trunk/commonj-twm/project.xml
    incubator/apollo/trunk/commonj-twm/src/
    incubator/apollo/trunk/commonj-twm/src/java/
    incubator/apollo/trunk/commonj-twm/src/java/commonj/
    incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/
    
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/CancelTimerListener.java
    
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/StopTimerListener.java
    incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/Timer.java
    
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/TimerListener.java
    incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/TimerManager.java
    incubator/apollo/trunk/commonj-twm/src/java/commonj/work/
    incubator/apollo/trunk/commonj-twm/src/java/commonj/work/RemoteWorkItem.java
    incubator/apollo/trunk/commonj-twm/src/java/commonj/work/Work.java
    
incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkCompletedException.java
    incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkEvent.java
    incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkException.java
    incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkItem.java
    incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkListener.java
    incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkManager.java
    
incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkRejectedException.java

Added: incubator/apollo/trunk/commonj-twm/project.properties
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/project.properties?rev=165038&view=auto
==============================================================================
--- incubator/apollo/trunk/commonj-twm/project.properties (added)
+++ incubator/apollo/trunk/commonj-twm/project.properties Wed Apr 27 13:18:29 
2005
@@ -0,0 +1,15 @@
+# -----------------------------------------------------------------------------
+# Default properties for the Maven build. You can override these properties
+# either by defining a build.properties file with the overriden properties
+# or by passing them on the command line as system parameters (-D).
+# -----------------------------------------------------------------------------
+
+# MAVEN CORE
+##############
+# comma-spearated list of remote JAR repository URLs
+maven.repo.remote = http://www.apache.org/dist/java-repository/, 
http://cvs.apache.org/repository/, http://mirrors.sunsite.dk/maven/, 
http://people.apache.org/~ips/maven-repo/
+
+# JAVA PLUGIN
+##############
+maven.compile.debug = on
+maven.compile.target = 1.4

Added: incubator/apollo/trunk/commonj-twm/project.xml
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/project.xml?rev=165038&view=auto
==============================================================================
--- incubator/apollo/trunk/commonj-twm/project.xml (added)
+++ incubator/apollo/trunk/commonj-twm/project.xml Wed Apr 27 13:18:29 2005
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+
+<!-- CommonJ Timer/WorkManager APIs Project Descriptor - defines Project 
Object Model (POM) -->
+
+<!-- Schema for this file is at:    
http://maven.apache.org/xsd/maven-project-3.0.0.xsd -->
+<!-- Reference for this file is at: 
http://maven.apache.org/reference/project-descriptor.html -->
+
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         
xsi:noNamespaceSchemaLocation="http://maven.apache.org/xsd/maven-project-3.0.0.xsd";>
+
+  <pomVersion>3</pomVersion>
+  <name>CommonJ Timer/WorkManager APIs</name>
+  <id>commonj-twm-api</id>
+  <groupId>apollo</groupId>
+  <currentVersion>1.1</currentVersion>
+  <organization>
+    <name>Apache Software Foundation</name>
+    <url>http://www.apache.org/</url>
+  </organization>  
+  <package>commonj</package>
+  
+  <repository>
+    
<connection>scm|svn|http://svn.apache.org/repos/asf/incubator/apollo/trunk/commonj-twm/</connection>
+    
<developerConnection>scm|svn|https://svn.apache.org/repos/asf/incubator/apollo/trunk/commonj-twm/</developerConnection>
+    
<url>http://svn.apache.org/viewcvs.cgi/incubator/apollo/trunk/commonj-twm/</url>
+  </repository> 
+  
+  <versions>
+    <version>
+      <id>1.1</id>
+      <name>1.1</name>
+      <tag>HEAD</tag>
+    </version>
+  </versions>
+    
+  <developers>
+    <developer>
+      <name>Ian Springer</name>
+      <id>ips</id>
+      <email>ian DOT springer AT hp DOT com</email>
+      <organization>Hewlett-Packard Company</organization>
+      <roles>
+        <role>Developer</role>
+      </roles>
+      <timezone>-5</timezone>
+    </developer>
+  </developers>
+
+  <build>
+    <sourceDirectory>src/java</sourceDirectory>
+  </build>
+
+</project>

Added: 
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/CancelTimerListener.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/CancelTimerListener.java?rev=165038&view=auto
==============================================================================
--- 
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/CancelTimerListener.java
 (added)
+++ 
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/CancelTimerListener.java
 Wed Apr 27 13:18:29 2005
@@ -0,0 +1,21 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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 commonj.timers;
+
+public interface CancelTimerListener extends TimerListener
+{
+       void timerCancel(Timer timer);
+}

Added: 
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/StopTimerListener.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/StopTimerListener.java?rev=165038&view=auto
==============================================================================
--- 
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/StopTimerListener.java
 (added)
+++ 
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/StopTimerListener.java
 Wed Apr 27 13:18:29 2005
@@ -0,0 +1,21 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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 commonj.timers;
+
+public interface StopTimerListener extends TimerListener
+{
+       void timerStop(Timer timer);
+}

Added: incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/Timer.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/Timer.java?rev=165038&view=auto
==============================================================================
--- incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/Timer.java 
(added)
+++ incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/Timer.java Wed 
Apr 27 13:18:29 2005
@@ -0,0 +1,29 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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 commonj.timers;
+
+public interface Timer
+{
+       boolean cancel();
+
+       TimerListener getTimerListener();
+
+       long getScheduledExecutionTime()
+        throws IllegalStateException;
+
+       long getPeriod();
+}
+

Added: 
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/TimerListener.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/TimerListener.java?rev=165038&view=auto
==============================================================================
--- 
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/TimerListener.java 
(added)
+++ 
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/TimerListener.java 
Wed Apr 27 13:18:29 2005
@@ -0,0 +1,22 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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 commonj.timers;
+
+public interface TimerListener
+{
+       void timerExpired(Timer timer);
+}
+

Added: 
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/TimerManager.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/TimerManager.java?rev=165038&view=auto
==============================================================================
--- 
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/TimerManager.java 
(added)
+++ 
incubator/apollo/trunk/commonj-twm/src/java/commonj/timers/TimerManager.java 
Wed Apr 27 13:18:29 2005
@@ -0,0 +1,62 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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 commonj.timers;
+
+import java.util.Date;
+
+public interface TimerManager
+{
+
+    long IMMEDIATE = 0;
+
+    long INDEFINITE = Long.MAX_VALUE;
+
+       void suspend();
+
+    boolean isSuspending() throws IllegalStateException;
+
+    boolean isSuspended() throws IllegalStateException;
+
+    boolean waitForSuspend(long timeout_ms) throws InterruptedException, 
IllegalStateException, IllegalArgumentException;
+
+       void resume() throws IllegalStateException;
+
+       void stop() throws IllegalStateException;
+
+    boolean isStopped();
+
+    boolean isStopping();
+
+    boolean waitForStop(long timeout_ms) throws InterruptedException, 
IllegalArgumentException;
+
+       Timer schedule(TimerListener listener, Date time)
+        throws IllegalArgumentException, IllegalStateException;
+
+       Timer schedule(TimerListener listener, long delay)
+        throws IllegalArgumentException, IllegalStateException;
+
+    Timer schedule(TimerListener listener, Date firstTime, long period)
+        throws IllegalArgumentException, IllegalStateException;
+
+       Timer schedule(TimerListener listener, long delay, long period)
+        throws IllegalArgumentException, IllegalStateException;
+
+       Timer scheduleAtFixedRate(TimerListener listener, Date firstTime, long 
period)
+        throws IllegalArgumentException, IllegalStateException;
+
+       Timer scheduleAtFixedRate(TimerListener listener, long delay, long 
period)
+        throws IllegalArgumentException, IllegalStateException;
+}

Added: 
incubator/apollo/trunk/commonj-twm/src/java/commonj/work/RemoteWorkItem.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/src/java/commonj/work/RemoteWorkItem.java?rev=165038&view=auto
==============================================================================
--- 
incubator/apollo/trunk/commonj-twm/src/java/commonj/work/RemoteWorkItem.java 
(added)
+++ 
incubator/apollo/trunk/commonj-twm/src/java/commonj/work/RemoteWorkItem.java 
Wed Apr 27 13:18:29 2005
@@ -0,0 +1,24 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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 commonj.work;
+
+public interface RemoteWorkItem extends WorkItem
+{
+
+       void release();
+
+       WorkManager getPinnedWorkManager();
+}

Added: incubator/apollo/trunk/commonj-twm/src/java/commonj/work/Work.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/src/java/commonj/work/Work.java?rev=165038&view=auto
==============================================================================
--- incubator/apollo/trunk/commonj-twm/src/java/commonj/work/Work.java (added)
+++ incubator/apollo/trunk/commonj-twm/src/java/commonj/work/Work.java Wed Apr 
27 13:18:29 2005
@@ -0,0 +1,23 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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 commonj.work;
+
+public interface Work extends Runnable
+{
+       void release();
+
+       boolean isDaemon();
+}

Added: 
incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkCompletedException.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkCompletedException.java?rev=165038&view=auto
==============================================================================
--- 
incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkCompletedException.java
 (added)
+++ 
incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkCompletedException.java
 Wed Apr 27 13:18:29 2005
@@ -0,0 +1,60 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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 commonj.work;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class WorkCompletedException extends WorkException
+{
+       List exceptionList;
+
+    public WorkCompletedException()
+    {
+    }
+
+    public WorkCompletedException(String message)
+    {
+        super(message);
+    }
+
+    public WorkCompletedException(String message, Throwable cause)
+    {
+        super(message, cause);
+    }
+
+    public WorkCompletedException(Throwable cause)
+    {
+        super(cause);
+    }
+
+       public WorkCompletedException(String message, List list)
+       {
+               super(message);
+               exceptionList = list;
+       }
+
+       public List getExceptionList()
+       {
+               if(exceptionList == null && getCause() != null)
+               {
+                       ArrayList a = new ArrayList();
+                       a.add(getCause());
+                       return a;
+               }
+               return exceptionList;
+       }
+}

Added: incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkEvent.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkEvent.java?rev=165038&view=auto
==============================================================================
--- incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkEvent.java 
(added)
+++ incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkEvent.java Wed 
Apr 27 13:18:29 2005
@@ -0,0 +1,31 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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 commonj.work;
+
+public interface WorkEvent
+{
+       int WORK_ACCEPTED = 1;
+       int WORK_REJECTED = 2;
+       int WORK_STARTED = 3;
+       int WORK_COMPLETED = 4;
+
+       public int getType();
+
+       public WorkItem getWorkItem();
+
+       public WorkException getException();
+}
+

Added: 
incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkException.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkException.java?rev=165038&view=auto
==============================================================================
--- incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkException.java 
(added)
+++ incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkException.java 
Wed Apr 27 13:18:29 2005
@@ -0,0 +1,40 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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 commonj.work;
+
+public class WorkException extends Exception
+{
+
+    public WorkException()
+    {
+    }
+
+    public WorkException(String message)
+    {
+        super(message);
+    }
+
+    public WorkException(String message, Throwable cause)
+    {
+        super(message, cause);
+    }
+
+    public WorkException(Throwable cause)
+    {
+        super(cause);
+    }
+
+}

Added: incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkItem.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkItem.java?rev=165038&view=auto
==============================================================================
--- incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkItem.java 
(added)
+++ incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkItem.java Wed 
Apr 27 13:18:29 2005
@@ -0,0 +1,24 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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 commonj.work;
+
+public interface WorkItem extends Comparable
+{
+    Work getResult()
+        throws WorkException;
+
+       int getStatus();
+}

Added: 
incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkListener.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkListener.java?rev=165038&view=auto
==============================================================================
--- incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkListener.java 
(added)
+++ incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkListener.java 
Wed Apr 27 13:18:29 2005
@@ -0,0 +1,30 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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 commonj.work;
+
+import java.util.EventListener;
+
+public interface WorkListener extends EventListener
+{
+       void workAccepted(WorkEvent we);
+
+       void workRejected(WorkEvent we);
+
+       void workStarted(WorkEvent we);
+
+       void workCompleted(WorkEvent we);
+}
+

Added: incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkManager.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkManager.java?rev=165038&view=auto
==============================================================================
--- incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkManager.java 
(added)
+++ incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkManager.java 
Wed Apr 27 13:18:29 2005
@@ -0,0 +1,37 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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 commonj.work;
+
+import java.util.Collection;
+
+public interface WorkManager
+{
+       long IMMEDIATE = 0;
+
+       long INDEFINITE = Long.MAX_VALUE;
+
+       WorkItem schedule(Work work)
+               throws WorkException, IllegalArgumentException;
+
+       WorkItem schedule(Work work, WorkListener wl)
+               throws WorkException, IllegalArgumentException;
+
+       boolean waitForAll(Collection workItems, long timeout_ms)
+        throws InterruptedException, IllegalArgumentException;
+
+       Collection waitForAny(Collection workItems, long timeout_ms)
+        throws InterruptedException, IllegalArgumentException;
+}

Added: 
incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkRejectedException.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkRejectedException.java?rev=165038&view=auto
==============================================================================
--- 
incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkRejectedException.java
 (added)
+++ 
incubator/apollo/trunk/commonj-twm/src/java/commonj/work/WorkRejectedException.java
 Wed Apr 27 13:18:29 2005
@@ -0,0 +1,40 @@
+/*=============================================================================*
+ *  Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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 commonj.work;
+
+public class WorkRejectedException extends WorkException
+{
+
+    public WorkRejectedException()
+    {
+    }
+
+    public WorkRejectedException(String message)
+    {
+        super(message);
+    }
+
+    public WorkRejectedException(String message, Throwable cause)
+    {
+        super(message, cause);
+    }
+
+    public WorkRejectedException(Throwable cause)
+    {
+        super(cause);
+    }
+
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to