Removed SchedulableTask interface. The only implementation (AbstractPoller) now implements Runnable directly and still provides the getTrigger() method.
This commit is contained in:
@@ -18,7 +18,6 @@ package org.springframework.integration.endpoint;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.integration.scheduling.SchedulableTask;
|
||||
import org.springframework.integration.scheduling.Trigger;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
@@ -33,7 +32,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public abstract class AbstractPoller implements SchedulableTask, InitializingBean {
|
||||
public abstract class AbstractPoller implements Runnable, InitializingBean {
|
||||
|
||||
public static final int MAX_MESSAGES_UNBOUNDED = -1;
|
||||
|
||||
@@ -134,14 +133,14 @@ public abstract class AbstractPoller implements SchedulableTask, InitializingBea
|
||||
private void poll() {
|
||||
int count = 0;
|
||||
while (this.maxMessagesPerPoll < 0 || count < this.maxMessagesPerPoll) {
|
||||
if (!this.pollWithinTransaction()) {
|
||||
if (!this.innerPoll()) {
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean pollWithinTransaction() {
|
||||
private boolean innerPoll() {
|
||||
TransactionTemplate txTemplate = this.getTransactionTemplate();
|
||||
if (txTemplate != null) {
|
||||
return (Boolean) txTemplate.execute(new TransactionCallback() {
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
*
|
||||
* 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 org.springframework.integration.scheduling;
|
||||
|
||||
/**
|
||||
* An extension of runnable that provides metadata for a {@link TaskScheduler}.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public interface SchedulableTask extends Runnable {
|
||||
|
||||
Trigger getTrigger();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user