Skip to content

Commit 7d7758b

Browse files
committed
Polishing
1 parent 0ec19dc commit 7d7758b

File tree

5 files changed

+16
-31
lines changed

5 files changed

+16
-31
lines changed

spring-context-support/src/main/java/org/springframework/scheduling/commonj/TimerManagerTaskScheduler.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -43,10 +43,15 @@ public class TimerManagerTaskScheduler extends TimerManagerAccessor implements T
4343

4444
private volatile ErrorHandler errorHandler;
4545

46+
47+
/**
48+
* Provide an {@link ErrorHandler} strategy.
49+
*/
4650
public void setErrorHandler(ErrorHandler errorHandler) {
4751
this.errorHandler = errorHandler;
4852
}
4953

54+
5055
public ScheduledFuture schedule(Runnable task, Trigger trigger) {
5156
return new ReschedulingTimerListener(errorHandlingTask(task, true), trigger).schedule();
5257
}

spring-context-support/src/main/java/org/springframework/scheduling/commonj/WorkManagerTaskExecutor.java

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -65,26 +65,6 @@
6565
* {@link org.springframework.jca.work.glassfish.GlassFishWorkManagerTaskExecutor}
6666
* classes which are the direct equivalent of this CommonJ adapter class.
6767
*
68-
* <p>A similar facility is available on WebSphere 5.1, under the name
69-
* "Asynch Beans". Its central interface is called WorkManager too and is
70-
* also obtained from JNDI, just like a standard CommonJ WorkManager.
71-
* However, this WorkManager variant is notably different: The central
72-
* execution method is called "startWork" instead of "schedule",
73-
* and takes a slightly different Work interface as parameter.
74-
*
75-
* <p>Support for this WebSphere 5.1 variant can be built with this class
76-
* and its helper DelegatingWork as template: Call the WorkManager's
77-
* <code>startWork(Work)</code> instead of <code>schedule(Work)</code>
78-
* in the <code>execute(Runnable)</code> implementation. Furthermore,
79-
* for simplicity's sake, drop the entire "Implementation of the CommonJ
80-
* WorkManager interface" section (and the corresponding
81-
* <code>implements WorkManager</code> clause at the class level).
82-
* Of course, you also need to change all <code>commonj.work</code> imports in
83-
* your WorkManagerTaskExecutor and DelegatingWork variants to the corresponding
84-
* WebSphere API imports (<code>com.ibm.websphere.asynchbeans.WorkManager</code>
85-
* and <code>com.ibm.websphere.asynchbeans.Work</code>, respectively).
86-
* This should be sufficient to get a TaskExecutor adapter for WebSphere 5.
87-
*
8868
* @author Juergen Hoeller
8969
* @since 2.0
9070
*/

spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessorBean.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -95,8 +95,8 @@ protected Scheduler findScheduler(String schedulerName) throws SchedulerExceptio
9595
if (this.beanFactory instanceof ListableBeanFactory) {
9696
ListableBeanFactory lbf = (ListableBeanFactory) this.beanFactory;
9797
String[] beanNames = lbf.getBeanNamesForType(Scheduler.class);
98-
for (int i = 0; i < beanNames.length; i++) {
99-
Scheduler schedulerBean = (Scheduler) lbf.getBean(beanNames[i]);
98+
for (String beanName : beanNames) {
99+
Scheduler schedulerBean = (Scheduler) lbf.getBean(beanName);
100100
if (schedulerName.equals(schedulerBean.getSchedulerName())) {
101101
return schedulerBean;
102102
}

spring-core/src/main/java/org/springframework/util/ErrorHandler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,14 +21,14 @@
2121
* errors that occur during asynchronous execution of tasks that have been
2222
* submitted to a TaskScheduler. In such cases, it may not be possible to
2323
* throw the error to the original caller.
24-
*
24+
*
2525
* @author Mark Fisher
26-
* @since 3.0.
26+
* @since 3.0
2727
*/
2828
public interface ErrorHandler {
2929

3030
/**
31-
* Handle the given error, possibly rethrowing it as a fatal exception
31+
* Handle the given error, possibly rethrowing it as a fatal exception.
3232
*/
3333
void handleError(Throwable t);
3434

spring-tx/src/main/java/org/springframework/jca/work/WorkManagerTaskExecutor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -70,7 +70,7 @@
7070
* @see javax.resource.spi.work.WorkManager#scheduleWork
7171
*/
7272
public class WorkManagerTaskExecutor extends JndiLocatorSupport
73-
implements SchedulingTaskExecutor, AsyncTaskExecutor, WorkManager, BootstrapContextAware, InitializingBean {
73+
implements SchedulingTaskExecutor, WorkManager, BootstrapContextAware, InitializingBean {
7474

7575
private WorkManager workManager;
7676

0 commit comments

Comments
 (0)