Author: dblevins
Date: Tue Apr 12 01:00:35 2011
New Revision: 1091269
URL: http://svn.apache.org/viewvc?rev=1091269&view=rev
Log:
meta version of the schedule-methods example
Added:
openejb/trunk/openejb3/examples/schedule-methods-meta/
- copied from r1090519, openejb/trunk/openejb3/examples/schedule-methods/
openejb/trunk/openejb3/examples/schedule-methods-meta/build.xml
- copied unchanged from r1090810,
openejb/trunk/openejb3/examples/schedule-methods/build.xml
openejb/trunk/openejb3/examples/schedule-methods-meta/pom.xml
- copied, changed from r1090810,
openejb/trunk/openejb3/examples/schedule-methods/pom.xml
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/FarmerBrown.java
(with props)
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiAnnually.java
(with props)
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiMonthly.java
(with props)
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Daily.java
(with props)
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/HarvestTime.java
(with props)
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Hourly.java
(with props)
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Metatype.java
(with props)
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Organic.java
(with props)
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/PlantingTime.java
(with props)
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Secondly.java
(with props)
openejb/trunk/openejb3/examples/schedule-methods-meta/src/test/java/org/superbiz/corn/meta/
openejb/trunk/openejb3/examples/schedule-methods-meta/src/test/java/org/superbiz/corn/meta/FarmerBrownTest.java
(with props)
Removed:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/FarmerBrown.java
openejb/trunk/openejb3/examples/schedule-methods-meta/src/test/java/org/superbiz/corn/FarmerBrownTest.java
Copied: openejb/trunk/openejb3/examples/schedule-methods-meta/pom.xml (from
r1090810, openejb/trunk/openejb3/examples/schedule-methods/pom.xml)
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/schedule-methods-meta/pom.xml?p2=openejb/trunk/openejb3/examples/schedule-methods-meta/pom.xml&p1=openejb/trunk/openejb3/examples/schedule-methods/pom.xml&r1=1090810&r2=1091269&rev=1091269&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/schedule-methods/pom.xml (original)
+++ openejb/trunk/openejb3/examples/schedule-methods-meta/pom.xml Tue Apr 12
01:00:35 2011
@@ -23,10 +23,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.superbiz</groupId>
- <artifactId>schedule-methods</artifactId>
+ <artifactId>schedule-methods-meta</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
- <name>OpenEJB :: Examples :: @Schedule Methods</name>
+ <name>OpenEJB :: Examples :: @Schedule Methods (Meta)</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Added:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/FarmerBrown.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/FarmerBrown.java?rev=1091269&view=auto
==============================================================================
---
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/FarmerBrown.java
(added)
+++
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/FarmerBrown.java
Tue Apr 12 01:00:35 2011
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.superbiz.corn.meta;
+
+import org.superbiz.corn.meta.api.HarvestTime;
+import org.superbiz.corn.meta.api.Organic;
+import org.superbiz.corn.meta.api.PlantingTime;
+import org.superbiz.corn.meta.api.Secondly;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * This is where we schedule all of Farmer Brown's corn jobs
+ *
+ * @version $Revision$ $Date$
+ */
+@Organic
+public class FarmerBrown {
+
+ private final AtomicInteger checks = new AtomicInteger();
+
+ @PlantingTime
+ private void plantTheCorn() {
+ // Dig out the planter!!!
+ }
+
+ @HarvestTime
+ private void harvestTheCorn() {
+ // Dig out the combine!!!
+ }
+
+ @Secondly
+ private void checkOnTheDaughters() {
+ checks.incrementAndGet();
+ }
+
+ public int getChecks() {
+ return checks.get();
+ }
+}
Propchange:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/FarmerBrown.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiAnnually.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiAnnually.java?rev=1091269&view=auto
==============================================================================
---
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiAnnually.java
(added)
+++
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiAnnually.java
Tue Apr 12 01:00:35 2011
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.superbiz.corn.meta.api;
+
+import javax.ejb.Schedule;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface BiAnnually {
+ public static interface $ {
+
+ @BiAnnually
+ @Schedule(second = "0", minute = "0", hour = "0", dayOfMonth = "1",
month = "1,6")
+ public void method();
+ }
+}
\ No newline at end of file
Propchange:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiAnnually.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiMonthly.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiMonthly.java?rev=1091269&view=auto
==============================================================================
---
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiMonthly.java
(added)
+++
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiMonthly.java
Tue Apr 12 01:00:35 2011
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.superbiz.corn.meta.api;
+
+import javax.ejb.Schedule;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface BiMonthly {
+ public static interface $ {
+
+ @BiMonthly
+ @Schedule(second = "0", minute = "0", hour = "0", dayOfMonth = "1,15")
+ public void method();
+ }
+}
\ No newline at end of file
Propchange:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/BiMonthly.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Daily.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Daily.java?rev=1091269&view=auto
==============================================================================
---
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Daily.java
(added)
+++
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Daily.java
Tue Apr 12 01:00:35 2011
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.superbiz.corn.meta.api;
+
+import javax.ejb.Schedule;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface Daily {
+ public static interface $ {
+
+ @Daily
+ @Schedule(second = "0", minute = "0", hour = "0", dayOfMonth = "*")
+ public void method();
+ }
+}
\ No newline at end of file
Propchange:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Daily.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/HarvestTime.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/HarvestTime.java?rev=1091269&view=auto
==============================================================================
---
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/HarvestTime.java
(added)
+++
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/HarvestTime.java
Tue Apr 12 01:00:35 2011
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.superbiz.corn.meta.api;
+
+import javax.ejb.Schedule;
+import javax.ejb.Schedules;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface HarvestTime {
+ public static interface $ {
+
+ @HarvestTime
+ @Schedules({
+ @Schedule(month = "9", dayOfMonth = "20-Last", minute = "0",
hour = "8"),
+ @Schedule(month = "10", dayOfMonth = "1-10", minute = "0",
hour = "8")
+ })
+ public void method();
+ }
+}
\ No newline at end of file
Propchange:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/HarvestTime.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Hourly.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Hourly.java?rev=1091269&view=auto
==============================================================================
---
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Hourly.java
(added)
+++
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Hourly.java
Tue Apr 12 01:00:35 2011
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.superbiz.corn.meta.api;
+
+import javax.ejb.Schedule;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface Hourly {
+ public static interface $ {
+
+ @Hourly
+ @Schedule(second = "0", minute = "0", hour = "*")
+ public void method();
+ }
+}
\ No newline at end of file
Propchange:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Hourly.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Metatype.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Metatype.java?rev=1091269&view=auto
==============================================================================
---
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Metatype.java
(added)
+++
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Metatype.java
Tue Apr 12 01:00:35 2011
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.superbiz.corn.meta.api;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.ANNOTATION_TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Metatype {
+}
Propchange:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Metatype.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Organic.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Organic.java?rev=1091269&view=auto
==============================================================================
---
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Organic.java
(added)
+++
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Organic.java
Tue Apr 12 01:00:35 2011
@@ -0,0 +1,20 @@
+package org.superbiz.corn.meta.api;
+
+import javax.ejb.Lock;
+import javax.ejb.LockType;
+import javax.ejb.Singleton;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+
+@Singleton
+@Lock(LockType.READ)
+public @interface Organic {
+}
Propchange:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Organic.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/PlantingTime.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/PlantingTime.java?rev=1091269&view=auto
==============================================================================
---
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/PlantingTime.java
(added)
+++
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/PlantingTime.java
Tue Apr 12 01:00:35 2011
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.superbiz.corn.meta.api;
+
+import javax.ejb.Schedule;
+import javax.ejb.Schedules;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface PlantingTime {
+ public static interface $ {
+
+ @PlantingTime
+ @Schedules({
+ @Schedule(month = "5", dayOfMonth = "20-Last", minute = "0",
hour = "8"),
+ @Schedule(month = "6", dayOfMonth = "1-10", minute = "0", hour
= "8")
+ })
+ public void method();
+ }
+}
Propchange:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/PlantingTime.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Secondly.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Secondly.java?rev=1091269&view=auto
==============================================================================
---
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Secondly.java
(added)
+++
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Secondly.java
Tue Apr 12 01:00:35 2011
@@ -0,0 +1,37 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.superbiz.corn.meta.api;
+
+import javax.ejb.Schedule;
+import javax.ejb.Schedules;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Metatype
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+
+public @interface Secondly {
+ public static interface $ {
+
+ @Secondly
+ @Schedule(second = "*", minute = "*", hour = "*")
+ public void method();
+ }
+}
\ No newline at end of file
Propchange:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/main/java/org/superbiz/corn/meta/api/Secondly.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/test/java/org/superbiz/corn/meta/FarmerBrownTest.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/schedule-methods-meta/src/test/java/org/superbiz/corn/meta/FarmerBrownTest.java?rev=1091269&view=auto
==============================================================================
---
openejb/trunk/openejb3/examples/schedule-methods-meta/src/test/java/org/superbiz/corn/meta/FarmerBrownTest.java
(added)
+++
openejb/trunk/openejb3/examples/schedule-methods-meta/src/test/java/org/superbiz/corn/meta/FarmerBrownTest.java
Tue Apr 12 01:00:35 2011
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.superbiz.corn.meta;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+
+import static java.util.concurrent.TimeUnit.SECONDS;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class FarmerBrownTest extends TestCase {
+
+ public void test() throws Exception {
+
+ final Context context = EJBContainer.createEJBContainer().getContext();
+
+ final FarmerBrown farmerBrown = (FarmerBrown)
context.lookup("java:global/schedule-methods-meta/FarmerBrown");
+
+ // Give Farmer brown a chance to do some work
+ Thread.sleep(SECONDS.toMillis(5));
+
+ assertTrue(farmerBrown.getChecks() > 4);
+ }
+}
Propchange:
openejb/trunk/openejb3/examples/schedule-methods-meta/src/test/java/org/superbiz/corn/meta/FarmerBrownTest.java
------------------------------------------------------------------------------
svn:eol-style = native