Skip to content

Commit

Permalink
Merge pull request #17 from maschmid/SEAMJMS-58
Browse files Browse the repository at this point in the history
SEAMJMS-58, make the statuswatcher work on both AS6 and AS7
  • Loading branch information
johnament committed Oct 31, 2011
2 parents 4e4cc99 + 6a93e25 commit feed405
Show file tree
Hide file tree
Showing 10 changed files with 242 additions and 155 deletions.
5 changes: 5 additions & 0 deletions examples/jms-statuswatcher/jbossas7.cli
@@ -0,0 +1,5 @@
connect
batch
add-jms-topic --name=StatusInfoTopic --entries=java:/jms/statusInfoTopic
add-jms-queue --name=UpdateStatusQueue --entries=java:/jms/updateStatusQueue
run-batch
330 changes: 185 additions & 145 deletions examples/jms-statuswatcher/pom.xml
@@ -1,148 +1,188 @@
<?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">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.jboss.seam.jms</groupId>
<artifactId>seam-jms-parent</artifactId>
<version>3.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>seam-jms-example-statuswatcher</artifactId>
<packaging>war</packaging>

<name>Seam StatusWatcher Example (JMS)</name>

<properties>
<jboss.home>${env.JBOSS_HOME}</jboss.home>
<jboss.domain>default</jboss.domain>
<jsf.version>2.0.2-FCS</jsf.version>
<ajax4jsf.version>1.0.5</ajax4jsf.version>
</properties>

<dependencies>

<dependency>
<groupId>org.jboss.seam.jms</groupId>
<artifactId>seam-jms</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.jboss.solder</groupId>
<artifactId>solder-impl</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.jboss.solder</groupId>
<artifactId>solder-api</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.jboss.spec.javax.jms</groupId>
<artifactId>jboss-jms-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.jboss.spec.javax.ejb</groupId>
<artifactId>jboss-ejb-api_3.1_spec</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.0.Final</version>
<scope>provided</scope>
</dependency>

<!-- Common to JEE and Servlet containers -->
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.jboss.spec.javax.annotation</groupId>
<artifactId>jboss-annotations-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<classifier>jdk15</classifier>
</dependency>

<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>${jsf.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>el-impl</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
<finalName>jms-statuswatcher</finalName>
</build>

<profiles>
<profile>
<id>distribution</id>
<activation>
<property>
<name>release</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jbossas</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<version>1.4.1</version>
<configuration>
<jbossHome>${jboss.home}</jbossHome>
<serverName>${jboss.domain}</serverName>
<fileNames>
<param>${basedir}/src/main/resources-jboss6/statuswatcher-hornetq-jms.xml</param>
<param>${project.build.directory}/${project.build.finalName}.${project.packaging}</param>
</fileNames>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.jboss.seam.jms</groupId>
<artifactId>seam-jms-parent</artifactId>
<version>3.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>seam-jms-example-statuswatcher</artifactId>
<packaging>war</packaging>

<name>Seam StatusWatcher Example (JMS)</name>

<properties>
<jboss.home>${env.JBOSS_HOME}</jboss.home>
<jboss.domain>default</jboss.domain>
<jsf.version>2.0.2-FCS</jsf.version>
<ajax4jsf.version>1.0.5</ajax4jsf.version>
</properties>

<dependencies>

<dependency>
<groupId>org.jboss.seam.jms</groupId>
<artifactId>seam-jms</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.jboss.solder</groupId>
<artifactId>solder-impl</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.jboss.solder</groupId>
<artifactId>solder-api</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.jboss.spec.javax.jms</groupId>
<artifactId>jboss-jms-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.jboss.spec.javax.ejb</groupId>
<artifactId>jboss-ejb-api_3.1_spec</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.0.Final</version>
<scope>provided</scope>
</dependency>

<!-- Common to JEE and Servlet containers -->
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.jboss.spec.javax.annotation</groupId>
<artifactId>jboss-annotations-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<classifier>jdk15</classifier>
</dependency>

<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>${jsf.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>el-impl</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
<finalName>jms-statuswatcher</finalName>
</build>

<profiles>
<profile>
<id>distribution</id>
<activation>
<property>
<name>release</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jbossas6</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<executions>
<execution>
<id>package-jboss</id>
<phase>package</phase>
<goals>
<goal>war</goal>
</goals>
<configuration>
<useCache>false</useCache>
<warSourceDirectory>src/main/resources-jboss6</warSourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<version>1.4.1</version>
<configuration>
<jbossHome>${jboss.home}</jbossHome>
<serverName>${jboss.domain}</serverName>
<fileNames>
<param>${basedir}/src/main/resources-jboss6/statuswatcher-hornetq-jms.xml</param>
<param>${project.build.directory}/${project.build.finalName}.${project.packaging}</param>
</fileNames>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jbossas7</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<executions>
<execution>
<id>package-jboss</id>
<phase>package</phase>
<goals>
<goal>war</goal>
</goals>
<configuration>
<useCache>false</useCache>
<warSourceDirectory>src/main/resources-jboss7</warSourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
23 changes: 22 additions & 1 deletion examples/jms-statuswatcher/readme.txt
Expand Up @@ -9,7 +9,7 @@ To run the example on JBossAS 6 you need to do the following:

* build and deploy the app:

mvn clean install jboss:hard-deploy
mvn clean install jboss:hard-deploy -Pjbossas6

This will copy the resulting war along with a hornetq configuration file to a JBossAS
deploy directory.
Expand All @@ -32,3 +32,24 @@ You can send your status to the server via (opening it in a different browser wi

Of course, you can open several browser windows, one for each user, and watch incomming statuses.



To run the example on JBossAS 7 you need to do the following:

* Start an AS7 instance with the EE6-full profile

$JBOSS_HOME/bin/standalone.sh --server-config=$JBOSS_HOME/standalone/configuration/standalone-preview.xml

* Create queues and topics for testing

$JBOSS_HOME/bin/jboss-admin.sh --file=jbossas7.cli

* Build the example

mvn clean package -Pjbossas7

* Deploy the example

$JBOSS_HOME/bin/jboss-admin.sh --connect
deploy target/jms-statuswatcher.war

Expand Up @@ -22,19 +22,19 @@

@MessageDriven(name = "OrderProcessor", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "/jms/updateStatusQueue")},
mappedName="jms/updateStatusQueue")
@ActivationConfigProperty(propertyName = "destination", propertyValue = "java:/jms/updateStatusQueue")},
mappedName="java:/jms/updateStatusQueue")
public class DistributorMDB implements MessageListener {
@Inject
private Logger log;

@EJB
private StatusManager manager;

@Resource(mappedName = "/ConnectionFactory")
@Resource(mappedName = "java:/ConnectionFactory")
private ConnectionFactory connectionFactory;

@Resource(mappedName = "/jms/statusInfoTopic")
@Resource(mappedName = "java:/jms/statusInfoTopic")
private Topic statusTopic;

@Override
Expand Down

0 comments on commit feed405

Please sign in to comment.