You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2007/12/18 01:19:57 UTC

svn commit: r605049 - in /openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee: DestinationType.java MessageDrivenBean.java MessageDrivenDestination.java SubscriptionDurability.java

Author: jlaskowski
Date: Mon Dec 17 16:19:55 2007
New Revision: 605049

URL: http://svn.apache.org/viewvc?rev=605049&view=rev
Log:
OPENEJB-701 EJB 2.0 depricated message-driven-destination tag not supported

Needs more unit tests 

Added:
    openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/DestinationType.java   (with props)
    openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MessageDrivenDestination.java   (with props)
    openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/SubscriptionDurability.java   (with props)
Modified:
    openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MessageDrivenBean.java

Added: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/DestinationType.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/DestinationType.java?rev=605049&view=auto
==============================================================================
--- openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/DestinationType.java (added)
+++ openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/DestinationType.java Mon Dec 17 16:19:55 2007
@@ -0,0 +1,92 @@
+/**
+ * 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.XmlAttribute;
+import javax.xml.bind.annotation.XmlID;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "value"
+})
+@XmlRootElement(name = "destination-type")
+public class DestinationType {
+
+    @XmlAttribute
+    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+    @XmlID
+    protected String id;
+    @XmlValue
+    protected String value;
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getvalue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setvalue(String value) {
+        this.value = value;
+    }
+
+}

Propchange: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/DestinationType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/DestinationType.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/DestinationType.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/DestinationType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MessageDrivenBean.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MessageDrivenBean.java?rev=605049&r1=605048&r2=605049&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MessageDrivenBean.java (original)
+++ openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MessageDrivenBean.java Mon Dec 17 16:19:55 2007
@@ -91,6 +91,7 @@
         "messagingType",
         "timeoutMethod",
         "transactionType",
+        "messageDrivenDestination",
         "messageDestinationType",
         "messageDestinationLink",
         "activationConfig",
@@ -129,6 +130,8 @@
     protected NamedMethod timeoutMethod;
     @XmlElement(name = "transaction-type")
     protected TransactionType transactionType;
+    @XmlElement(name = "message-driven-destination")
+    protected MessageDrivenDestination messageDrivenDestination;
     @XmlElement(name = "message-destination-type")
     protected String messageDestinationType;
     @XmlElement(name = "message-destination-link")
@@ -280,6 +283,14 @@
         this.timeoutMethod = value;
     }
 
+    public MessageDrivenDestination getMessageDrivenDestination() {
+        return messageDrivenDestination;
+    }
+
+    public void setMessageDrivenDestination(MessageDrivenDestination value) {
+        this.messageDrivenDestination = value;
+    }
+
     public TransactionType getTransactionType() {
         return transactionType;
     }
@@ -322,6 +333,23 @@
     }
 
     public ActivationConfig getActivationConfig() {
+        // convert the message-driven-destination to activation-config-property
+        // OPENEJB-701 EJB 2.0 depricated message-driven-destination tag not supported
+        // https://issues.apache.org/jira/browse/OPENEJB-701
+        if (messageDrivenDestination != null) {
+            if (activationConfig == null) {
+                activationConfig = new ActivationConfig();
+            }
+            DestinationType destinationType = messageDrivenDestination.getDestinationType();
+            if (destinationType != null) {
+                activationConfig.addProperty("destinationType", destinationType.getvalue());
+            }
+            SubscriptionDurability subscriptionDurability = messageDrivenDestination.getSubscriptionDurability();
+            if (subscriptionDurability != null) {
+                activationConfig.addProperty("subscriptionDurability", subscriptionDurability.getvalue());
+            }
+            messageDrivenDestination = null;
+        }
         return activationConfig;
     }
 

Added: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MessageDrivenDestination.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MessageDrivenDestination.java?rev=605049&view=auto
==============================================================================
--- openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MessageDrivenDestination.java (added)
+++ openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MessageDrivenDestination.java Mon Dec 17 16:19:55 2007
@@ -0,0 +1,117 @@
+/**
+ * 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.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlID;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "destinationType",
+    "subscriptionDurability"
+})
+@XmlRootElement(name = "message-driven-destination")
+public class MessageDrivenDestination {
+
+    @XmlAttribute
+    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+    @XmlID
+    protected String id;
+    @XmlElement(name = "destination-type", required = true)
+    protected DestinationType destinationType;
+    @XmlElement(name = "subscription-durability")
+    protected SubscriptionDurability subscriptionDurability;
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+    /**
+     * Gets the value of the destinationType property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link DestinationType }
+     *     
+     */
+    public DestinationType getDestinationType() {
+        return destinationType;
+    }
+
+    /**
+     * Sets the value of the destinationType property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link DestinationType }
+     *     
+     */
+    public void setDestinationType(DestinationType value) {
+        this.destinationType = value;
+    }
+
+    /**
+     * Gets the value of the subscriptionDurability property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link SubscriptionDurability }
+     *     
+     */
+    public SubscriptionDurability getSubscriptionDurability() {
+        return subscriptionDurability;
+    }
+
+    /**
+     * Sets the value of the subscriptionDurability property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link SubscriptionDurability }
+     *     
+     */
+    public void setSubscriptionDurability(SubscriptionDurability value) {
+        this.subscriptionDurability = value;
+    }
+}
\ No newline at end of file

Propchange: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MessageDrivenDestination.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MessageDrivenDestination.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MessageDrivenDestination.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/MessageDrivenDestination.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/SubscriptionDurability.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/SubscriptionDurability.java?rev=605049&view=auto
==============================================================================
--- openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/SubscriptionDurability.java (added)
+++ openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/SubscriptionDurability.java Mon Dec 17 16:19:55 2007
@@ -0,0 +1,91 @@
+/**
+ * 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.XmlAttribute;
+import javax.xml.bind.annotation.XmlID;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "value"
+})
+@XmlRootElement(name = "subscription-durability")
+public class SubscriptionDurability {
+
+    @XmlAttribute
+    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+    @XmlID
+    protected String id;
+    @XmlValue
+    protected String value;
+
+    /**
+     * Gets the value of the id property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getvalue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setvalue(String value) {
+        this.value = value;
+    }
+
+}

Propchange: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/SubscriptionDurability.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/SubscriptionDurability.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/SubscriptionDurability.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/SubscriptionDurability.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain