incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lin...@apache.org
Subject svn commit: r957097 - in /incubator/aries/sandbox/linsun/mds/mds-impl: pom.xml src/main/java/org/apache/aries/mds/impl/MDSContainerImpl.java
Date Wed, 23 Jun 2010 01:30:29 GMT
Author: linsun
Date: Wed Jun 23 01:30:29 2010
New Revision: 957097

URL: http://svn.apache.org/viewvc?rev=957097&view=rev
Log:
[message driven service] remove the message driven service container dependency on activemq
core or activemq ra

Modified:
    incubator/aries/sandbox/linsun/mds/mds-impl/pom.xml
    incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MDSContainerImpl.java

Modified: incubator/aries/sandbox/linsun/mds/mds-impl/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-impl/pom.xml?rev=957097&r1=957096&r2=957097&view=diff
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-impl/pom.xml (original)
+++ incubator/aries/sandbox/linsun/mds/mds-impl/pom.xml Wed Jun 23 01:30:29 2010
@@ -87,20 +87,6 @@
 		</dependency>
 
 		<dependency>
-			<groupId>org.apache.activemq</groupId>
-			<artifactId>activemq-ra</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.activemq</groupId>
-			<artifactId>activemq-core</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.geronimo.components</groupId>
-			<artifactId>geronimo-connector</artifactId>
-		</dependency>
-		<dependency>
 			<groupId>org.apache.geronimo.components</groupId>
 			<artifactId>geronimo-transaction</artifactId>
 		</dependency>

Modified: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MDSContainerImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MDSContainerImpl.java?rev=957097&r1=957096&r2=957097&view=diff
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MDSContainerImpl.java
(original)
+++ incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MDSContainerImpl.java
Wed Jun 23 01:30:29 2010
@@ -25,12 +25,9 @@ import javax.resource.spi.InvalidPropert
 import javax.resource.spi.ResourceAdapter;
 import javax.resource.spi.endpoint.MessageEndpointFactory;
 
+import org.apache.aries.mds.MDSContainer;
 import org.apache.xbean.recipe.ObjectRecipe;
 import org.apache.xbean.recipe.Option;
-
-import org.apache.activemq.ra.ActiveMQActivationSpec;
-import org.apache.activemq.ra.ActiveMQResourceAdapter;
-import org.apache.aries.mds.MDSContainer;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 public class MDSContainerImpl implements MDSContainer {
@@ -48,13 +45,21 @@ public class MDSContainerImpl implements
     }
     
     public void init() {
-        if (ra instanceof ActiveMQResourceAdapter) {
-            /*activationSpec = new ActiveMQActivationSpec();
-            activationSpec.setDestinationType(destinationType);
-            activationSpec.setDestination(destination);*/
-            activationSpec = createActivationSpec(sr, ActiveMQActivationSpec.class);
+        Class activationSpecClass = null;
+        try {
+            activationSpecClass = this.ra.getClass().getClassLoader()
+                    .loadClass("org.apache.activemq.ra.ActiveMQActivationSpec");
+        } catch (ClassNotFoundException e) {
+            // TODO Attempt to load other activation spec impl class
+            e.printStackTrace();
         }
-        // TODO add other resource adapter impl and activation spec impl
+
+        if (activationSpecClass == null) {
+            throw new NullPointerException(
+                    "Unable to load activationSpec class using the classloader of the ra
"
+                            + ra.toString());
+        }
+        activationSpec = createActivationSpec(sr, activationSpecClass);
 
     }
     
@@ -110,10 +115,10 @@ public class MDSContainerImpl implements
         for (String propKey : propKeys) {
             objectRecipe.setMethodProperty(propKey, sr.getProperty(propKey));
         }
-
+        
         // create the activationSpec
         ActivationSpec activationSpec = (ActivationSpec) objectRecipe.create(activationSpecClass.getClassLoader());
-
+        
         if (activationSpec == null) {
             throw new NullPointerException("activationSpec is not configured and null");
         }



Mime
View raw message