geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: rev 47599 - in geronimo/trunk/itests/naming/client: . src/client/META-INF src/java/org/apache/geronimo/itest/naming/client src/plan
Date Thu, 30 Sep 2004 17:31:27 GMT
Author: djencks
Date: Thu Sep 30 10:31:27 2004
New Revision: 47599

Modified:
   geronimo/trunk/itests/naming/client/project.xml
   geronimo/trunk/itests/naming/client/src/client/META-INF/application-client.xml
   geronimo/trunk/itests/naming/client/src/java/org/apache/geronimo/itest/naming/client/App.java
   geronimo/trunk/itests/naming/client/src/plan/plan1.xml
Log:
Add resource-env-ref example with activemq broker deployed on client

Modified: geronimo/trunk/itests/naming/client/project.xml
==============================================================================
--- geronimo/trunk/itests/naming/client/project.xml	(original)
+++ geronimo/trunk/itests/naming/client/project.xml	Thu Sep 30 10:31:27 2004
@@ -48,19 +48,26 @@
            <artifactId>geronimo-kernel</artifactId>
            <version>${pom.currentVersion}</version>
        </dependency>
+
       <dependency>
           <groupId>mx4j</groupId>
           <artifactId>mx4j</artifactId>
           <version>&mx4j-version;</version>
       </dependency>
- 
+
       <dependency>
-           <groupId>geronimo</groupId>
-           <artifactId>geronimo-naming</artifactId>
-           <version>${pom.currentVersion}</version>
-       </dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-naming</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
 
       <dependency>
+            <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-jms</artifactId>
+            <version>&geronimo-spec-jms-version;</version>
+        </dependency>
+
+        <dependency>
            <groupId>axion</groupId>
            <artifactId>axion</artifactId>
            <version>&axion-version;</version>
@@ -108,6 +115,16 @@
               <repository>true</repository>
           </properties>
           <url>http://jakarta.apache.org/regexp</url>
+      </dependency>
+
+      <dependency>
+           <groupId>activemq</groupId>
+           <artifactId>activemq</artifactId>
+           <version>&activemq-version;</version>
+           <type>rar</type>
+           <properties>
+               <repository>true</repository>
+           </properties>
       </dependency>
 
   </dependencies>

Modified: geronimo/trunk/itests/naming/client/src/client/META-INF/application-client.xml
==============================================================================
--- geronimo/trunk/itests/naming/client/src/client/META-INF/application-client.xml	(original)
+++ geronimo/trunk/itests/naming/client/src/client/META-INF/application-client.xml	Thu Sep
30 10:31:27 2004
@@ -11,6 +11,17 @@
         <res-auth>Container</res-auth>
         <res-sharing-scope>Shareable</res-sharing-scope>
     </resource-ref>
+    <resource-ref>
+        <res-ref-name>jms/JMSConnectionFactory</res-ref-name>
+        <res-type>javax.jms.ConnectionFactory</res-type>
+        <res-auth>Container</res-auth>
+        <res-sharing-scope>Shareable</res-sharing-scope>
+    </resource-ref>
+
+    <resource-env-ref>
+        <resource-env-ref-name>jms/Queue</resource-env-ref-name>
+        <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
+    </resource-env-ref>
 
 </application-client>
 

Modified: geronimo/trunk/itests/naming/client/src/java/org/apache/geronimo/itest/naming/client/App.java
==============================================================================
--- geronimo/trunk/itests/naming/client/src/java/org/apache/geronimo/itest/naming/client/App.java
(original)
+++ geronimo/trunk/itests/naming/client/src/java/org/apache/geronimo/itest/naming/client/App.java
Thu Sep 30 10:31:27 2004
@@ -5,6 +5,8 @@
 import javax.naming.Name;
 import javax.naming.NamingException;
 import javax.sql.DataSource;
+import javax.jms.ConnectionFactory;
+import javax.jms.Queue;
 
 import org.apache.geronimo.naming.java.javaURLContextFactory;
 import org.apache.geronimo.naming.java.RootContext;
@@ -24,7 +26,15 @@
         InitialContext initialContext = new InitialContext();
         Object o = initialContext.lookup("java:comp/env/jdbc/DefaultDatasource");
         DataSource ds = (DataSource) o;
-        Connection conn = ds.getConnection();
-        conn.close();
+        Connection jdbcConnection = ds.getConnection();
+        jdbcConnection.close();
+
+        o = initialContext.lookup("java:comp/env/jms/JMSConnectionFactory");
+        ConnectionFactory connectionFactory = (ConnectionFactory) o;
+        javax.jms.Connection jmsConnection = connectionFactory.createConnection();
+        jmsConnection.close();
+
+        o = initialContext.lookup("java:comp/env/jms/Queue");
+        Queue jmsQueue = (Queue) o;
     }
 }

