You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by li...@apache.org on 2010/06/11 22:09:33 UTC

svn commit: r953860 [1/3] - in /incubator/aries/sandbox/linsun/mds: ./ mds-api/ mds-api/.settings/ mds-api/src/ mds-api/src/main/ mds-api/src/main/java/ mds-api/src/main/java/org/ mds-api/src/main/java/org/apache/ mds-api/src/main/java/org/apache/aries...

Author: linsun
Date: Fri Jun 11 20:09:30 2010
New Revision: 953860

URL: http://svn.apache.org/viewvc?rev=953860&view=rev
Log:
[message driven service] initial Message Driven service prototype with Apache ActiveMQ

Added:
    incubator/aries/sandbox/linsun/mds/
    incubator/aries/sandbox/linsun/mds/mds-api/
    incubator/aries/sandbox/linsun/mds/mds-api/.classpath
    incubator/aries/sandbox/linsun/mds/mds-api/.project
    incubator/aries/sandbox/linsun/mds/mds-api/.settings/
    incubator/aries/sandbox/linsun/mds/mds-api/.settings/org.eclipse.jdt.core.prefs
    incubator/aries/sandbox/linsun/mds/mds-api/pom.xml   (with props)
    incubator/aries/sandbox/linsun/mds/mds-api/src/
    incubator/aries/sandbox/linsun/mds/mds-api/src/main/
    incubator/aries/sandbox/linsun/mds/mds-api/src/main/java/
    incubator/aries/sandbox/linsun/mds/mds-api/src/main/java/org/
    incubator/aries/sandbox/linsun/mds/mds-api/src/main/java/org/apache/
    incubator/aries/sandbox/linsun/mds/mds-api/src/main/java/org/apache/aries/
    incubator/aries/sandbox/linsun/mds/mds-api/src/main/java/org/apache/aries/mds/
    incubator/aries/sandbox/linsun/mds/mds-api/src/main/java/org/apache/aries/mds/MDSContainer.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-impl/
    incubator/aries/sandbox/linsun/mds/mds-impl/.classpath
    incubator/aries/sandbox/linsun/mds/mds-impl/.project
    incubator/aries/sandbox/linsun/mds/mds-impl/.settings/
    incubator/aries/sandbox/linsun/mds/mds-impl/.settings/org.eclipse.jdt.core.prefs
    incubator/aries/sandbox/linsun/mds/mds-impl/pom.xml   (with props)
    incubator/aries/sandbox/linsun/mds/mds-impl/src/
    incubator/aries/sandbox/linsun/mds/mds-impl/src/main/
    incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/
    incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/
    incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/
    incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/
    incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/
    incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/
    incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/Activator.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/EndpointHandler.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/JmsEndpointFactory.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MDSContainerImpl.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MdbUtil.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-itest/
    incubator/aries/sandbox/linsun/mds/mds-itest/.classpath
    incubator/aries/sandbox/linsun/mds/mds-itest/.project
    incubator/aries/sandbox/linsun/mds/mds-itest/.settings/
    incubator/aries/sandbox/linsun/mds/mds-itest/.settings/org.eclipse.jdt.core.prefs
    incubator/aries/sandbox/linsun/mds/mds-itest/pom.xml   (with props)
    incubator/aries/sandbox/linsun/mds/mds-itest/src/
    incubator/aries/sandbox/linsun/mds/mds-itest/src/test/
    incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/
    incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/org/
    incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/org/apache/
    incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/org/apache/aries/
    incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/org/apache/aries/mds/
    incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/org/apache/aries/mds/itests/
    incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/org/apache/aries/mds/itests/AbstractIntegrationTest.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/org/apache/aries/mds/itests/MessageDrivenTest.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-ra/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/.classpath
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/.project
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/.settings/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/.settings/org.eclipse.jdt.core.prefs
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/pom.xml   (with props)
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/java/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/java/org/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/java/org/apache/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/java/org/apache/aries/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/java/org/apache/aries/mds/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/java/org/apache/aries/mds/ra/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/java/org/apache/aries/mds/ra/URISupport.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/java/org/apache/aries/mds/ra/activemq/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/java/org/apache/aries/mds/ra/activemq/ActiveMQ5Factory.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/java/org/apache/aries/mds/ra/activemq/ActiveMQFactory.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/java/org/apache/aries/mds/ra/activemq/ActiveMQResourceAdapterFacade.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/resources/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/resources/META-INF/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/resources/META-INF/services/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/resources/META-INF/services/org/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/resources/META-INF/services/org/apache/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/resources/META-INF/services/org/apache/activemq/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/resources/META-INF/services/org/apache/activemq/broker/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/resources/META-INF/services/org/apache/activemq/broker/amq5factory
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/resources/OSGI-INF/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/resources/OSGI-INF/blueprint/
    incubator/aries/sandbox/linsun/mds/mds-ra-activemq/src/main/resources/OSGI-INF/blueprint/config.xml   (with props)
    incubator/aries/sandbox/linsun/mds/mds-ra/.classpath
    incubator/aries/sandbox/linsun/mds/mds-ra/.project
    incubator/aries/sandbox/linsun/mds/mds-ra/.settings/
    incubator/aries/sandbox/linsun/mds/mds-ra/.settings/org.eclipse.jdt.core.prefs
    incubator/aries/sandbox/linsun/mds/mds-ra/pom.xml   (with props)
    incubator/aries/sandbox/linsun/mds/mds-ra/src/
    incubator/aries/sandbox/linsun/mds/mds-ra/src/main/
    incubator/aries/sandbox/linsun/mds/mds-ra/src/main/java/
    incubator/aries/sandbox/linsun/mds/mds-ra/src/main/java/org/
    incubator/aries/sandbox/linsun/mds/mds-ra/src/main/java/org/apache/
    incubator/aries/sandbox/linsun/mds/mds-ra/src/main/java/org/apache/aries/
    incubator/aries/sandbox/linsun/mds/mds-ra/src/main/java/org/apache/aries/mds/
    incubator/aries/sandbox/linsun/mds/mds-ra/src/main/java/org/apache/aries/mds/ra/
    incubator/aries/sandbox/linsun/mds/mds-ra/src/main/java/org/apache/aries/mds/ra/MdbUtil.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-ra/src/main/java/org/apache/aries/mds/ra/ResourceAdapterFacade.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-ra/src/main/java/org/apache/aries/mds/ra/SimpleBootstrapContext.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-ra/src/main/java/org/apache/aries/mds/ra/SimpleWorkManager.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-sample/
    incubator/aries/sandbox/linsun/mds/mds-sample/.classpath
    incubator/aries/sandbox/linsun/mds/mds-sample/.project
    incubator/aries/sandbox/linsun/mds/mds-sample/.settings/
    incubator/aries/sandbox/linsun/mds/mds-sample/.settings/org.eclipse.jdt.core.prefs
    incubator/aries/sandbox/linsun/mds/mds-sample/pom.xml   (with props)
    incubator/aries/sandbox/linsun/mds/mds-sample/resources/
    incubator/aries/sandbox/linsun/mds/mds-sample/resources/OSGI-INF/
    incubator/aries/sandbox/linsun/mds/mds-sample/resources/OSGI-INF/blueprint/
    incubator/aries/sandbox/linsun/mds/mds-sample/resources/OSGI-INF/blueprint/config.xml   (with props)
    incubator/aries/sandbox/linsun/mds/mds-sample/src/
    incubator/aries/sandbox/linsun/mds/mds-sample/src/main/
    incubator/aries/sandbox/linsun/mds/mds-sample/src/main/java/
    incubator/aries/sandbox/linsun/mds/mds-sample/src/main/java/org/
    incubator/aries/sandbox/linsun/mds/mds-sample/src/main/java/org/apache/
    incubator/aries/sandbox/linsun/mds/mds-sample/src/main/java/org/apache/aries/
    incubator/aries/sandbox/linsun/mds/mds-sample/src/main/java/org/apache/aries/mds/
    incubator/aries/sandbox/linsun/mds/mds-sample/src/main/java/org/apache/aries/mds/sample/
    incubator/aries/sandbox/linsun/mds/mds-sample/src/main/java/org/apache/aries/mds/sample/MyMessageDrivenBean.java   (with props)
    incubator/aries/sandbox/linsun/mds/mds-sample/src/main/resources/
    incubator/aries/sandbox/linsun/mds/mds-sample/src/main/resources/OSGI-INF/
    incubator/aries/sandbox/linsun/mds/mds-sample/src/main/resources/OSGI-INF/blueprint/
    incubator/aries/sandbox/linsun/mds/mds-sample/src/main/resources/OSGI-INF/blueprint/config.xml   (with props)
    incubator/aries/sandbox/linsun/mds/pom.xml   (with props)

