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/src/webapp/web/jms time.jsp
Date Tue, 13 Nov 2001 09:42:28 GMT
jstrachan    01/11/13 01:42:28

  Modified:    messenger PROPOSAL.html STATUS.html TODO.txt
               messenger/src/java/org/apache/commons/messagelet
                        ManagerServlet.java
               messenger/src/java/org/apache/commons/messagelet/impl
                        HttpMessageletRequestImpl.java
                        MessageHttpServletDispatcher.java
                        MessageletRequestImpl.java
                        SubscriptionDigester.java
               messenger/src/java/org/apache/commons/messenger
                        MessengerDigester.java
               messenger/src/webapp/web/jms time.jsp
  Removed:     messenger/src/java/org/apache/commons/messenger
                        DigesterSupport.java
  Log:
  Moved to new Digester 1.1.1 which allows the retirement of the DigesterSupport class. Also
now the Messenger and Message are available to servlets & JSP as a request time attribute
which works very nicely with JSPTL.
  
  Revision  Changes    Path
  1.6       +4 -3      jakarta-commons-sandbox/messenger/PROPOSAL.html
  
  Index: PROPOSAL.html
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/PROPOSAL.html,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PROPOSAL.html	2001/10/30 08:30:09	1.5
  +++ PROPOSAL.html	2001/11/13 09:42:27	1.6
  @@ -20,10 +20,11 @@
     In addition, Messenger provides a simple XML config file that can be used 
     to initialise all JMS connections which can either be retreived from JNDI 
     using configurable JNDI properties or via  custom factory classes.
  -<p>
   </p>
  -  The combination of the simple facade API together with the simple XML 
  -  deployment descriptors should makes it extremely easy to work with JMS.
  +<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, Servlets or JSP.
   </p>
   
   <h3>(1) Scope of the Package</h3>
  
  
  
  1.7       +2 -2      jakarta-commons-sandbox/messenger/STATUS.html
  
  Index: STATUS.html
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/STATUS.html,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- STATUS.html	2001/11/06 08:36:42	1.6
  +++ STATUS.html	2001/11/13 09:42:27	1.7
  @@ -7,7 +7,7 @@
   
   <div align="center">
   <h1>The Jakarta Commons <em>Messenger</em> Package</h1>
  -$Id: STATUS.html,v 1.6 2001/11/06 08:36:42 jstrachan Exp $<br>
  +$Id: STATUS.html,v 1.7 2001/11/13 09:42:27 jstrachan Exp $<br>
   <a href="#Introduction">[Introduction]</a>
   <a href="#Dependencies">[Dependencies]</a>
   <a href="#Release Info">[Release Info]</a>
  @@ -49,7 +49,7 @@
   <li><a href="http://java.sun.com/j2se">Java Development Kit</a>
       (Version 1.2 or later)</li>
   <li><a href="http://jakarta.apache.org/commons/digester.html">
  -  Jakarta Commons Digester</a></li>
  +  Jakarta Commons Digester (version 1.1.1 or later)</a></li>
   <li><a href="http://jakarta.apache.org/commons/beanutils.html">
     Jakarta Commons BeanUtils</a></li>
   <li><a href="http://jakarta.apache.org/commons/collections.html">
  
  
  
  1.5       +0 -15     jakarta-commons-sandbox/messenger/TODO.txt
  
  Index: TODO.txt
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/TODO.txt,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TODO.txt	2001/10/30 11:14:30	1.4
  +++ TODO.txt	2001/11/13 09:42:27	1.5
  @@ -1,30 +1,15 @@
   Project To Do List
   ==================
   
  -* When using JSP to process JMS messages it might be nice to provide
  -  the Messenger and original Message as request Attributes that the JSP
  -  could use directly, without requiring to cast the request and response.
   
  -
   * Allow the replyTo destination and Messenger to be overridden 
     in the XML deployment configuration for Messagelets and Servlets.
   
  -
   * Maybe Ant tasks to generate messages from <fileSets> or something?
   
  -
  -* make sample programs that work with J2EE SDK. A standard
  -  set of useful tools, like publisher & subscriber, tools that can
  -  read files in a directory and publish them etc.
  -
   * write JMSServlet such that
     HTTP GET -> Messenger.receive();
     HTTP POST -> Messenger.send();
  -
  -* allow the digester to read MessageListener classes from the XML deployment 
  -  descriptor, so that a simple alternative to Message Driven beans can be done.
  -  This would allow plug-in 'connectors' for messenger, such as simple JMS based
  -  agents and so on.
   
   * consider Messenger based appender for log4j.
   
  
  
  
  1.9       +6 -7      jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messagelet/ManagerServlet.java
  
  Index: ManagerServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messagelet/ManagerServlet.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ManagerServlet.java	2001/10/30 11:14:31	1.8
  +++ ManagerServlet.java	2001/11/13 09:42:27	1.9
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    * 
  - * $Id: ManagerServlet.java,v 1.8 2001/10/30 11:14:31 jstrachan Exp $
  + * $Id: ManagerServlet.java,v 1.9 2001/11/13 09:42:27 jstrachan Exp $
    */
   package org.apache.commons.messagelet;
   
  @@ -35,7 +35,7 @@
     * and use of MessageListener beans for a given ServletContext.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.8 $
  +  * @version $Revision: 1.9 $
     */
   public class ManagerServlet extends GenericServlet {
   
  @@ -177,9 +177,13 @@
           try {
               String selector = subscription.getSelector();
               if ( selector != null && selector.length() > 0 ) {
  +                log( "Subscribing to messenger: " + name + " destination: " + subject +
" selector: " + selector );
  +                
                   messenger.addListener( destination, selector, listener );
               }
               else {
  +                log( "Subscribing to messenger: " + name + " destination: " + subject );
  +                
                   messenger.addListener( destination, listener );
               }
           }
  @@ -297,10 +301,5 @@
               // ignore, must be an absolute URL
           }
           return config;
  -    }
  -    
  -    public void log(String message) {
  -        System.out.println( message );
  -        super.log( message );
       }
   }
  
  
  
  1.3       +10 -2     jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messagelet/impl/HttpMessageletRequestImpl.java
  
  Index: HttpMessageletRequestImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messagelet/impl/HttpMessageletRequestImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HttpMessageletRequestImpl.java	2001/10/30 11:14:31	1.2
  +++ HttpMessageletRequestImpl.java	2001/11/13 09:42:27	1.3
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    * 
  - * $Id: HttpMessageletRequestImpl.java,v 1.2 2001/10/30 11:14:31 jstrachan Exp $
  + * $Id: HttpMessageletRequestImpl.java,v 1.3 2001/11/13 09:42:27 jstrachan Exp $
    */
   package org.apache.commons.messagelet.impl;
   
  @@ -29,13 +29,14 @@
   
   import org.apache.commons.collections.IteratorEnumeration;
   import org.apache.commons.messagelet.MessageletRequest;
  +import org.apache.commons.messenger.Messenger;
   
   /** <p><code>HttpMessageletRequestImpl</code> represents a servlet request
from
     * a JMS Message source which appears to be a HTTP request so that JSP can process
     * the request as if it were a HTTP request.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.2 $
  +  * @version $Revision: 1.3 $
     */
   public class HttpMessageletRequestImpl extends HttpServletRequestWrapper implements MessageletRequest
{
   
