commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject cvs commit: jakarta-commons-sandbox/messenger/xdocs navigation.xml index.xml
Date Wed, 22 May 2002 14:49:16 GMT
jstrachan    02/05/22 07:49:16

  Modified:    messenger build.xml .cvsignore README.txt
  Added:       messenger project.properties LICENSE.txt project.xml
               messenger/xdocs navigation.xml index.xml
  Log:
  Patched the build process to use Maven. This doesn't totally work yet for Unit test cases
but at least the website and documentation is now built.
  
  Revision  Changes    Path
  1.30      +152 -1    jakarta-commons-sandbox/messenger/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/build.xml,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- build.xml	17 May 2002 15:05:46 -0000	1.29
  +++ build.xml	22 May 2002 14:49:16 -0000	1.30
  @@ -2,7 +2,7 @@
   
   <!--
           "messenger" component of the Jakarta Commons Subproject
  -        $Id: build.xml,v 1.29 2002/05/17 15:05:46 jstrachan Exp $
  +        $Id: build.xml,v 1.30 2002/05/22 14:49:16 jstrachan Exp $
   -->
   
   <!-- ========== Initialize Properties ===================================== -->
  @@ -12,6 +12,157 @@
     <property file="../build.properties"/>             <!-- Commons local     -->
     <property file="${user.home}/build.properties"/>   <!-- User local        -->
   
  +
  +  <!-- Allow any user specific values to override the defaults -->
  +  <property file="${user.home}/build.properties" />
  +  <!-- Allow user defaults for this project -->
  +  <property file="build.properties" />
  +  <!-- Set default values for the build -->
  +  <property file="project.properties" />
  +  
  +<!-- maven:start -->
  +
  +<!-- ======================================================== -->
  +<!-- D E L E G A T O R S                                      -->
  +<!-- ======================================================== -->
  +
  +<target name="maven:gump-descriptor">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="gump-descriptor"/>
  +</target>
  +
  +<target name="maven:maven-update">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="maven-update"/>
  +</target>
  +
  +<target name="maven:update-jars">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="update-jars"/>
  +</target>
  +
  +<target name="maven:jar">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="jar"/>
  +</target>
  +
  +<target name="maven:docs-quick">
  +  <ant antfile="${maven.home}/plugins/docs/build.xml" target="docs-quick"/>
  +</target>
  +
  +<target name="maven:run-singletest">
  +  <ant antfile="${maven.home}/plugins/test/build.xml" target="run-singletest"/>
  +</target>
  +
  +<target name="maven:compile">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="compile"/>
  +</target>
  +
  +<target name="maven:fo">
  +  <ant antfile="${maven.home}/plugins/docs/build.xml" target="fo"/>
  +</target>
  +
  +<target name="maven:cvs-change-log">
  +  <ant antfile="${maven.home}/plugins/docs/build.xml" target="cvs-change-log"/>
  +</target>
  +
  +<target name="maven:war">
  +  <ant antfile="${maven.home}/plugins/j2ee/build.xml" target="war"/>
  +</target>
  +
  +<target name="maven:generate-reactor">
  +  <ant antfile="${maven.home}/plugins/reactor/build.xml" target="generate-reactor"/>
  +</target>
  +
  +<target name="maven:cross-ref">
  +  <ant antfile="${maven.home}/plugins/docs/build.xml" target="cross-ref"/>
  +</target>
  +
  +<target name="maven:deploy-site">
  +  <ant antfile="${maven.home}/plugins/docs/build.xml" target="deploy-site"/>
  +</target>
  +
  +<target name="maven:ear">
  +  <ant antfile="${maven.home}/plugins/j2ee/build.xml" target="ear"/>
  +</target>
  +
  +<target name="maven:install-jar">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="install-jar"/>
  +</target>
  +
  +<target name="maven:task-list">
  +  <ant antfile="${maven.home}/plugins/docs/build.xml" target="task-list"/>
  +</target>
  +
  +<target name="maven:docs">
  +  <ant antfile="${maven.home}/plugins/docs/build.xml" target="docs"/>
  +</target>
  +
  +<target name="maven:site">
  +  <ant antfile="${maven.home}/plugins/docs/build.xml" target="site"/>
  +</target>
  +
  +<target name="maven:deploy-dist">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="deploy-dist"/>
  +</target>
  +
  +<target name="maven:javadocs">
  +  <ant antfile="${maven.home}/plugins/docs/build.xml" target="javadocs"/>
  +</target>
  +
  +<target name="maven:announce">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="announce"/>
  +</target>
  +
  +<target name="maven:check-source">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="check-source"/>
  +</target>
  +
  +<target name="maven:dist">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="dist"/>
  +</target>
  +
  +<target name="maven:dist-build">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="dist-build"/>
  +</target>
  +
  +<target name="maven:metrics">
  +  <ant antfile="${maven.home}/plugins/metrics/build.xml" target="metrics"/>
  +</target>
  +
  +<target name="maven:clean">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="clean"/>
  +</target>
  +
  +<target name="maven:env">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="env"/>
  +</target>
  +
  +<target name="maven:test">
  +  <ant antfile="${maven.home}/plugins/test/build.xml" target="test"/>
  +</target>
  +
  +<target name="maven:pdf">
  +  <ant antfile="${maven.home}/plugins/docs/build.xml" target="pdf"/>
  +</target>
  +
  +<target name="maven:iutest">
  +  <ant antfile="${maven.home}/plugins/iutest/build.xml" target="iutest"/>
  +</target>
  +
  +<target name="maven:activity-log">
  +  <ant antfile="${maven.home}/plugins/docs/build.xml" target="activity-log"/>
  +</target>
  +
  +<target name="maven:verify-project">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="verify-project"/>
  +</target>
  +
  +<target name="maven:validate-pom">
  +  <ant antfile="${maven.home}/plugins/core/build.xml" target="validate-pom"/>
  +</target>
  +
  +<target name="maven:validate-war">
  +  <ant antfile="${maven.home}/plugins/j2ee/build.xml" target="validate-war"/>
  +</target>
  +
  +<!-- maven:end -->
   
   <!-- ========== External Dependencies ===================================== -->
   
  
  
  
  1.2       +1 -0      jakarta-commons-sandbox/messenger/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/.cvsignore,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- .cvsignore	24 Aug 2001 14:20:28 -0000	1.1
  +++ .cvsignore	22 May 2002 14:49:16 -0000	1.2
  @@ -1,2 +1,3 @@
   build.properties
   dist
  +velocity.log
  
  
  
  1.4       +8 -33     jakarta-commons-sandbox/messenger/README.txt
  
  Index: README.txt
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/README.txt,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- README.txt	17 May 2002 15:05:46 -0000	1.3
  +++ README.txt	22 May 2002 14:49:16 -0000	1.4
  @@ -1,43 +1,18 @@
   Jakarta Commons Messenger
   =========================
   
  -Welcome to the Messenger component of the Jakarta Commons
  -project.
  +Messenger is build using Maven. So all you should need to do is
  +install Ant and Maven and just type
   
  -This component requires the excellent Ant utility.  It can 
  -be found here :
  +	ant
   
  -  http://jakarta.apache.org/ant/
  -
  -For testing the project, you will also need JUnit :
  -
  -  http://www.junit.org/
  -
  -To let the test process find JUnit, you may make a 
  -copy of the build.properties.sample file, rename to
  -build.properties,  and modify to reflect
  -the location of the junit.jar on your computer.
  -
  -You will also need the JMS 1.0.2 jms.jar
  -
  -Once you have Ant propertly installed, and the
  -build.properties file correctly reflects the location
  -of your junit.jar, you are ready to build and test.
  +For more help using Maven please go to
   
  -To compile and test the component :
  +  http://jakarta.apache.org/turbine/maven/
   
  -$ ant test
  +You can install Ant from here
   
  -To build a jar :
  -
  -$ ant dist-jar
  -
  -To build the API documentation :
  -
  -$ ant doc
  -
  -To build the jar and API doc at once :
  -
  -$ ant dist
  +  http://jakarta.apache.org/ant/
   
   
  +Enjoy!
  
  
  
  1.1                  jakarta-commons-sandbox/messenger/project.properties
  
  Index: project.properties
  ===================================================================
  # -------------------------------------------------------------------
  # P R O J E C T  P R O P E R T I E S
  # -------------------------------------------------------------------
  
  compile.debug = on
  compile.optimize = off
  compile.deprecation = off
  
  maven.jarResources.basedir=${basedir}/src/java
   
  
  # use Sun coding standards
  
  maven.checkstyle.lcurly.type = eol
  maven.checkstyle.lcurly.method = eol
  maven.checkstyle.lcurly.other = eol
  #maven.checkstyle.header.file = src/conf/checkstyle-LICENSE.txt
  maven.checkstyle.header.ignore.line = 1,2,3,4,5,6
  maven.checkstyle.const.pattern = ^[a-z][a-zA-Z0-9]*$
  
  # disable these non-critical errors to highlight
  # more important ones line missing javadoc
  
  maven.checkstyle.max.line.len = 100
  maven.checkstyle.ignore.whitespace = true
  maven.checkstyle.ignore.public.in.interface = true
  
  
  
  
  
  1.1                  jakarta-commons-sandbox/messenger/LICENSE.txt
  
  Index: LICENSE.txt
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons/LICENSE,v 1.4 2002/04/11 13:24:02 dion Exp $
   * $Revision: 1.4 $
   * $Date: 2002/04/11 13:24:02 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  
  
  1.1                  jakarta-commons-sandbox/messenger/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <project>
    <version>2</version>
    <name>commons-messenger</name>
    <id>commons-messenger</id>
    <currentVersion>1.0-dev</currentVersion>
    <organization>
  	  <name>Apache Software Foundation</name>
  	  <url>http://www.apache.org</url>
    </organization>
    <inceptionYear>2002</inceptionYear>
    <package>org.apache.commons.messenger org.apache.commons.messagelet</package>
    <shortDescription>Commons Messenger</shortDescription>
    <gumpRepositoryId>jakarta</gumpRepositoryId>
    <description>Commons Messenger: simple XML scripting engine</description>
    <url>http://jakarta.apache.org/commons/sandbox/messenger.html</url>
    <cvsWebUrl>http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/messenger/</cvsWebUrl>
    <cvsModule>jakarta-commons-sandbox/messenger</cvsModule>
    <issueTrackingUrl>http://nagoya.apache.org/</issueTrackingUrl>
    <siteAddress>jakarta.apache.org</siteAddress>
    <siteDirectory>/www/jakarta.apache.org/commons/sandbox/messenger/</siteDirectory>
    
    <mailingLists>
      <mailingList>
        <name>Commons Dev List</name>
        <subscribe>commons-dev-subscribe@jakarta.apache.org</subscribe>
        <unsubscribe>commons-dev-unsubscribe@jakarta.apache.org</unsubscribe>
        <archive>http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-dev@jakarta.apache.org</archive>
      </mailingList>
    </mailingLists>
  
    
    <developers>
      <developer>
        <name>James Strachan</name>
        <id>jstrachan</id>
        <email>jstrachan@apache.org</email>
        <organization>SpiritSoft, Inc.</organization>
      </developer>
      <developer>
        <name>Saimon Moore</name>
        <id>saimon</id>
        <email>saimonmoore@yahoo.co.uk</email>
        <organization></organization>
      </developer>
    </developers>
    
    <dependencies>
      
      <dependency>
        <name>commons-logging</name>
        <type>required</type>
        <version>1.0</version>
        <jar>commons-logging-1.0.jar</jar>
      </dependency>
  
      <dependency>
        <name>commons-beanutils</name>
        <type>required</type>
        <version>1.2</version>
        <jar>commons-beanutils-1.2.jar</jar>
      </dependency>
  
      <dependency>
        <name>commons-collections</name>
        <type>required</type>
        <version>2.0</version>
        <jar>commons-collections-2.0.jar</jar>
      </dependency>
  
      <dependency>
        <name>commons-digester</name>
        <type>required</type>
        <version>1.2</version>
        <jar>commons-digester-1.2.jar</jar>
      </dependency>
  
      <dependency>
        <name>servlet</name>
        <type>required</type>
        <version>2.3</version>
        <jar>servlet-2.3.jar</jar>
      </dependency>
  
      <dependency>
        <name>jms</name>
        <type>required</type>
        <version>1.0.2b</version>
        <jar>jms-1.0.2b.jar</jar>
      </dependency>
  
  <!-- runtime dependencies only required for testing and sample programs -->
  
  <!--
      <dependency>
        <name>xercesImpl</name>
        <type>required</type>
        <version>2.0.0</version>
        <jar>xercesImpl-2.0.0.jar</jar>
      </dependency>
  
      <dependency>
        <name>xmlParseAPIs</name>
        <type>required</type>
        <version>2.0.0</version>
        <jar>xmlParserAPIs-2.0.0.jar</jar>
      </dependency>
  -->
  
    </dependencies>
    
    <build>
      <sourceDirectories>
        <sourceDirectory>src/java</sourceDirectory>
      </sourceDirectories>
      <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
      <aspectSourceDirectories></aspectSourceDirectories>
      <unitTestPatterns>
        <unitTestPattern>include = **/*Test*.java</unitTestPattern>
      </unitTestPatterns>
  
      <jarResources>
     	  <jarResource>include = **/*.properties</jarResource>
      </jarResources>
  
      <jars></jars>
      <nagEmailAddress>commons-dev@jakarta.apache.org</nagEmailAddress>
    </build>
  </project>
  
  
  
  1.1                  jakarta-commons-sandbox/messenger/xdocs/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <project name="Messenger">
  
    <title>Messenger</title>
    <organizationLogo href="/images/jakarta-logo-blue.gif">Jakarta</organizationLogo>
  
    <body>
      <menu name="Messenger">
        <item name="Overview"                href="/index.html"/>
      </menu>
    </body>
  </project>
  
  
  
  1.1                  jakarta-commons-sandbox/messenger/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <document>
  
   <properties>
    <title>Messenger</title>
    <author email="jstrachan@apache.org">James Strachan</author>
   </properties>
  
  <body>
  
  <section name="Introduction">
  
  <p>
    <b>Messenger</b> is a JMS (Java Message Service) framework
    which makes it very easy to use JMS in Web Service and Web Application environments.
  </p>
  
  <p>
    Messenger implements session pooling (which can be quite hard to do with JMS) which makes