Added: incubator/aries/sandbox/linsun/mds/mds-api/.classpath
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-api/.classpath?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-api/.classpath (added)
+++ incubator/aries/sandbox/linsun/mds/mds-api/.classpath Fri Jun 11 20:09:30 2010
@@ -0,0 +1,12 @@
+<classpath>
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+  <classpathentry kind="src" path="target/maven-shared-archive-resources" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.8.1/junit-4.8.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/osgi/org.osgi.compendium/4.2.0/org.osgi.compendium-4.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/osgi/org.osgi.core/4.2.0/org.osgi.core-4.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/eclipse/osgi/3.5.0.v20090520/osgi-3.5.0.v20090520.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.5.11/slf4j-api-1.5.11.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-simple/1.5.11/slf4j-simple-1.5.11.jar"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file

Added: incubator/aries/sandbox/linsun/mds/mds-api/.project
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-api/.project?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-api/.project (added)
+++ incubator/aries/sandbox/linsun/mds/mds-api/.project Fri Jun 11 20:09:30 2010
@@ -0,0 +1,13 @@
+<projectDescription>
+  <name>org.apache.aries.mds.api</name>
+  <comment>This bundle contains the Message driven service API. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Added: incubator/aries/sandbox/linsun/mds/mds-api/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-api/.settings/org.eclipse.jdt.core.prefs?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-api/.settings/org.eclipse.jdt.core.prefs (added)
+++ incubator/aries/sandbox/linsun/mds/mds-api/.settings/org.eclipse.jdt.core.prefs Fri Jun 11 20:09:30 2010
@@ -0,0 +1,11 @@
+#Mon Jun 07 11:48:12 EDT 2010
+encoding//src/main/java=${project.build.sourceEncoding}
+org.eclipse.jdt.core.compiler.compliance=1.5
+encoding//src/main/resources=${project.build.sourceEncoding}
+encoding//src/test/resources=${project.build.sourceEncoding}
+encoding//src/test/java=${project.build.sourceEncoding}
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+encoding//src/test/filtered-resources=${project.build.sourceEncoding}
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+encoding//src/main/filtered-resources=${project.build.sourceEncoding}

Added: incubator/aries/sandbox/linsun/mds/mds-api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-api/pom.xml?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-api/pom.xml (added)
+++ incubator/aries/sandbox/linsun/mds/mds-api/pom.xml Fri Jun 11 20:09:30 2010
@@ -0,0 +1,71 @@
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.aries.mds</groupId>
+    <artifactId>blueprint</artifactId>
+    <version>0.2-incubating-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>org.apache.aries.mds.api</artifactId>
+  <packaging>bundle</packaging>
+  <name>Apache Aries Blueprint Message Driven Service API</name>
+  <description>
+      This bundle contains the Message driven service API 
+  </description>
+
+  <properties>
+      <aries.osgi.export.pkg>
+          org.apache.aries.mds
+      </aries.osgi.export.pkg>
+      <aries.osgi.import>
+        !org.apache.aries.mds.*,
+        *
+      </aries.osgi.import>
+  </properties>
+  
+  <dependencies>
+      <dependency>
+          <groupId>org.osgi</groupId>
+          <artifactId>org.osgi.core</artifactId>
+          <scope>provided</scope>
+      </dependency>
+      <dependency>
+          <groupId>org.osgi</groupId>
+          <artifactId>org.osgi.compendium</artifactId>
+          <scope>provided</scope>
+      </dependency>
+      <dependency>
+          <groupId>org.eclipse</groupId>
+          <artifactId>osgi</artifactId>
+          <scope>provided</scope>
+      </dependency>
+      <dependency>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-api</artifactId>
+      </dependency>
+      <dependency>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-simple</artifactId>
+          <scope>test</scope>
+      </dependency>
+  </dependencies>
+  
+</project>

