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/jelly/src/java/org/apache/commons/jelly/tags/jms SendTag.java ObjectMessageTag.java JMSTagLibrary.java ReceiveTag.java TextMessageTag.java
Date Sat, 22 Jun 2002 23:54:41 GMT
jstrachan    2002/06/22 16:54:41

  Modified:    jelly/src/java/org/apache/commons/jelly/tags/jms
                        SendTag.java ObjectMessageTag.java
                        JMSTagLibrary.java ReceiveTag.java
                        TextMessageTag.java
  Log:
  Patched code so that the JMS tags appear to work now
  
  Revision  Changes    Path
  1.2       +3 -0      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/jms/SendTag.java
  
  Index: SendTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/jms/SendTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SendTag.java	22 Jun 2002 16:55:50 -0000	1.1
  +++ SendTag.java	22 Jun 2002 23:54:41 -0000	1.2
  @@ -84,6 +84,9 @@
       // Tag interface
       //-------------------------------------------------------------------------       
            
       public void doTag(XMLOutput output) throws Exception {
  +        // evaluate body as it may contain a <destination> or message tag
  +        getBody().run(context, output);
  +        
           Message message = getMessage();
           if ( message == null ) {
               throw new JellyException( "No message specified. Either specify a 'message'
attribute or use a nested <jms:message> tag" );
  
  
  
  1.2       +7 -4      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/jms/ObjectMessageTag.java
  
  Index: ObjectMessageTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/jms/ObjectMessageTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ObjectMessageTag.java	22 Jun 2002 16:55:50 -0000	1.1
  +++ ObjectMessageTag.java	22 Jun 2002 23:54:41 -0000	1.2
  @@ -72,7 +72,7 @@
     */
   public class ObjectMessageTag extends MessageTag {
   
  -    private Serializable body;
  +    private Serializable object;
       
       public ObjectMessageTag() {
       }
  @@ -82,14 +82,17 @@
       
       /**
        * Sets the body of the message, a serializable java object.
  +     * If this value is not set or the value is null then the content 
  +     * of the tag will be used instead.
        */
  -    public void setBody(Serializable body) {
  -        this.body = body;
  +    public void setObject(Serializable object) {
  +        this.object = object;
       }
       
       // Implementation methods
       //-------------------------------------------------------------------------       
                    
       protected Message createMessage() throws Exception {
  -        return getConnection().createObjectMessage(body);
  +        Serializable value = (object != null) ? object : getBodyText();
  +        return getConnection().createObjectMessage(value);
       }    
   }    
  
  
  
  1.2       +1 -0      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/jms/JMSTagLibrary.java
  
  Index: JMSTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/jms/JMSTagLibrary.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JMSTagLibrary.java	22 Jun 2002 16:55:50 -0000	1.1
  +++ JMSTagLibrary.java	22 Jun 2002 23:54:41 -0000	1.2
  @@ -74,6 +74,7 @@
           registerTag("connection", ConnectionTag.class);
           registerTag("destination", DestinationTag.class);
           registerTag("mapEntry", MapEntryTag.class);
  +        registerTag("mapMessage", MapMessageTag.class);
           registerTag("message", MessageTag.class);
           registerTag("objectMessage", ObjectMessageTag.class);
           registerTag("property", PropertyTag.class);
  
  
  
  1.2       +3 -0      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/jms/ReceiveTag.java
  
  Index: ReceiveTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/jms/ReceiveTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReceiveTag.java	22 Jun 2002 16:55:50 -0000	1.1
  +++ ReceiveTag.java	22 Jun 2002 23:54:41 -0000	1.2
  @@ -83,6 +83,9 @@
       // Tag interface
       //-------------------------------------------------------------------------       
            
       public void doTag(XMLOutput output) throws Exception {
  +        // evaluate body as it may contain a <destination> tag
  +        getBody().run(context, output);
  +        
           Destination destination = getDestination();
           if ( destination == null ) {
               throw new JellyException( "No destination specified. Either specify a 'destination'
attribute or use a nested <jms:destination> tag" );
  
  
  
  1.2       +16 -3     jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/jms/TextMessageTag.java
  
  Index: TextMessageTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/jms/TextMessageTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TextMessageTag.java	22 Jun 2002 16:55:50 -0000	1.1
  +++ TextMessageTag.java	22 Jun 2002 23:54:41 -0000	1.2
  @@ -70,14 +70,27 @@
     */
   public class TextMessageTag extends MessageTag {
   
  +    private String text;
  +    
       public TextMessageTag() {
       }
  -
  +    
  +    // Properties
  +    //-------------------------------------------------------------------------       
                        
  +    
  +    /**
  +     * Sets the body of the message, a String. If this value is not set or
  +     * the value is null then the content of the tag will be used instead.
  +     */
  +    public void setText(String text) {
  +        this.text = text;
  +    }
  +    
       
       // Implementation methods
       //-------------------------------------------------------------------------       
                    
       protected Message createMessage() throws Exception {
  -        String text = getBodyText();
  -        return getConnection().createTextMessage(text);
  +        String value = (text != null) ? text : getBodyText();
  +        return getConnection().createTextMessage(value);
       }    
   }    
  
  
  

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