[jboss-cvs] JBossAS SVN: r82540 - in projects/ejb3/trunk/docs/tutorial: consumer and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Dec 24 05:35:10 EST 2008
Author: jaikiran
Date: 2008-12-24 05:35:09 -0500 (Wed, 24 Dec 2008)
New Revision: 82540
Added:
projects/ejb3/trunk/docs/tutorial/consumer/
projects/ejb3/trunk/docs/tutorial/consumer/pom.xml
Modified:
projects/ejb3/trunk/docs/tutorial/consumer/build.xml
projects/ejb3/trunk/docs/tutorial/consumer/queue-example-service.xml
projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleConsumerBean.java
projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducer.java
projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducerLocal.java
projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducerRemote.java
projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducerXA.java
projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/TesterBean.java
Log:
EJBTHREE-1607 Working version of the Consumer tutorial for JBoss-5 GA
Copied: projects/ejb3/trunk/docs/tutorial/consumer (from rev 82032, projects/oldstuff/ejb3/docs/tutorial/consumer)
Modified: projects/ejb3/trunk/docs/tutorial/consumer/build.xml
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/consumer/build.xml 2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/consumer/build.xml 2008-12-24 10:35:09 UTC (rev 82540)
@@ -8,26 +8,20 @@
<property environment="env"/>
<property name="src.dir" value="${basedir}/src"/>
- <property name="jboss.home" value="${env.JBOSS_HOME}"/> <property name="jboss.server.config" value="all"/>
+ <property name="jboss.home" value="${env.JBOSS_HOME}"/>
+ <property name="jboss.server.config" value="default"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="build.classes.dir" value="${build.dir}/classes"/>
+ <property name="build.artifact" value="jboss-ejb3-tutorial-consumer.jar"/>
<!-- Build classpath -->
<path id="classpath">
<!-- So that we can get jndi.properties for InitialContext -->
<pathelement location="${basedir}"/>
- <fileset dir="${jboss.home}/lib">
- <include name="**/*.jar"/>
+ <!-- Only the jbossall-client.jar should ideally be sufficient -->
+ <fileset dir="${jboss.home}/client">
+ <include name="**/jbossall-client.jar"/>
</fileset>
- <fileset dir="${jboss.home}/server/${jboss.server.config}/lib">
- <include name="**/*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/server/${jboss.server.config}/deploy/ejb3.deployer">
- <include name="*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/server/${jboss.server.config}/deploy/jboss-aop-jdk50.deployer">
- <include name="*.jar"/>
- </fileset>
<pathelement location="${build.classes.dir}"/>
</path>
@@ -56,14 +50,15 @@
</target>
<target name="ejbjar" depends="compile">
- <jar jarfile="build/tutorial.jar">
+ <jar jarfile="build/${build.artifact}">
<fileset dir="${build.classes.dir}">
<include name="**/*.class"/>
</fileset>
+ <!-- Include the queue-example-service.xml in the META-INF of the jar -->
+ <metainf includesfile="queue-example-service.xml"/>
</jar>
- <copy file="queue-example-service.xml" todir="${jboss.home}/server/${jboss.server.config}/deploy"/>
- <sleep seconds="5"/>
- <copy file="build/tutorial.jar" todir="${jboss.home}/server/${jboss.server.config}/deploy"/>
+
+ <copy file="build/${build.artifact}" todir="${jboss.home}/server/${jboss.server.config}/deploy"/>
</target>
<target name="run" depends="ejbjar">
@@ -81,8 +76,7 @@
<target name="clean">
<delete dir="${build.dir}"/>
- <delete file="${jboss.home}/server/${jboss.server.config}/deploy/tutorial.jar"/>
- <delete file="${jboss.home}/server/${jboss.server.config}/deploy/queue-example-service.xml"/>
+ <delete file="${jboss.home}/server/${jboss.server.config}/deploy/${build.artifact}"/>
</target>
Added: projects/ejb3/trunk/docs/tutorial/consumer/pom.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/consumer/pom.xml (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/consumer/pom.xml 2008-12-24 10:35:09 UTC (rev 82540)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<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">
+
+
+
+
+
+ <!-- Model Version -->
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-tutorial-common</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <relativePath>../common/</relativePath>
+ </parent>
+
+ <properties>
+ <ejb3.tutorial.client>org.jboss.tutorial.consumer.client.Client</ejb3.tutorial.client>
+ </properties>
+
+
+ <artifactId>jboss-ejb3-tutorial-consumer</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>JMS Consumers and Producers in JBoss</name>
+ <url>http://labs.jboss.com/jbossejb3/</url>
+ <description>
+ Tutorial about JBoss specific JMS Consumers and Producers
+ </description>
+
+ <build>
+ <!--
+ If child pom has a resources section then the resource section from
+ the parent is NOT inherited. So repeat the resources section from the
+ parent pom here. Additionally, add the queue-example-service.xml
+ (used to deploy the queue) into the META-INF folder of the output
+ artifact
+ -->
+
+ <!-- Include the jndi.properties and the log4j.xml in the classpath -->
+ <resources>
+ <!--
+ Include files from the root of the tutorial into the root of output
+ artifact jar
+ -->
+ <resource>
+
+ <directory>./</directory>
+ <includes>
+ <include>*.properties</include>
+ <include>log4j.xml</include>
+ </includes>
+ </resource>
+ <!--
+ Include xml files from the META-INF of the tutorial into the
+ META-INF folder of output artifact jar
+ -->
+ <resource>
+
+ <directory>./META-INF</directory>
+ <includes>
+ <include>*.xml</include>
+ </includes>
+ <targetPath>META-INF</targetPath>
+ </resource>
+
+ <!--
+ Include the queue-example-service.xml into the META-INF of the
+ packaged jar
+ -->
+ <resource>
+ <directory>./</directory>
+ <includes>
+ <include>queue-example-service.xml</include>
+ </includes>
+ <targetPath>META-INF</targetPath>
+ </resource>
+
+ </resources>
+ </build>
+
+</project>
Property changes on: projects/ejb3/trunk/docs/tutorial/consumer/pom.xml
___________________________________________________________________
Name: svn:executable
+ *
Modified: projects/ejb3/trunk/docs/tutorial/consumer/queue-example-service.xml
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/consumer/queue-example-service.xml 2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/consumer/queue-example-service.xml 2008-12-24 10:35:09 UTC (rev 82540)
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<server>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.mq.destination:service=Queue,name=tutorial">
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=tutorial"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
<attribute name="JNDIName">queue/tutorial/example</attribute>
- <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
</mbean>
-</server>
+</server>
\ No newline at end of file
Modified: projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleConsumerBean.java
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleConsumerBean.java 2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleConsumerBean.java 2008-12-24 10:35:09 UTC (rev 82540)
@@ -22,26 +22,30 @@
package org.jboss.tutorial.consumer.bean;
import java.util.Map;
+
import javax.ejb.ActivationConfigProperty;
import javax.jms.Message;
-import org.jboss.annotation.ejb.Consumer;
-import org.jboss.annotation.ejb.CurrentMessage;
- at Consumer(activationConfig = {
- @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
- @ActivationConfigProperty(propertyName="destination", propertyValue="queue/tutorial/example")
-})
+import org.jboss.ejb3.annotation.Consumer;
+import org.jboss.ejb3.annotation.CurrentMessage;
+import org.jboss.ejb3.annotation.Depends;
+
+ at Consumer(activationConfig =
+{@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
+ @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/tutorial/example")})
+ at Depends ("jboss.messaging.destination:service=Queue,name=tutorial")
public class ExampleConsumerBean implements ExampleProducerRemote, ExampleProducerLocal, ExampleProducerXA
{
// you can have container inject the current JMS message so that you can manipulate it, like for instance
// to get a reply-to destination.
- @CurrentMessage private Message currentMessage;
+ @CurrentMessage
+ private Message currentMessage;
-
public void method1(String msg, int val)
{
System.out.println("method1(" + msg + ", " + val + ")");
}
+
public void method2(String msg, Map<String, String> map)
{
System.out.println("method2: " + msg);
Modified: projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducer.java
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducer.java 2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducer.java 2008-12-24 10:35:09 UTC (rev 82540)
@@ -21,13 +21,11 @@
*/
package org.jboss.tutorial.consumer.bean;
-import org.jboss.annotation.ejb.MessageProperties;
-import org.jboss.annotation.ejb.DeliveryMode;
-import org.jboss.annotation.ejb.DeliveryMode;
-import org.jboss.annotation.ejb.MessageProperties;
-
import java.util.Map;
+import org.jboss.ejb3.annotation.DeliveryMode;
+import org.jboss.ejb3.annotation.MessageProperties;
+
/**
* comment
*
@@ -37,6 +35,6 @@
{
void method1(String msg, int val);
- @MessageProperties(delivery=DeliveryMode.NON_PERSISTENT)
+ @MessageProperties(delivery = DeliveryMode.NON_PERSISTENT)
void method2(String msg, Map<String, String> map);
}
Modified: projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducerLocal.java
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducerLocal.java 2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducerLocal.java 2008-12-24 10:35:09 UTC (rev 82540)
@@ -21,17 +21,17 @@
*/
package org.jboss.tutorial.consumer.bean;
-import org.jboss.annotation.ejb.Producer;
-import org.jboss.annotation.ejb.Local;
-import org.jboss.annotation.ejb.Producer;
+import javax.ejb.Local;
+import org.jboss.ejb3.annotation.Producer;
/**
* comment
*
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
*/
- at Local @Producer
+ at Local
+ at Producer
public interface ExampleProducerLocal extends ExampleProducer
{
Modified: projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducerRemote.java
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducerRemote.java 2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducerRemote.java 2008-12-24 10:35:09 UTC (rev 82540)
@@ -21,7 +21,7 @@
*/
package org.jboss.tutorial.consumer.bean;
-import org.jboss.annotation.ejb.Producer;
+import org.jboss.ejb3.annotation.Producer;
/**
Modified: projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducerXA.java
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducerXA.java 2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/ExampleProducerXA.java 2008-12-24 10:35:09 UTC (rev 82540)
@@ -22,20 +22,21 @@
package org.jboss.tutorial.consumer.bean;
import java.util.Map;
-import org.jboss.annotation.ejb.DeliveryMode;
-import org.jboss.annotation.ejb.MessageProperties;
-import org.jboss.annotation.ejb.Producer;
-import org.jboss.annotation.ejb.Local;
+import javax.ejb.Local;
+import org.jboss.ejb3.annotation.MessageProperties;
+import org.jboss.ejb3.annotation.Producer;
+
/**
* comment
*
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
*/
- at Local @Producer(connectionFactory="java:/JmsXA")
+ at Local
+ at Producer(connectionFactory = "java:/JmsXA")
public interface ExampleProducerXA extends ExampleProducer
{
- @MessageProperties(delivery=DeliveryMode.PERSISTENT, priority=4)
+ @MessageProperties(delivery = org.jboss.ejb3.annotation.DeliveryMode.PERSISTENT, priority = 4)
void method2(String msg, Map<String, String> map);
}
Modified: projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/TesterBean.java
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/TesterBean.java 2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/consumer/src/org/jboss/tutorial/consumer/bean/TesterBean.java 2008-12-24 10:35:09 UTC (rev 82540)
@@ -23,11 +23,14 @@
import java.util.HashMap;
import java.util.Map;
-import org.jboss.annotation.JndiInject;
+
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
+
+import org.jboss.ejb3.annotation.Depends;
+import org.jboss.ejb3.annotation.JndiInject;
import org.jboss.ejb3.mdb.ProducerManager;
import org.jboss.ejb3.mdb.ProducerObject;
@@ -43,23 +46,25 @@
public class TesterBean implements Tester
{
private ExampleProducerXA xa;
+
private ProducerManager xaManager;
- @JndiInject(jndiName="org.jboss.tutorial.consumer.bean.ExampleProducerXA")
+ @JndiInject(jndiName = "org.jboss.tutorial.consumer.bean.ExampleProducerXA")
public void setXa(ExampleProducerXA xa)
{
this.xa = xa;
- this.xaManager = ((ProducerObject)xa).getProducerManager();
+ this.xaManager = ((ProducerObject) xa).getProducerManager();
}
private ExampleProducer local;
+
private ProducerManager localManager;
- @JndiInject(jndiName="org.jboss.tutorial.consumer.bean.ExampleProducerLocal")
+ @JndiInject(jndiName = "org.jboss.tutorial.consumer.bean.ExampleProducerLocal")
public void setLocal(ExampleProducer local)
{
this.local = local;
- this.localManager = ((ProducerObject)local).getProducerManager();
+ this.localManager = ((ProducerObject) local).getProducerManager();
}
@TransactionAttribute(TransactionAttributeType.REQUIRED)
More information about the jboss-cvs-commits
mailing list