Removed Schedule, PollingSchedule, and CronSchedule. These have been replaced by Trigger, IntervalTrigger, and CronTrigger.
This commit is contained in:
@@ -24,8 +24,6 @@ import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.integration.scheduling.PollingSchedule;
|
||||
|
||||
/**
|
||||
* Annotation that can be specified at method-level alongside a Message Endpoint
|
||||
* annotation (e.g. @Splitter, @ChannelAdapter, etc.) in order to provide the
|
||||
@@ -41,9 +39,9 @@ public @interface Poller {
|
||||
|
||||
int interval();
|
||||
|
||||
long initialDelay() default PollingSchedule.DEFAULT_INITIAL_DELAY;
|
||||
long initialDelay() default 0;
|
||||
|
||||
boolean fixedRate() default PollingSchedule.DEFAULT_FIXED_RATE;
|
||||
boolean fixedRate() default false;
|
||||
|
||||
TimeUnit timeUnit() default TimeUnit.MILLISECONDS;
|
||||
|
||||
|
||||
@@ -1,38 +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;
|
||||
|
||||
/**
|
||||
* A schedule using a Cron expression.
|
||||
*
|
||||
* @author Marius Bogoevici
|
||||
*/
|
||||
public class CronSchedule implements Schedule {
|
||||
|
||||
private final String cronExpression;
|
||||
|
||||
|
||||
public CronSchedule(String cronExpression) {
|
||||
this.cronExpression = cronExpression;
|
||||
}
|
||||
|
||||
|
||||
public String getCronExpression() {
|
||||
return this.cronExpression;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2007 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;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Scheduling metadata for a task that repeats at a regular interval.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public class PollingSchedule implements Schedule {
|
||||
|
||||
public static final long DEFAULT_INITIAL_DELAY = 0;
|
||||
|
||||
public static final boolean DEFAULT_FIXED_RATE = false;
|
||||
|
||||
|
||||
private volatile long period;
|
||||
|
||||
private volatile long initialDelay = DEFAULT_INITIAL_DELAY;
|
||||
|
||||
private volatile TimeUnit timeUnit = TimeUnit.MILLISECONDS;
|
||||
|
||||
private volatile boolean fixedRate = DEFAULT_FIXED_RATE;
|
||||
|
||||
|
||||
/**
|
||||
* Create a fixed-delay schedule with no initial delay.
|
||||
*
|
||||
* @param period the polling period in milliseconds
|
||||
*/
|
||||
public PollingSchedule(long period) {
|
||||
this.period = period;
|
||||
}
|
||||
|
||||
|
||||
public long getPeriod() {
|
||||
return this.period;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the polling period. A period of 0 indicates a repeating task.
|
||||
*/
|
||||
public void setPeriod(long period) {
|
||||
this.period = period;
|
||||
}
|
||||
|
||||
public long getInitialDelay() {
|
||||
return this.initialDelay;
|
||||
}
|
||||
|
||||
public void setInitialDelay(long initialDelay) {
|
||||
Assert.isTrue(initialDelay >= 0, "'initialDelay' must not be negative");
|
||||
this.initialDelay = initialDelay;
|
||||
}
|
||||
|
||||
public TimeUnit getTimeUnit() {
|
||||
return this.timeUnit;
|
||||
}
|
||||
|
||||
public void setTimeUnit(TimeUnit timeUnit) {
|
||||
Assert.notNull(timeUnit, "'timeUnit' must not be null");
|
||||
this.timeUnit = timeUnit;
|
||||
}
|
||||
|
||||
public boolean getFixedRate() {
|
||||
return this.fixedRate;
|
||||
}
|
||||
|
||||
public void setFixedRate(boolean fixedRate) {
|
||||
this.fixedRate = fixedRate;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return toString().hashCode() * 23;
|
||||
}
|
||||
|
||||
public boolean equals(Object other) {
|
||||
if (other == null) {
|
||||
return false;
|
||||
}
|
||||
return (other instanceof PollingSchedule &&
|
||||
this.toString().equals(((PollingSchedule) other).toString()));
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "initialDelay=" + this.initialDelay + ", period=" + this.period +
|
||||
", timeUnit=" + this.timeUnit + ", fixedRate=" + this.fixedRate;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* A marker interface for scheduling metadata. Implementations
|
||||
* of this interface will provide the information necessary for
|
||||
* a {@link TaskScheduler} implementation to schedule tasks.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public interface Schedule {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user