  @@ -51,6 +52,13 @@
       public void setMessage(Message message) throws JMSException {
           this.message = message;
           this.stream = createInputStream();
  +        
  +        // also publish the message as a request scope attribute
  +        setAttribute( "message", message );
  +    }
  +
  +    public void setMessenger(Messenger messenger) {
  +        setAttribute( "messenger", messenger );
       }
       
       // MessageletRequest methods
  
  
  
  1.2       +5 -3      jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messagelet/impl/MessageHttpServletDispatcher.java
  
  Index: MessageHttpServletDispatcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messagelet/impl/MessageHttpServletDispatcher.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MessageHttpServletDispatcher.java	2001/10/30 11:14:31	1.1
  +++ MessageHttpServletDispatcher.java	2001/11/13 09:42:27	1.2
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    * 
  - * $Id: MessageHttpServletDispatcher.java,v 1.1 2001/10/30 11:14:31 jstrachan Exp $
  + * $Id: MessageHttpServletDispatcher.java,v 1.2 2001/11/13 09:42:27 jstrachan Exp $
    */
   package org.apache.commons.messagelet.impl;
   
  @@ -24,7 +24,7 @@
     * into a HttpServlet for procesing.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.1 $
  +  * @version $Revision: 1.2 $
     */
   public class MessageHttpServletDispatcher extends MessageDrivenObjectSupport implements
MessengerListener {
   
  @@ -66,7 +66,7 @@
       // MessengerListener methods
       //-------------------------------------------------------------------------       

       public void setMessenger(Messenger messenger) {
  -        response.setReplyMessenger( messenger );
  +        this.messenger = messenger;
       }
   
       /**
  @@ -87,6 +87,8 @@
           try {
               // initialise the request
               request.setMessage( message );
  +            request.setMessenger( messenger );
  +            response.setReplyMessenger( messenger );
               response.reset();
               
               // dispatch the servlet
  
  
  
  1.5       +11 -3     jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messagelet/impl/MessageletRequestImpl.java
  
  Index: MessageletRequestImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messagelet/impl/MessageletRequestImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MessageletRequestImpl.java	2001/10/30 11:14:31	1.4
  +++ MessageletRequestImpl.java	2001/11/13 09:42:27	1.5
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    * 
  - * $Id: MessageletRequestImpl.java,v 1.4 2001/10/30 11:14:31 jstrachan Exp $
  + * $Id: MessageletRequestImpl.java,v 1.5 2001/11/13 09:42:27 jstrachan Exp $
    */
   package org.apache.commons.messagelet.impl;
   
  @@ -29,12 +29,13 @@
   
   import org.apache.commons.collections.IteratorEnumeration;
   import org.apache.commons.messagelet.MessageletRequest;
  +import org.apache.commons.messenger.Messenger;
   
   /** <p><code>MessageletRequestImpl</code> represents a servlet request
from
     * a JMS Message source.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.4 $
  +  * @version $Revision: 1.5 $
     */
   public class MessageletRequestImpl extends ServletRequestWrapper implements MessageletRequest
{
   
  @@ -50,8 +51,15 @@
       public void setMessage(Message message) throws JMSException {
           this.message = message;
           this.stream = createInputStream();
  +        
  +        // also publish the message as a request scope attribute
  +        setAttribute( "message", message );
       }
  -    
  +
  +    public void setMessenger(Messenger messenger) {
  +        setAttribute( "messenger", messenger );
  +    }
  +
       // MessageletRequest methods
       //-------------------------------------------------------------------------    
       
  
  
  
  1.3       +11 -4     jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messagelet/impl/SubscriptionDigester.java
  
  Index: SubscriptionDigester.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messagelet/impl/SubscriptionDigester.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SubscriptionDigester.java	2001/10/26 13:29:35	1.2
  +++ SubscriptionDigester.java	2001/11/13 09:42:27	1.3
  @@ -5,19 +5,19 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    * 
  - * $Id: SubscriptionDigester.java,v 1.2 2001/10/26 13:29:35 jstrachan Exp $
  + * $Id: SubscriptionDigester.java,v 1.3 2001/11/13 09:42:27 jstrachan Exp $
    */
   package org.apache.commons.messagelet.impl;
   
  -import org.apache.commons.messenger.DigesterSupport;
  +import org.apache.commons.digester.Digester;
   
   /** <p><code>MessengerDigester</code> is a digester of Messenger objects
so 
     * that JMS Messengers can be created from an XML config file.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.2 $
  +  * @version $Revision: 1.3 $
     */
  -public class SubscriptionDigester extends DigesterSupport {
  +public class SubscriptionDigester extends Digester {
   
       // default implementation classes
       private String subscriptionsClass = "org.apache.commons.messagelet.impl.SubscriptionList";
  @@ -35,6 +35,13 @@
        * the cache config file
        */
       protected void configure() {
  +        if (configured) {
  +            return;
  +        }
  +        else {
  +            configured = true;
  +        }
  +        
           String path = "subscriptions";
           
           addObjectCreate( path, subscriptionsClass, "className" );
  
  
  
  1.3       +11 -3     jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/MessengerDigester.java
  
  Index: MessengerDigester.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/MessengerDigester.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MessengerDigester.java	2001/08/29 10:31:55	1.2
  +++ MessengerDigester.java	2001/11/13 09:42:27	1.3
  @@ -5,18 +5,19 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    * 
  - * $Id: MessengerDigester.java,v 1.2 2001/08/29 10:31:55 jstrachan Exp $
  + * $Id: MessengerDigester.java,v 1.3 2001/11/13 09:42:27 jstrachan Exp $
    */
   package org.apache.commons.messenger;
   
  +import org.apache.commons.digester.Digester;
   
   /** <p><code>MessengerDigester</code> is a digester of Messenger objects
so 
     * that JMS Messengers can be created from an XML config file.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.2 $
  +  * @version $Revision: 1.3 $
     */
  -public class MessengerDigester extends DigesterSupport {
  +public class MessengerDigester extends Digester {
   
       // default implementation classes
       private String messengerManagerClass = "org.apache.commons.messenger.MessengerManager";
  @@ -35,6 +36,13 @@
        * the cache config file
        */
       protected void configure() {
  +        if (configured) {
  +            return;
  +        }
  +        else {
  +            configured = true;
  +        }
  +        
           addObjectCreate( "manager", messengerManagerClass, "className" );
           addSetProperties( "manager" );
       
  
  
  
  1.4       +1 -5      jakarta-commons-sandbox/messenger/src/webapp/web/jms/time.jsp
  
  Index: time.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/webapp/web/jms/time.jsp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- time.jsp	2001/11/06 08:36:42	1.3
  +++ time.jsp	2001/11/13 09:42:27	1.4
  @@ -3,9 +3,5 @@
     <a><%= request.getParameter( "a" )%></a>
     <b><%= request.getParameter( "b" )%></b>
   
  -
  -  <jms:send destination="a.b" connection="orderQueue">
  -    hello!
  -  </jms:send>
  -
  +  <message><%= request.getAttribute( "message" )%></message>
   </echo>
  
  
  

--
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