Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 19427 invoked from network); 22 Jun 2002 23:54:57 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 22 Jun 2002 23:54:57 -0000 Received: (qmail 23271 invoked by uid 97); 22 Jun 2002 23:54:58 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 23215 invoked by uid 97); 22 Jun 2002 23:54:57 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 23190 invoked by uid 97); 22 Jun 2002 23:54:56 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 22 Jun 2002 23:54:41 -0000 Message-ID: <20020622235441.16493.qmail@icarus.apache.org> From: jstrachan@apache.org To: jakarta-commons-sandbox-cvs@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 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 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 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 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 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: For additional commands, e-mail: