From d2bddbbbfa5d4c3e00cc865c823e6160e13e69c9 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Wed, 24 Sep 2008 18:36:36 +0000 Subject: [PATCH] Removed Schedule, PollingSchedule, and CronSchedule. These have been replaced by Trigger, IntervalTrigger, and CronTrigger. --- .../integration/annotation/Poller.java | 6 +- .../integration/scheduling/CronSchedule.java | 38 ------ .../scheduling/PollingSchedule.java | 108 ------------------ .../integration/scheduling/Schedule.java | 28 ----- 4 files changed, 2 insertions(+), 178 deletions(-) delete mode 100644 org.springframework.integration/src/main/java/org/springframework/integration/scheduling/CronSchedule.java delete mode 100644 org.springframework.integration/src/main/java/org/springframework/integration/scheduling/PollingSchedule.java delete mode 100644 org.springframework.integration/src/main/java/org/springframework/integration/scheduling/Schedule.java diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Poller.java b/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Poller.java index 8e88d9949e..74a57dffad 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Poller.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Poller.java @@ -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; diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/scheduling/CronSchedule.java b/org.springframework.integration/src/main/java/org/springframework/integration/scheduling/CronSchedule.java deleted file mode 100644 index f10b5bf740..0000000000 --- a/org.springframework.integration/src/main/java/org/springframework/integration/scheduling/CronSchedule.java +++ /dev/null @@ -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; - } - -} diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/scheduling/PollingSchedule.java b/org.springframework.integration/src/main/java/org/springframework/integration/scheduling/PollingSchedule.java deleted file mode 100644 index 162bb4ea06..0000000000 --- a/org.springframework.integration/src/main/java/org/springframework/integration/scheduling/PollingSchedule.java +++ /dev/null @@ -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; - } - -} diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/scheduling/Schedule.java b/org.springframework.integration/src/main/java/org/springframework/integration/scheduling/Schedule.java deleted file mode 100644 index f8074f616c..0000000000 --- a/org.springframework.integration/src/main/java/org/springframework/integration/scheduling/Schedule.java +++ /dev/null @@ -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 { - -}