You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2008/10/17 11:07:13 UTC
svn commit: r705521 - in
/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee:
AssemblyDescriptor.java EjbJar.java MethodSchedule.java Schedule.java
Author: dblevins
Date: Fri Oct 17 02:07:11 2008
New Revision: 705521
URL: http://svn.apache.org/viewvc?rev=705521&view=rev
Log:
Added xml elements for the @Schedule and @Schedules annotations
Added:
openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MethodSchedule.java
openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/Schedule.java
Modified:
openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/AssemblyDescriptor.java
openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/EjbJar.java
Modified: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/AssemblyDescriptor.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/AssemblyDescriptor.java?rev=705521&r1=705520&r2=705521&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/AssemblyDescriptor.java (original)
+++ openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/AssemblyDescriptor.java Fri Oct 17 02:07:11 2008
@@ -58,6 +58,7 @@
"methodPermission",
"containerTransaction",
"containerConcurrency",
+ "methodSchedule",
"interceptorBinding",
"messageDestination",
"excludeList",
@@ -73,6 +74,8 @@
protected List<ContainerTransaction> containerTransaction;
@XmlElement(name = "container-concurrency", required = true)
protected List<ContainerConcurrency> containerConcurrency;
+ @XmlElement(name = "method-schedule", required = true)
+ protected List<MethodSchedule> methodSchedule;
@XmlElement(name = "interceptor-binding", required = true)
protected List<InterceptorBinding> interceptorBinding;
@XmlElement(name = "message-destination", required = true)
@@ -114,6 +117,13 @@
return this.containerConcurrency;
}
+ public List<MethodSchedule> getMethodSchedule() {
+ if (methodSchedule == null) {
+ methodSchedule = new ArrayList<MethodSchedule>();
+ }
+ return this.methodSchedule;
+ }
+
public Map<String,List<MethodAttribute>> getMethodTransactionMap(String ejbName) {
return getMethodAttributes(ejbName, getContainerTransaction());
}
@@ -122,6 +132,10 @@
return getMethodAttributes(ejbName, getContainerConcurrency());
}
+ public Map<String,List<MethodAttribute>> getMethodScheduleMap(String ejbName) {
+ return getMethodAttributes(ejbName, getMethodSchedule());
+ }
+
private Map<String, List<MethodAttribute>> getMethodAttributes(String ejbName, List<? extends AttributeBinding> bindings) {
Map<String,List<MethodAttribute>> methods = new LinkedHashMap<String,List<MethodAttribute>>();
Modified: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/EjbJar.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/EjbJar.java?rev=705521&r1=705520&r2=705521&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/EjbJar.java (original)
+++ openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/EjbJar.java Fri Oct 17 02:07:11 2008
@@ -174,7 +174,7 @@
public Map<String,EnterpriseBean> getEnterpriseBeansByEjbName() {
return enterpriseBeans;
}
-
+
public Interceptor[] getInterceptors() {
if (interceptors == null) return new Interceptor[]{};
return interceptors.getInterceptor();
Added: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MethodSchedule.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MethodSchedule.java?rev=705521&view=auto
==============================================================================
--- openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MethodSchedule.java (added)
+++ openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MethodSchedule.java Fri Oct 17 02:07:11 2008
@@ -0,0 +1,110 @@
+/**
+ * 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.apache.openejb.jee;
+
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlID;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import java.util.List;
+import java.util.ArrayList;
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "method-scheduleType", propOrder = {
+ "descriptions",
+ "schedule",
+ "method"
+ })
+public class MethodSchedule implements AttributeBinding<List<Schedule>> {
+
+ @XmlElement(name = "schedule", required = true)
+ protected List<Schedule> schedule;
+
+ @XmlElement(required = true)
+ protected List<Method> method;
+
+ @XmlAttribute
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ @XmlID
+ protected String id;
+
+ @XmlTransient
+ protected TextMap description = new TextMap();
+
+ public MethodSchedule() {
+ }
+
+ public MethodSchedule(String className, String ejbName, String methodName, Schedule... schedules) {
+ this(new Method(ejbName, className, methodName), schedules);
+ }
+
+ public MethodSchedule(String ejbName, java.lang.reflect.Method method, Schedule... schedules) {
+ this(new Method(ejbName, method), schedules);
+ }
+
+ public MethodSchedule(Method method, Schedule... schedules) {
+ getMethod().add(method);
+ for (Schedule schedule : schedules) {
+ getSchedule().add(schedule);
+ }
+ }
+
+ @XmlElement(name = "description", required = true)
+ public Text[] getDescriptions() {
+ return description.toArray();
+ }
+
+ public void setDescriptions(Text[] text) {
+ description.set(text);
+ }
+
+ public String getDescription() {
+ return description.get();
+ }
+
+ public List<Schedule> getSchedule() {
+ if (schedule == null) {
+ schedule = new ArrayList<Schedule>();
+ }
+ return this.schedule;
+ }
+
+ public List<Method> getMethod() {
+ if (method == null) {
+ method = new ArrayList<Method>();
+ }
+ return this.method;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String value) {
+ this.id = value;
+ }
+
+ public List<Schedule> getAttribute() {
+ return getSchedule();
+ }
+
+}
Added: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/Schedule.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/Schedule.java?rev=705521&view=auto
==============================================================================
--- openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/Schedule.java (added)
+++ openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/Schedule.java Fri Oct 17 02:07:11 2008
@@ -0,0 +1,121 @@
+/**
+ * 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.apache.openejb.jee;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "scheduleType", propOrder = {
+ "second",
+ "minute",
+ "hour",
+ "dayOfWeek",
+ "dayOfMonth",
+ "month",
+ "year",
+ "info",
+ "persistent"
+ })
+public class Schedule {
+
+ protected String dayOfMonth;
+ protected String dayOfWeek;
+ protected String hour;
+ protected String info;
+ protected String minute;
+ protected String month;
+ protected Boolean persistent;
+ protected String second;
+ protected String year;
+
+ public String getDayOfMonth() {
+ return dayOfMonth;
+ }
+
+ public void setDayOfMonth(String dayOfMonth) {
+ this.dayOfMonth = dayOfMonth;
+ }
+
+ public String getDayOfWeek() {
+ return dayOfWeek;
+ }
+
+ public void setDayOfWeek(String dayOfWeek) {
+ this.dayOfWeek = dayOfWeek;
+ }
+
+ public String getHour() {
+ return hour;
+ }
+
+ public void setHour(String hour) {
+ this.hour = hour;
+ }
+
+ public String getInfo() {
+ return info;
+ }
+
+ public void setInfo(String info) {
+ this.info = info;
+ }
+
+ public String getMinute() {
+ return minute;
+ }
+
+ public void setMinute(String minute) {
+ this.minute = minute;
+ }
+
+ public String getMonth() {
+ return month;
+ }
+
+ public void setMonth(String month) {
+ this.month = month;
+ }
+
+ public boolean isPersistent() {
+ return persistent != null && persistent;
+ }
+
+ public void setPersistent(boolean persistent) {
+ this.persistent = persistent;
+ }
+
+ public String getSecond() {
+ return second;
+ }
+
+ public void setSecond(String second) {
+ this.second = second;
+ }
+
+ public String getYear() {
+ return year;
+ }
+
+ public void setYear(String year) {
+ this.year = year;
+ }
+}