JMS
    very easy to work with. Also Messenger hides much of the complexity of JMS behind 
    a simple facade API, the 
    <a href="apidocs/org/apache/commons/messenger/Messenger.html">Messenger</a>
interface. 
  </p>
  
  <p>
    In addition Messenger provides an XML deployment 
    configuration file to avoid having to litter your code with complex deployment 
    configuration details in your application code. 
  </p>
  
  <p>
    Messenger also provides a Messagelet Engine which is a JMS based container 
    that can be deployed in any Servlet Engine to process JMS messages
    via MessageListeners, Message Driven Objects, Servlets or JSP.
  </p>
  
  </section>
  
  <section name="Example Config">
  
  <p> 
    Here is an example <i>Messenger.xml</i> deployment configuration file.
  </p>
  
  <source><![CDATA[
  <?xml version="1.0" encoding="UTF-8"?>
  <manager>
  
    <!-- this example Messenger XML config file should work with J2EE SDK -->
  
    <messenger name="topic">
      <jndi lookupName="TopicConnectionFactory">
        <property>
          <name>com.sun.jms.internal.java.naming.factory.initial</name>
          <value>com.sun.enterprise.naming.SerialInitContextFactory</value>
        </property>          
      </jndi>
    </messenger>
  
    <messenger name="queue">
      <jndi lookupName="QueueConnectionFactory">
        <property>
          <name>com.sun.jms.internal.java.naming.factory.initial</name>
          <value>com.sun.enterprise.naming.SerialInitContextFactory</value>
        </property>          
      </jndi>
    </messenger>
  
  </manager>
  ]]></source>
  
  <p>
  It should work with the J2EE SDK to make 2 standard Messengers called 
  <i>topic</i> and <i>queue</i> respectively.
  </p>
  
  <p>
    So how would we use these 2 Messengers from Java code?
  </p>
  
  </section>
  
  <section name="Example Code">
  
  <p>
  Here's some example code to send a message on a topic.
  </p>
  
  <source><![CDATA[
  
  // get a Messenger and Destination
  Messenger messenger = MessengerManager.get( "topic" );
  Destination destination = messenger.getDestination( "CHAT.NEWBIES" );
  
  // now lets send a message
  TextMessage message = messenger.createTextMessage( "this is some text" );
  messenger.send( destination, message );
  ]]></source>
  
  <p>
  Here's some code to receive a message on a queue, blocking until the message arrives.
  </p>
  
  <source><![CDATA[
  
  // get a Messenger and Destination
  Messenger messenger = MessengerManager.get( "queue" );
  Destination destination = messenger.getDestination( "REQUEST.BUILD" );
  
  // now lets receive a message
  Message message = messenger.receive( destination );
  ]]></source>
  
  
  <p>
  Notice how the construction of individual Messenger objects can be hidden behind 
  the MessengerManager in a similar way to tools like <a href="http://jakarta.apache.org/log4j/docs/index.html">log4j</a>.
  </p>
  
  <p>
  Also notice that the Messenger API is a simple facade, no need for Topic and Queue specific
  coding as well as the use of MessageConsumer, MessageProducer, TopicPublisher, 
  TopicSubscriber, QueueSender, QueueReceiver and the plethora of Connection and Session objects.
  </p>
  
  
  </section>
  
  
  <section name="Configuration">
  
  <p>
    By default, Messenger will look for an XML document called <i>Messenger.xml</i>

    on the CLASSPATH as soon as a Messenger instance is looked up via the following code.
  </p>
  
  <source><![CDATA[
  
  Messenger messenger = MessengerManager.get( "customer.orders" );
  ]]></source>
  
  
  <p>
    An alternative approach is to define the system property <i>org.apache.commons.messenger</i>
    to point to a URL of a Messenger deployment configuration document. For example
  </p>
  
  <source><![CDATA[
  
    $ java -Dorg.apache.commons.messenger=http://localhost/config/Messenger.xml MyApplication
  ]]></source>
  
  <p>
    In servlet environments its often a good idea to explicitly configure the 
    singleton <i>MessengerManager</i>
    in a Servlet initialisation method using servlet initialisation parameters. 
    Here's an example
  </p>
  
  <source><![CDATA[
  
  public class MyServlet extends HttpServlet {
      
      public void init() throws ServletException {
          // initialise the Messenger connections
          String url = getInitParameter( "messenger" );
          if ( url != null ) {
              MessengerManager.configure( url );
          }
      }
  }  
  ]]></source>
  
  </section>
  
  
  <section name="Messagelets">
  
  <p>
    The Messenger project provides a Messagelet Engine which is
    a JMS based Container which runs in any Servlet Engine
    such as Tomcat 4.0.
    The Messagelet Engine provides a simple framework for processing JMS messages in
    a variety of ways using either regular JMS MessageListeners, Message Driven Objects, Servlets