Modified: geronimo/trunk/itests/naming/client/src/plan/plan1.xml
==============================================================================
--- geronimo/trunk/itests/naming/client/src/plan/plan1.xml	(original)
+++ geronimo/trunk/itests/naming/client/src/plan/plan1.xml	Thu Sep 30 10:31:27 2004
@@ -7,12 +7,20 @@
         <ref-name>jdbc/DefaultDatasource</ref-name>
         <target-name>DefaultDatasource</target-name>
     </resource-ref>
+    <resource-ref>
+        <ref-name>jms/JMSConnectionFactory</ref-name>
+        <target-name>DefaultActiveMQConnectionFactory</target-name>
+    </resource-ref>
+    <resource-env-ref>
+        <ref-name>jms/Queue</ref-name>
+        <target-name>MDBTransferBeanOutQueue</target-name>
+    </resource-env-ref>
     <resource>
         <external-rar>tranql/rars/tranql-connector-1.0-SNAPSHOT.rar</external-rar>
         <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector"
             version="1.5"
             configId="org/apache/geronimo/DefaultDatabase"
-            parentId="org/apache/geronimo/Server">
+            >
 
             <dependency>
                 <uri>axion/jars/axion-1.0-M3-dev.jar</uri>
@@ -56,6 +64,71 @@
                 </outbound-resourceadapter>
             </resourceadapter>
 
+        </connector>
+
+    </resource>
+    <resource>
+        <external-rar>activemq/rars/activemq-1.1-SNAPSHOT.rar</external-rar>
+        <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector" version="1.5"
+          configId="org.codehaus.activemq.ra/default"
+          >
+          <resourceadapter>
+            <resourceadapter-instance>
+              <resourceadapter-name>ActiveMQ RA</resourceadapter-name>
+              <config-property-setting name="ServerUrl">vm://localhost</config-property-setting>
+              <config-property-setting name="UserName">geronimo</config-property-setting>
+              <config-property-setting name="Password">geronimo</config-property-setting>
+              <config-property-setting name="XA">true</config-property-setting>
+              <workmanager-name>DefaultWorkManager</workmanager-name>
+            </resourceadapter-instance>
+            <outbound-resourceadapter>
+              <connection-definition>
+                <connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>
+                <connectiondefinition-instance>
+                  <name>DefaultActiveMQConnectionFactory</name>
+                  <connectionmanager>
+                    <xa-transaction>
+                      <transaction-caching/>
+                    </xa-transaction>
+                    <single-pool>
+                      <max-size>10</max-size>
+                      <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+                      <match-one/>
+                    </single-pool>
+                  </connectionmanager>
+                  <!--credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface-->
+                </connectiondefinition-instance>
+              </connection-definition>
+            </outbound-resourceadapter>
+            <adminobject>
+              <adminobject-interface>javax.jms.Queue</adminobject-interface>
+              <adminobject-class>org.codehaus.activemq.message.ActiveMQQueue</adminobject-class>
+              <adminobject-instance>
+                <message-destination-name>MDBTransferBeanOutQueue</message-destination-name>
+                <config-property-setting name="PhysicalName">MDBTransferBeanOutQueue</config-property-setting>
+              </adminobject-instance>
+            </adminobject>
+            <adminobject>
+              <adminobject-interface>javax.jms.Queue</adminobject-interface>
+              <adminobject-class>org.codehaus.activemq.message.ActiveMQQueue</adminobject-class>
+              <adminobject-instance>
+                <message-destination-name>SendReceiveQueue</message-destination-name>
+                <config-property-setting name="PhysicalName">SendReceiveQueue</config-property-setting>
+              </adminobject-instance>
+            </adminobject>
+          </resourceadapter>
+
+          <gbean name="geronimo.client:type=JMSServer,container=ActiveMQ" class="org.codehaus.activemq.gbean.ActiveMQContainer">
+            <attribute name="brokerName" type="java.lang.String">possibly-unique-broker</attribute>
+          </gbean>
+          <gbean name='geronimo.client:type=JMSConnector,container=ActiveMQ,url="tcp://localhost:61616"'
class="org.codehaus.activemq.gbean.ActiveMQConnector">
+            <attribute name="Url" type="java.lang.String">tcp://localhost:61616</attribute>
+            <reference name="ActiveMQContainer">geronimo.server:type=JMSServer,container=ActiveMQ</reference>
+          </gbean>
+          <gbean name='geronimo.client:type=JMSConnector,container=ActiveMQ,url="vm://localhost"'
class="org.codehaus.activemq.gbean.ActiveMQConnector">
+            <attribute name="Url" type="java.lang.String">vm://localhost</attribute>
+            <reference name="ActiveMQContainer">geronimo.server:type=JMSServer,container=ActiveMQ</reference>
+          </gbean>
         </connector>
 
     </resource>

Mime
View raw message