1
1
/*
2
- * Copyright 2002-2012 the original author or authors.
2
+ * Copyright 2002-2013 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
17
17
package org .springframework .scheduling .commonj ;
18
18
19
19
import java .util .Collection ;
20
+ import java .util .concurrent .Callable ;
20
21
import java .util .concurrent .Future ;
21
22
import java .util .concurrent .FutureTask ;
22
- import java .util .concurrent .Callable ;
23
-
24
23
import javax .naming .NamingException ;
25
24
26
25
import commonj .work .Work ;
54
53
* server's JNDI environment, as defined in the server's management console.
55
54
*
56
55
* <p><b>Note: At the time of this writing, the CommonJ WorkManager facility
57
- * is only supported on IBM WebSphere 6.0 + and BEA WebLogic 9.0+,
56
+ * is only supported on IBM WebSphere 6.1 + and BEA WebLogic 9.0+,
58
57
* despite being such a crucial API for an application server.</b>
59
- * (There is a similar facility available on WebSphere 5.1 Enterprise,
60
- * though, which we will discuss below.)
61
58
*
62
59
* <p><b>On JBoss and GlassFish, a similar facility is available through
63
60
* the JCA WorkManager.</b> See the
@@ -80,8 +77,7 @@ public class WorkManagerTaskExecutor extends JndiLocatorSupport
80
77
81
78
/**
82
79
* Specify the CommonJ WorkManager to delegate to.
83
- * <p>Alternatively, you can also specify the JNDI name
84
- * of the target WorkManager.
80
+ * <p>Alternatively, you can also specify the JNDI name of the target WorkManager.
85
81
* @see #setWorkManagerName
86
82
*/
87
83
public void setWorkManager (WorkManager workManager ) {
@@ -90,9 +86,8 @@ public void setWorkManager(WorkManager workManager) {
90
86
91
87
/**
92
88
* Set the JNDI name of the CommonJ WorkManager.
93
- * <p>This can either be a fully qualified JNDI name,
94
- * or the JNDI name relative to the current environment
95
- * naming context if "resourceRef" is set to "true".
89
+ * <p>This can either be a fully qualified JNDI name, or the JNDI name relative
90
+ * to the current environment naming context if "resourceRef" is set to "true".
96
91
* @see #setWorkManager
97
92
* @see #setResourceRef
98
93
*/
@@ -170,27 +165,19 @@ public boolean prefersShortLivedTasks() {
170
165
// Implementation of the CommonJ WorkManager interface
171
166
//-------------------------------------------------------------------------
172
167
173
- public WorkItem schedule (Work work )
174
- throws WorkException , IllegalArgumentException {
175
-
168
+ public WorkItem schedule (Work work ) throws WorkException , IllegalArgumentException {
176
169
return this .workManager .schedule (work );
177
170
}
178
171
179
- public WorkItem schedule (Work work , WorkListener workListener )
180
- throws WorkException , IllegalArgumentException {
181
-
172
+ public WorkItem schedule (Work work , WorkListener workListener ) throws WorkException {
182
173
return this .workManager .schedule (work , workListener );
183
174
}
184
175
185
- public boolean waitForAll (Collection workItems , long timeout )
186
- throws InterruptedException , IllegalArgumentException {
187
-
176
+ public boolean waitForAll (Collection workItems , long timeout ) throws InterruptedException {
188
177
return this .workManager .waitForAll (workItems , timeout );
189
178
}
190
179
191
- public Collection waitForAny (Collection workItems , long timeout )
192
- throws InterruptedException , IllegalArgumentException {
193
-
180
+ public Collection waitForAny (Collection workItems , long timeout ) throws InterruptedException {
194
181
return this .workManager .waitForAny (workItems , timeout );
195
182
}
196
183
0 commit comments