or even JSP.
  </p>
  
  <p>
    To deploy a Messagelet Container you need to add the ManagerServlet in a web 
    application giving it an XML configuration file describing all the various JMS connections
    and an XML configuration file describing all the subscriptions.
  </p>
  <p>
    Here are example 
    <a href="http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/messenger/src/conf/Messenger.xml?rev=1.3&amp;content-type=text/vnd.viewcvs-markup">connections</a>
    and 
    <a href="http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/messenger/src/webapp/conf/subscriptions.xml?rev=1.6&amp;content-type=text/vnd.viewcvs-markup">subscriptions</a>

    XML configuration files.
    There now follows the section you need to add to your web.xml configuration file to deploy
the
    Messagelet Manager Servlet.
  </p>
  
  <source><![CDATA[
  
    <servlet>
      <servlet-name>managerServlet</servlet-name>
      <servlet-class>org.apache.commons.messagelet.ManagerServlet</servlet-class>
      <init-param>
        <param-name>connections</param-name>
        <param-value>/WEB-INF/Messenger.xml</param-value>
      </init-param> 
      <init-param>
        <param-name>subscriptions</param-name>
        <param-value>/WEB-INF/subscriptions.xml</param-value>
      </init-param> 
      <load-on-startup>1</load-on-startup> 
    </servlet>
  ]]></source>
  
  <p>
    Once you've done the above and the web application is started the Messagelet engine will
    subscribe to the various JMS subscriptions and then dispatch JMS messages to the various
    MessageListener objects, Servlets or JSP pages.
  </p>
  
  <p>
    There are a variety of ways in which you can process JMS messages depending on your requirements.
  </p>
  
  <ul>
  
  <li>
    A MessageListener is a standard JMS listener of messages.
  </li>
  
  <li>
    A <a href="apidocs/org/apache/commons/messagelet/MessageDrivenObject.html">MessageDrivenObject</a>
is-a JMS MessageListener which has
    extra servlet-based lifecycle methods just like a Servlet.
    This allows
    an MDO to know when its being initialised and when its being destroryed 
    and so do some resource management (such as creating or closing database
    connections etc). Also on initialisation the MDO gets access to the
    ServletContext so that it can read some initialization parameters from
    the web application or perform web-app level logging and so on.
  </li>
  
  <li>
    A <a href="apidocs/org/apache/commons/messagelet/MessengerMDO.html">MessengerMDO</a>
is-a MessageDrivenObject
    but also provides a number of helper methods such as access to the Messenger to
    which its listening, so that responses can be sent back to the originator of the message,
    as well as access to the ServletContext and some logging helper methods.
  </li>
  
  <li>
    A Servlet can be any GenericServlet or HttpServlet.
    If the JMS message that is being dispatched is a TextMessage then the body of the message
is
    available via the ServletRequest.getReader() method, in the normal Servlet way.
    Any output written to the ServletResponse.getWriter() will be converted into a TextMessage
    and sent back to the originator.
    All servlets and JSP pages have access to the originating JMS message and Messenger objects
via
    the "message" and "messenger" request attributes respectively.
  </li>
  
  <li>
    A <a href="apidocs/org/apache/commons/messagelet/Messagelet.html">Messagelet</a>
    is a JMS specific Servlet, just like a HttpServlet is a HTTP specific Servlet. It
    provides access to a Messagelet specific 
    <a href="apidocs/org/apache/commons/messagelet/MessageletRequest.html">MessageletRequest</a>
    and
    <a href="apidocs/org/apache/commons/messagelet/MessageletResponse.html">MessageletResponse</a>
    to allow access to the JMS Message and the Messenger for sending replies.
  </li>
  
  <li>
    A JSP page can be any piece of JSP, for example the standard JSP tag library can be used
    to perform JavaScript, XPath, XSLT or SQL operations on the incoming message.
    The request scope "message" and "messenger" attributes can be used to access the originating
    JMS Message and Messenger objects.
  </li>
  
  </ul>
  
  <p>There are some examples of an MDO, Servlet and Messagelet 
    <a href="http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/messenger/src/webapp/src/">here</a>
or
    you can see example JSP 
    <a href="http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/messenger/src/webapp/web/jms/">here</a>
  </p>
  
  </section>
  
  
  
  <section name="Bridging JMS providers">
  
  <p>
    In addition the Messagelet engine provides a Bridge mechanism which allows messages
    to be consumed from one destination and connection and sent to another destination, 
    possibly using a different JMS connection and provider.
    This allows, for example, messages to be consumed on SpiritWave and sent to MQSeries,
    possibly applying some custom transformation along the way.  
  </p>
  <p>
    The Bridge mechanism is provided via the 
    <a href="apidocs/org/apache/commons/messagelet/BridgeMDO.html">BridgeMDO</a>

    and using the &lt;bridge&gt; element inside a subscription deployment descriptor.
  </p>
  
  </section>
  
  </body>
  </document>
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message