Propchange: incubator/aries/sandbox/linsun/mds/mds-api/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/aries/sandbox/linsun/mds/mds-api/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/aries/sandbox/linsun/mds/mds-api/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/aries/sandbox/linsun/mds/mds-api/src/main/java/org/apache/aries/mds/MDSContainer.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-api/src/main/java/org/apache/aries/mds/MDSContainer.java?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-api/src/main/java/org/apache/aries/mds/MDSContainer.java (added)
+++ incubator/aries/sandbox/linsun/mds/mds-api/src/main/java/org/apache/aries/mds/MDSContainer.java Fri Jun 11 20:09:30 2010
@@ -0,0 +1,30 @@
+/*
+ * 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.aries.mds;
+
+public interface MDSContainer {
+    
+    public void init();
+    
+    public void activateMessageEndpoint();
+    
+    public void deActivateMessageEndpoint();
+    
+    public void destroy();
+}

Propchange: incubator/aries/sandbox/linsun/mds/mds-api/src/main/java/org/apache/aries/mds/MDSContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/aries/sandbox/linsun/mds/mds-api/src/main/java/org/apache/aries/mds/MDSContainer.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/aries/sandbox/linsun/mds/mds-api/src/main/java/org/apache/aries/mds/MDSContainer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/aries/sandbox/linsun/mds/mds-impl/.classpath
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-impl/.classpath?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-impl/.classpath (added)
+++ incubator/aries/sandbox/linsun/mds/mds-impl/.classpath Fri Jun 11 20:09:30 2010
@@ -0,0 +1,41 @@
+<classpath>
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+  <classpathentry kind="src" path="target/maven-shared-archive-resources" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/activemq/activeio-core/3.1.2/activeio-core-3.1.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/activemq/activemq-core/5.3.1/activemq-core-5.3.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/activemq/protobuf/activemq-protobuf/1.0/activemq-protobuf-1.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/activemq/activemq-ra/5.3.1/activemq-ra-5.3.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-net/commons-net/2.0/commons-net-2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/components/geronimo-connector/2.1.4/geronimo-connector-2.1.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-j2ee-connector_1.5_spec/2.0.0/geronimo-j2ee-connector_1.5_spec-2.0.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-j2ee-management_1.1_spec/1.0.1/geronimo-j2ee-management_1.1_spec-1.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-jms_1.1_spec/1.1.1/geronimo-jms_1.1_spec-1.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/components/geronimo-transaction/2.1.4/geronimo-transaction-2.1.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.8.1/junit-4.8.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/activemq/kahadb/5.3.2/kahadb-5.3.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.12/log4j-1.2.12.jar"/>
+  <classpathentry kind="var" path="M2_REPO/logkit/logkit/1.0.1/logkit-1.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/aries/mds/org.apache.aries.mds.api/0.2-incubating-SNAPSHOT/org.apache.aries.mds.api-0.2-incubating-SNAPSHOT.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/osgi/org.osgi.compendium/4.2.0/org.osgi.compendium-4.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/osgi/org.osgi.core/4.2.0/org.osgi.core-4.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/eclipse/osgi/3.5.0.v20090520/osgi-3.5.0.v20090520.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.5.11/slf4j-api-1.5.11.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-simple/1.5.11/slf4j-simple-1.5.11.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/springframework/spring-beans/2.5.6/spring-beans-2.5.6.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/springframework/spring-context/2.5.6/spring-context-2.5.6.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/springframework/spring-core/2.5.6/spring-core-2.5.6.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/springframework/osgi/spring-osgi-core/1.2.1/spring-osgi-core-1.2.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/springframework/osgi/spring-osgi-io/1.2.1/spring-osgi-io-1.2.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/xbean/xbean-asm-shaded/3.7/xbean-asm-shaded-3.7.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/xbean/xbean-finder-shaded/3.7/xbean-finder-shaded-3.7.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/xbean/xbean-naming/3.7/xbean-naming-3.7.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/xbean/xbean-reflect/3.7/xbean-reflect-3.7.jar"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file

Added: incubator/aries/sandbox/linsun/mds/mds-impl/.project
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-impl/.project?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-impl/.project (added)
+++ incubator/aries/sandbox/linsun/mds/mds-impl/.project Fri Jun 11 20:09:30 2010
@@ -0,0 +1,13 @@
+<projectDescription>
+  <name>org.apache.aries.mds.impl</name>
+  <comment>This bundle contains the Message driven Service Implementation using ActiveMQ as the provider of JMS broker and resource adapter. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Added: incubator/aries/sandbox/linsun/mds/mds-impl/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-impl/.settings/org.eclipse.jdt.core.prefs?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-impl/.settings/org.eclipse.jdt.core.prefs (added)
+++ incubator/aries/sandbox/linsun/mds/mds-impl/.settings/org.eclipse.jdt.core.prefs Fri Jun 11 20:09:30 2010
@@ -0,0 +1,11 @@
+#Wed May 26 10:26:25 EDT 2010
+encoding//src/main/java=${project.build.sourceEncoding}
+org.eclipse.jdt.core.compiler.compliance=1.5
+encoding//src/main/resources=${project.build.sourceEncoding}
+encoding//src/test/resources=${project.build.sourceEncoding}
+encoding//src/test/java=${project.build.sourceEncoding}
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+encoding//src/test/filtered-resources=${project.build.sourceEncoding}
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+encoding//src/main/filtered-resources=${project.build.sourceEncoding}

Added: 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=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-impl/pom.xml (added)
+++ incubator/aries/sandbox/linsun/mds/mds-impl/pom.xml Fri Jun 11 20:09:30 2010
@@ -0,0 +1,135 @@
+
+	<!--
+		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.
+	-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.aries.mds</groupId>
+		<artifactId>blueprint</artifactId>
+		<version>0.2-incubating-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>org.apache.aries.mds.impl</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Aries Message Driven Service Implementation </name>
+	<description>
+      This bundle contains the Message driven Service Implementation using ActiveMQ as the provider of JMS broker and resource adapter
+    </description>
+
+	<properties>
+		<aries.osgi.activator>
+			org.apache.aries.mds.impl.Activator
+      </aries.osgi.activator>
+		<aries.osgi.export.pkg>
+			org.apache.aries.mds.impl
+      </aries.osgi.export.pkg>
+		<aries.osgi.import>
+			!org.apache.aries.mds.impl.*,
+			org.apache.activemq.ra,
+			*
+      </aries.osgi.import>
+	</properties>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.osgi</groupId>
+			<artifactId>org.osgi.core</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.osgi</groupId>
+			<artifactId>org.osgi.compendium</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse</groupId>
+			<artifactId>osgi</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-api</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-simple</artifactId>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.aries.mds</groupId>
+			<artifactId>org.apache.aries.mds.api</artifactId>
+		</dependency>
+		
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-jms_1.1_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+			<scope>provided</scope>
+		</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>
+
+		<dependency>
+			<groupId>org.apache.xbean</groupId>
+			<artifactId>xbean-asm-shaded</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.xbean</groupId>
+			<artifactId>xbean-finder-shaded</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.xbean</groupId>
+			<artifactId>xbean-reflect</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.xbean</groupId>
+			<artifactId>xbean-naming</artifactId>
+		</dependency>
+
+	</dependencies>
+
+	<build>
+		<resources>
+			<resource>
+				<directory>src/main/resources</directory>
+				<filtering>true</filtering>
+			</resource>
+		</resources>
+	</build>
+</project>

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/Activator.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/Activator.java?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/Activator.java (added)
+++ incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/Activator.java Fri Jun 11 20:09:30 2010
@@ -0,0 +1,153 @@
+/*
+ * 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.aries.mds.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.resource.spi.ResourceAdapter;
+
+import org.apache.aries.mds.MDSContainer;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+import org.osgi.util.tracker.ServiceTrackerCustomizer;
+
+public class Activator implements BundleActivator{
+
+    public static final String DESTINATION = "destination";
+    public static final String DESTINATION_TYPE = "destinationType";
+    private ServiceTracker st;
+    private static BundleContext context;
+    public static final long DEFAULT_TIMEOUT = 30000;
+    private List<ServiceTracker> srs;
+
+    
+    public void start(BundleContext context) throws Exception {
+        System.out.println("aries-mds-impl starts");
+        this.context = context;
+        srs = new ArrayList<ServiceTracker>();
+     
+        st = createServiceTracker();    
+        st.open();
+    }
+
+    private ServiceTracker createServiceTracker() throws InvalidSyntaxException {
+        StringBuilder filterString = new StringBuilder();
+        filterString.append("(" + Constants.OBJECTCLASS + "=javax.jms.MessageListener)");
+        Filter filter = context.createFilter(filterString.toString());
+        return new ServiceTracker(context, filter, new MessageListenerServiceTrackerCustomizer());       
+    }
+    
+    public void stop(BundleContext context) throws Exception {
+        System.out.println("aries-mds-impl stops");
+
+        if (st != null) {
+            st.close();
+        }
+        
+        for (ServiceTracker st : srs) {
+            if (st != null) {
+                st.close();
+            }  
+        }
+    }
+    
+    private class MessageListenerServiceTrackerCustomizer implements
+    ServiceTrackerCustomizer {
+        
+        private ResourceAdapter ra;
+        
+        public MessageListenerServiceTrackerCustomizer() {
+            // TODO: current code uses the first ResourceAdapter retrieved from service registry
+            // this needs to be enhanced 
+            ra = getOsgiService(ResourceAdapter.class);
+        }
+
+        public Object addingService(ServiceReference reference) {
+            MDSContainer mdsContainer = new MDSContainerImpl(ra, reference, context);
+            mdsContainer.init();
+            mdsContainer.activateMessageEndpoint();
+            return mdsContainer;
+        }
+        
+        public void modifiedService(ServiceReference reference, Object service) {
+            // TODO Auto-generated method stub
+        
+        }
+        
+        public void removedService(ServiceReference reference, Object service) {
+            if (service instanceof MDSContainer) {
+                ((MDSContainer) service).destroy();
+            }
+        }
+        
+
+    }
+    
+    protected <T> T getOsgiService(Class<T> type, long timeout) {
+        return getOsgiService(type, null, timeout);
+    }
+
+    protected <T> T getOsgiService(Class<T> type) {
+        return getOsgiService(type, null, DEFAULT_TIMEOUT);
+    }
+    
+    protected <T> T getOsgiService(BundleContext bc, Class<T> type, String filter, long timeout) {
+        ServiceTracker tracker = null;
+        try {
+            String flt;
+            if (filter != null) {
+                if (filter.startsWith("(")) {
+                    flt = "(&(" + Constants.OBJECTCLASS + "=" + type.getName() + ")" + filter + ")";
+                } else {
+                    flt = "(&(" + Constants.OBJECTCLASS + "=" + type.getName() + ")(" + filter + "))";
+                }
+            } else {
+                flt = "(" + Constants.OBJECTCLASS + "=" + type.getName() + ")";
+            }
+            Filter osgiFilter = FrameworkUtil.createFilter(flt);
+            tracker = new ServiceTracker(bc == null ? this.context : bc, osgiFilter, null);
+            tracker.open();
+            
+            // add tracker to the list of trackers we close at tear down
+            srs.add(tracker);
+            Object svc = type.cast(tracker.waitForService(timeout));
+            if (svc == null) {
+                throw new RuntimeException("Gave up waiting for service " + flt);
+            }
+            return type.cast(svc);
+        } catch (InvalidSyntaxException e) {
+            throw new IllegalArgumentException("Invalid filter", e);
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
+    }
+    
+    protected <T> T getOsgiService(Class<T> type, String filter, long timeout) {
+        return getOsgiService(null, type, filter, timeout);
+    }
+
+
+}

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/Activator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/Activator.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/Activator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/EndpointHandler.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/EndpointHandler.java?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/EndpointHandler.java (added)
+++ incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/EndpointHandler.java Fri Jun 11 20:09:30 2010
@@ -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.aries.mds.impl;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.endpoint.MessageEndpoint;
+import javax.transaction.xa.XAResource;
+
+public class EndpointHandler implements InvocationHandler, MessageEndpoint {
+
+    private XAResource xaResource;
+    private Object instance;
+    
+    public EndpointHandler(Object instance, XAResource xaResource) {
+        this.instance = instance;
+        this.xaResource = xaResource;
+    }
+    public Object invoke(Object proxy, Method method, Object[] args)
+            throws Throwable {
+
+        String methodName = method.getName();
+        Class<?>[] parameterTypes = method.getParameterTypes();
+
+        if (method.getDeclaringClass() == Object.class) {
+            if ("toString".equals(methodName) && parameterTypes.length == 0) {
+                return toString();
+            } else if ("equals".equals(methodName) && parameterTypes.length == 1) {
+                return equals(args[0]);
+            } else if ("hashCode".equals(methodName) && parameterTypes.length == 0) {
+                return hashCode();
+            } else {
+                throw new UnsupportedOperationException("Unkown method: " + method);
+            }
+        }
+
+        if ("beforeDelivery".equals(methodName) && Arrays.deepEquals(new Class[] {Method.class}, parameterTypes)) {
+            beforeDelivery((Method) args[0]);
+            return null;
+        } else if ("afterDelivery".equals(methodName) && parameterTypes.length == 0) {
+            afterDelivery();
+            return null;
+        } else if ("release".equals(methodName) && parameterTypes.length == 0) {
+            release();
+            return null;
+        } else {
+            Object value = deliverMessage(method, args);
+            return value;
+        }
+    }
+
+    private Object deliverMessage(Method method, Object[] args) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
+        return method.invoke(this.instance, args);
+    }
+    
+    public void afterDelivery() throws ResourceException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void beforeDelivery(Method arg0) throws NoSuchMethodException,
+            ResourceException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void release() {
+        // TODO Auto-generated method stub
+        
+    }
+
+}

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/EndpointHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/EndpointHandler.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/EndpointHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/JmsEndpointFactory.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/JmsEndpointFactory.java?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/JmsEndpointFactory.java (added)
+++ incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/JmsEndpointFactory.java Fri Jun 11 20:09:30 2010
@@ -0,0 +1,63 @@
+/*
+ * 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.aries.mds.impl;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import javax.jms.MessageListener;
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.UnavailableException;
+import javax.resource.spi.endpoint.MessageEndpoint;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import javax.transaction.xa.XAResource;
+
+
+public class JmsEndpointFactory implements MessageEndpointFactory {
+
+
+    private final XAResource xaResource;
+    private final Object instance;
+    private final Class[] interfaces;
+    private final ActivationSpec activationSpec;
+    
+    public JmsEndpointFactory(Object instance, XAResource xaResource, ActivationSpec activationSpec) {
+        this.instance = instance;
+        this.xaResource = xaResource;
+        interfaces = new Class[]{MessageListener.class, MessageEndpoint.class};
+        this.activationSpec = activationSpec;
+    }
+    
+    public ActivationSpec getActivationSpec() {
+        return activationSpec;
+    }
+    
+    public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException {
+        EndpointHandler endpointHandler = new EndpointHandler(instance, xaResource);
+        //ClassLoader cl = instance.getClass().getClassLoader();
+        ClassLoader cl = JmsEndpointFactory.class.getClassLoader();
+        MessageEndpoint messageEndpoint = (MessageEndpoint) Proxy.newProxyInstance(cl, interfaces, endpointHandler);
+        return messageEndpoint;
+    }
+
+    public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
+        return false;
+    }
+        
+}

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/JmsEndpointFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/JmsEndpointFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/JmsEndpointFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MDSContainerImpl.java (added)
+++ incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MDSContainerImpl.java Fri Jun 11 20:09:30 2010
@@ -0,0 +1,130 @@
+/*
+ * 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.aries.mds.impl;
+
+import javax.jms.MessageListener;
+import javax.resource.ResourceException;
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.InvalidPropertyException;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+
+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 {
+
+    private final ResourceAdapter ra;
+    private final ServiceReference sr;
+    private final BundleContext bc;
+    private ActivationSpec activationSpec;
+    private MessageEndpointFactory endpointFactory;
+    
+    public MDSContainerImpl(ResourceAdapter ra, ServiceReference sr, BundleContext bc) {
+        this.ra = ra;
+        this.sr = sr;
+        this.bc = bc;
+    }
+    
+    public void init() {
+        if (ra instanceof ActiveMQResourceAdapter) {
+            /*activationSpec = new ActiveMQActivationSpec();
+            activationSpec.setDestinationType(destinationType);
+            activationSpec.setDestination(destination);*/
+            activationSpec = createActivationSpec(sr, ActiveMQActivationSpec.class);
+        }
+        // TODO add other resource adapter impl and activation spec impl
+
+    }
+    
+    public void activateMessageEndpoint() {
+        
+        // set the resource adapter into the activation spec
+        try {
+            activationSpec.setResourceAdapter(ra);
+        } catch (ResourceException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        
+        MessageListener ml = (MessageListener)bc.getService(sr); 
+        // create the message endpoint
+        endpointFactory = new JmsEndpointFactory(ml, null, activationSpec);
+
+        // activate the endpoint
+        try {
+            ra.endpointActivation(endpointFactory, activationSpec);
+        } catch (ResourceException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+       
+    }
+    
+    public void deActivateMessageEndpoint() {
+        ra.endpointDeactivation(endpointFactory, activationSpec);
+        
+    }
+    
+    public void destroy() {
+        deActivateMessageEndpoint();
+        activationSpec = null;
+        endpointFactory = null;
+        
+    }
+    
+    /**
+     * create the activation spec based on the class name and the properties for the service reference
+     * @param reference             service reference for the message driven service
+     * @param activationSpecClass   the activation spec class full name
+     */
+    private ActivationSpec createActivationSpec(ServiceReference reference,
+            Class activationSpecClass) {
+        ObjectRecipe objectRecipe = new ObjectRecipe(activationSpecClass);
+        objectRecipe.allow(Option.IGNORE_MISSING_PROPERTIES);
+        objectRecipe.disallow(Option.FIELD_INJECTION);
+        
+        String[] propKeys = reference.getPropertyKeys();
+        
+        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");
+        }
+        // validate the activation spec
+        try {
+            activationSpec.validate();
+        } catch (InvalidPropertyException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return activationSpec;
+        
+    }
+}

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MDSContainerImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MDSContainerImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MDSContainerImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MdbUtil.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MdbUtil.java?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MdbUtil.java (added)
+++ incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MdbUtil.java Fri Jun 11 20:09:30 2010
@@ -0,0 +1,79 @@
+/*
+ * 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.aries.mds.impl;
+
+import javax.jms.MessageProducer;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.Session;
+import javax.jms.Connection;
+import java.lang.reflect.Method;
+
+public class MdbUtil {
+    public static String getSignature(Method method){
+        StringBuilder builder = new StringBuilder();
+        builder.append(method.getName()).append("(");
+        boolean first = true;
+        for (Class<?> type : method.getParameterTypes()) {
+            if (!first) {
+                builder.append(",");
+            }
+            builder.append(type);
+            first = false;
+        }
+        builder.append(")");
+        return builder.toString();
+    }
+
+    public static void close(MessageProducer closeable) {
+        if (closeable != null) {
+            try {
+                closeable.close();
+            } catch (JMSException e) {
+            }
+        }
+    }
+
+    public static void close(MessageConsumer closeable) {
+        if (closeable != null) {
+            try {
+                closeable.close();
+            } catch (JMSException e) {
+            }
+        }
+    }
+
+    public static void close(Session closeable) {
+        if (closeable != null) {
+            try {
+                closeable.close();
+            } catch (JMSException e) {
+            }
+        }
+    }
+
+    public static void close(Connection closeable) {
+        if (closeable != null) {
+            try {
+                closeable.close();
+            } catch (JMSException e) {
+            }
+        }
+    }
+}

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MdbUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MdbUtil.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/aries/sandbox/linsun/mds/mds-impl/src/main/java/org/apache/aries/mds/impl/MdbUtil.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/aries/sandbox/linsun/mds/mds-itest/.classpath
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-itest/.classpath?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-itest/.classpath (added)
+++ incubator/aries/sandbox/linsun/mds/mds-itest/.classpath Fri Jun 11 20:09:30 2010
@@ -0,0 +1,66 @@
+<classpath>
+  <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
+  <classpathentry kind="src" path="target/maven-shared-archive-resources" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/activemq/activeio-core/3.1.2/activeio-core-3.1.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/activemq/activemq-core/5.3.1/activemq-core-5.3.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/activemq/protobuf/activemq-protobuf/1.0/activemq-protobuf-1.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/activemq/activemq-ra/5.3.1/activemq-ra-5.3.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/asm/asm-all/3.2/asm-all-3.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-discovery/commons-discovery/0.4/commons-discovery-0.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-net/commons-net/2.0/commons-net-2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-annotation_1.0_spec/1.1.1/geronimo-annotation_1.0_spec-1.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/components/geronimo-connector/2.1.4/geronimo-connector-2.1.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-j2ee-connector_1.5_spec/2.0.0/geronimo-j2ee-connector_1.5_spec-2.0.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-j2ee-management_1.1_spec/1.0.1/geronimo-j2ee-management_1.1_spec-1.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-jms_1.1_spec/1.1.1/geronimo-jms_1.1_spec-1.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/components/geronimo-transaction/2.1.4/geronimo-transaction-2.1.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/felix/javax.servlet/1.0.0/javax.servlet-1.0.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.8.1/junit-4.8.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/activemq/kahadb/5.3.2/kahadb-5.3.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/base/ops4j-base-io/1.2.1/ops4j-base-io-1.2.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/base/ops4j-base-lang/1.2.1/ops4j-base-lang-1.2.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/base/ops4j-base-monitors/1.2.1/ops4j-base-monitors-1.2.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/base/ops4j-base-net/1.2.1/ops4j-base-net-1.2.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/base/ops4j-base-store/1.2.1/ops4j-base-store-1.2.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/aries/blueprint/org.apache.aries.blueprint/0.2-incubating-SNAPSHOT/org.apache.aries.blueprint-0.2-incubating-SNAPSHOT.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/aries/blueprint/org.apache.aries.blueprint.mdc.impl/0.2-incubating-SNAPSHOT/org.apache.aries.blueprint.mdc.impl-0.2-incubating-SNAPSHOT.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/aries/blueprint/org.apache.aries.blueprint.sample.mdc/0.2-incubating-SNAPSHOT/org.apache.aries.blueprint.sample.mdc-0.2-incubating-SNAPSHOT.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/aries/org.apache.aries.util/0.2-incubating-SNAPSHOT/org.apache.aries.util-0.2-incubating-SNAPSHOT.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.apache.felix.configadmin/1.2.4/org.apache.felix.configadmin-1.2.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/servicemix/bundles/org.apache.servicemix.bundles.cglib/2.1_3_4/org.apache.servicemix.bundles.cglib-2.1_3_4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.compendium/1.0.0/org.osgi.compendium-1.0.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/osgi/org.osgi.compendium/4.2.0/org.osgi.compendium-4.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.core/1.0.0/org.osgi.core-1.0.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/osgi/org.osgi.core/4.2.0/org.osgi.core-4.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/felix/org.osgi.foundation/1.0.0/org.osgi.foundation-1.0.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/eclipse/osgi/3.5.0.v20090520/osgi-3.5.0.v20090520.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/exam/pax-exam/1.2.0/pax-exam-1.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/exam/pax-exam-container-default/1.2.0/pax-exam-container-default-1.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/exam/pax-exam-container-rbc/1.2.0/pax-exam-container-rbc-1.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/exam/pax-exam-container-rbc-client/1.2.0/pax-exam-container-rbc-client-1.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/exam/pax-exam-junit/1.2.0/pax-exam-junit-1.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/exam/pax-exam-junit-extender/1.2.0/pax-exam-junit-extender-1.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/exam/pax-exam-junit-extender-impl/1.2.0/pax-exam-junit-extender-impl-1.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/exam/pax-exam-runtime/1.2.0/pax-exam-runtime-1.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/exam/pax-exam-spi/1.2.0/pax-exam-spi-1.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/logging/pax-logging-api/1.4/pax-logging-api-1.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/logging/pax-logging-service/1.4/pax-logging-service-1.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/runner/pax-runner-no-jcl/1.4.0/pax-runner-no-jcl-1.4.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/swissbox/pax-swissbox-core/1.2.0/pax-swissbox-core-1.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/swissbox/pax-swissbox-extender/1.2.0/pax-swissbox-extender-1.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/swissbox/pax-swissbox-lifecycle/1.2.0/pax-swissbox-lifecycle-1.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/swissbox/pax-swissbox-optional-jcl/1.2.0/pax-swissbox-optional-jcl-1.2.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/ops4j/pax/url/pax-url-mvn/1.1.2/pax-url-mvn-1.1.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.5.11/slf4j-api-1.5.11.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/springframework/spring-beans/2.5.6/spring-beans-2.5.6.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/springframework/spring-context/2.5.6/spring-context-2.5.6.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/springframework/spring-core/2.5.6/spring-core-2.5.6.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/springframework/osgi/spring-osgi-core/1.2.1/spring-osgi-core-1.2.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/springframework/osgi/spring-osgi-io/1.2.1/spring-osgi-io-1.2.1.jar"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file

Added: incubator/aries/sandbox/linsun/mds/mds-itest/.project
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-itest/.project?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-itest/.project (added)
+++ incubator/aries/sandbox/linsun/mds/mds-itest/.project Fri Jun 11 20:09:30 2010
@@ -0,0 +1,14 @@
+<projectDescription>
+  <name>org.apache.aries.mds.itests</name>
+  <comment>Integration tests using the standalone mds bundle for the implementation
+        and mds-sample as a blueprint application to be tested. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Added: incubator/aries/sandbox/linsun/mds/mds-itest/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-itest/.settings/org.eclipse.jdt.core.prefs?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-itest/.settings/org.eclipse.jdt.core.prefs (added)
+++ incubator/aries/sandbox/linsun/mds/mds-itest/.settings/org.eclipse.jdt.core.prefs Fri Jun 11 20:09:30 2010
@@ -0,0 +1,11 @@
+#Tue Jun 01 16:51:43 EDT 2010
+encoding//src/main/java=${project.build.sourceEncoding}
+org.eclipse.jdt.core.compiler.compliance=1.5
+encoding//src/main/resources=${project.build.sourceEncoding}
+encoding//src/test/resources=${project.build.sourceEncoding}
+encoding//src/test/java=${project.build.sourceEncoding}
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+encoding//src/test/filtered-resources=${project.build.sourceEncoding}
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+encoding//src/main/filtered-resources=${project.build.sourceEncoding}

Added: incubator/aries/sandbox/linsun/mds/mds-itest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-itest/pom.xml?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-itest/pom.xml (added)
+++ incubator/aries/sandbox/linsun/mds/mds-itest/pom.xml Fri Jun 11 20:09:30 2010
@@ -0,0 +1,270 @@
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.aries.mds</groupId>
+        <artifactId>blueprint</artifactId>
+        <version>0.2-incubating-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>org.apache.aries.mds.itests</artifactId>
+    <name>Apache Aries Blueprint Message Driven Service iTests</name>
+    <description>
+        Integration tests using the standalone mds bundle for the implementation
+        and mds-sample as a blueprint application to be tested.
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse</groupId>
+            <artifactId>osgi</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>org.apache.aries.blueprint</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries</groupId>
+            <artifactId>org.apache.aries.util</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.mds</groupId>
+            <artifactId>org.apache.aries.mds.api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.mds</groupId>
+            <artifactId>org.apache.aries.mds.impl</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.mds</groupId>
+            <artifactId>org.apache.aries.mds.ra</artifactId>
+            <scope>test</scope>
+        </dependency>    
+        <dependency>
+            <groupId>org.apache.aries.mds</groupId>
+            <artifactId>org.apache.aries.mds.ra.activemq</artifactId>
+            <scope>test</scope>
+        </dependency>    
+        <dependency>
+            <groupId>org.apache.aries.mds</groupId>
+            <artifactId>org.apache.aries.mds.sample</artifactId>
+            <scope>test</scope>
+        </dependency>        
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-default</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit-extender-impl</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.runner</groupId>
+            <artifactId>pax-runner-no-jcl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.configadmin</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-service</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-mvn</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm-all</artifactId>
+            <scope>test</scope>
+        </dependency> 
+      <dependency>
+          <groupId>org.apache.geronimo.specs</groupId>
+          <artifactId>geronimo-jms_1.1_spec</artifactId>
+      </dependency>
+      <dependency>
+          <groupId>org.apache.geronimo.specs</groupId>
+          <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-jta_1.1_spec</artifactId>
+      </dependency>
+      
+      <!-- used by activemq core -->
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-annotation_1.0_spec</artifactId>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.activemq</groupId>
+        <artifactId>kahadb</artifactId>
+      </dependency>   
+      <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
+      </dependency>
+      <!-- end of used by activemq core -->  
+      <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>
+
+	<dependency>
+		<groupId>org.apache.xbean</groupId>
+		<artifactId>xbean-asm-shaded</artifactId>
+	</dependency>
+	<dependency>
+		<groupId>org.apache.xbean</groupId>
+		<artifactId>xbean-finder-shaded</artifactId>
+	</dependency>
+	<dependency>
+		<groupId>org.apache.xbean</groupId>
+		<artifactId>xbean-reflect</artifactId>
+	</dependency>
+	<dependency>
+		<groupId>org.apache.xbean</groupId>
+		<artifactId>xbean-naming</artifactId>
+	</dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <forkMode>pertest</forkMode>
+                    <excludes>
+                        <exclude>**/*$*</exclude>
+                        <exclude>**/Abstract*.java</exclude>
+                    </excludes>
+                    <includes>
+                        <include>**/Test*.java</include>
+                        <include>**/*Test.java</include>
+                    </includes>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>maven-paxexam-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>generate-config</id>
+                        <goals>
+                            <goal>generate-depends-file</goal>
+                        </goals>
+                        <configuration>
+                            <outputFile>${project.build.directory}/test-classes/META-INF/maven/dependencies.properties</outputFile>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>ci-build-profile</id>
+            <activation>
+                <property>
+                    <name>maven.repo.local</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <!--
+                                when the local repo location has been specified, we need to pass
+                                on this information to PAX mvn url
+                            -->
+                            <argLine>-Dorg.ops4j.pax.url.mvn.localRepository=${maven.repo.local}</argLine>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>

Propchange: incubator/aries/sandbox/linsun/mds/mds-itest/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/aries/sandbox/linsun/mds/mds-itest/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/aries/sandbox/linsun/mds/mds-itest/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/org/apache/aries/mds/itests/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/org/apache/aries/mds/itests/AbstractIntegrationTest.java?rev=953860&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/org/apache/aries/mds/itests/AbstractIntegrationTest.java (added)
+++ incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/org/apache/aries/mds/itests/AbstractIntegrationTest.java Fri Jun 11 20:09:30 2010
@@ -0,0 +1,222 @@
+/*
+ * 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.aries.mds.itests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.*;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Currency;
+import java.util.List;
+import java.util.Properties;
+
+import org.junit.After;
+import org.junit.Before;
+import org.ops4j.pax.exam.CoreOptions;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
+import org.ops4j.pax.exam.Inject;
+import org.ops4j.pax.exam.Option;
+import static org.ops4j.pax.exam.OptionUtils.combine;
+import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.service.blueprint.container.BlueprintContainer;
+import org.osgi.util.tracker.ServiceTracker;
+
+public abstract class AbstractIntegrationTest {
+
+    public static final long DEFAULT_TIMEOUT = 30000;
+
+    private List<ServiceTracker> srs;
+
+    @Before
+    public void setUp() throws Exception{
+        srs = new ArrayList<ServiceTracker>();
+    }
+    
+    @After
+    public void tearDown() throws Exception{
+        for (ServiceTracker st : srs) {
+            if (st != null) {
+                st.close();
+            }  
+        }
+    }
+    
+    @Inject
+    protected BundleContext bundleContext;
+
+    protected BlueprintContainer getBlueprintContainerForBundle(String symbolicName) throws Exception {
+        return getBlueprintContainerForBundle(symbolicName, DEFAULT_TIMEOUT);
+    }
+
+    protected BlueprintContainer getBlueprintContainerForBundle(String symbolicName, long timeout) throws Exception {
+        return getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=" + symbolicName + ")", timeout);
+    }
+    
+    protected BlueprintContainer getBlueprintContainerForBundle(BundleContext bc, String symbolicName, long timeout) throws Exception {
+        return getOsgiService(bc, BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=" + symbolicName + ")", timeout);
+    }
+
+    protected <T> T getOsgiService(Class<T> type, long timeout) {
+        return getOsgiService(type, null, timeout);
+    }
+
+    protected <T> T getOsgiService(Class<T> type) {
+        return getOsgiService(type, null, DEFAULT_TIMEOUT);
+    }
+    
+    protected <T> T getOsgiService(BundleContext bc, Class<T> type, String filter, long timeout) {
+        ServiceTracker tracker = null;
+        try {
+            String flt;
+            if (filter != null) {
+                if (filter.startsWith("(")) {
+                    flt = "(&(" + Constants.OBJECTCLASS + "=" + type.getName() + ")" + filter + ")";
+                } else {
+                    flt = "(&(" + Constants.OBJECTCLASS + "=" + type.getName() + ")(" + filter + "))";
+                }
+            } else {
+                flt = "(" + Constants.OBJECTCLASS + "=" + type.getName() + ")";
+            }
+            Filter osgiFilter = FrameworkUtil.createFilter(flt);
+            tracker = new ServiceTracker(bc == null ? bundleContext : bc, osgiFilter, null);
+            tracker.open();
+            
+            // add tracker to the list of trackers we close at tear down
+            srs.add(tracker);
+            Object svc = type.cast(tracker.waitForService(timeout));
+            if (svc == null) {
+                throw new RuntimeException("Gave up waiting for service " + flt);
+            }
+            return type.cast(svc);
+        } catch (InvalidSyntaxException e) {
+            throw new IllegalArgumentException("Invalid filter", e);
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
+    }
+    
+    protected <T> T getOsgiService(Class<T> type, String filter, long timeout) {
+        return getOsgiService(null, type, filter, timeout);
+    }
+
+    protected Bundle installBundle(String groupId, String artifactId) throws Exception {
+        MavenArtifactProvisionOption mvnUrl = mavenBundle(groupId, artifactId);
+        return bundleContext.installBundle(mvnUrl.getURL());
+    }
+
+    protected Bundle getInstalledBundle(String symbolicName) {
+        for (Bundle b : bundleContext.getBundles()) {
+            if (b.getSymbolicName().equals(symbolicName)) {
+                return b;
+            }
+        }
+        return null;
+    }
+
+    public static MavenArtifactProvisionOption mavenBundle(String groupId, String artifactId) {
+        return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).versionAsInProject();
+    }
+    
+    public static MavenArtifactProvisionOption mavenBundleInTest(String groupId, String artifactId) {
+        return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).version(getArtifactVersion(groupId, artifactId));
+    }
+
+    //TODO getArtifactVersion and getFileFromClasspath are borrowed and modified from pax-exam.  They should be moved back ASAP.
+    public static String getArtifactVersion( final String groupId,
+                                             final String artifactId )
+    {
+        final Properties dependencies = new Properties();
+        try
+        {
+            InputStream in = getFileFromClasspath("META-INF/maven/dependencies.properties");
+            try {
+                dependencies.load(in);
+            } finally {
+                in.close();
+            }
+            final String version = dependencies.getProperty( groupId + "/" + artifactId + "/version" );
+            if( version == null )
+            {
+                throw new RuntimeException(
+                    "Could not resolve version. Do you have a dependency for " + groupId + "/" + artifactId
+                    + " in your maven project?"
+                );
+            }
+            return version;
+        }
+        catch( IOException e )
+        {
+            // TODO throw a better exception
+            throw new RuntimeException(
+                "Could not resolve version. Did you configured the plugin in your maven project?"
+                + "Or maybe you did not run the maven build and you are using an IDE?"
+            );
+        }
+    }
+
+    private static InputStream getFileFromClasspath( final String filePath )
+        throws FileNotFoundException
+    {
+        try
+        {
+            URL fileURL = AbstractIntegrationTest.class.getClassLoader().getResource( filePath );
+            if( fileURL == null )
+            {
+                throw new FileNotFoundException( "File [" + filePath + "] could not be found in classpath" );
+            }
+            return fileURL.openStream();
+        }
+        catch (IOException e)
+        {
+            throw new FileNotFoundException( "File [" + filePath + "] could not be found: " + e.getMessage() );
+        }
+    }
+
+
+    protected static Option[] updateOptions(Option[] options) {
+        // We need to add pax-exam-junit here when running with the ibm
+        // jdk to avoid the following exception during the test run:
+        // ClassNotFoundException: org.ops4j.pax.exam.junit.Configuration
+        if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
+            Option[] ibmOptions = options(
+                wrappedBundle(mavenBundle("org.ops4j.pax.exam", "pax-exam-junit"))
+            );
+            options = combine(ibmOptions, options);
+        }
+
+        return options;
+    }
+    
+    
+}

Propchange: incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/org/apache/aries/mds/itests/AbstractIntegrationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/org/apache/aries/mds/itests/AbstractIntegrationTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/aries/sandbox/linsun/mds/mds-itest/src/test/java/org/apache/aries/mds/itests/AbstractIntegrationTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain