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/test/org/apache/commons/jelly/jms sendObject.jelly flushQueue.jelly sendMessage.jelly receiveMap.jelly receiveObject.jelly sendText.jelly sendMap.jelly receive.jelly
Date Sat, 22 Jun 2002 23:56:11 GMT
jstrachan    2002/06/22 16:56:11

  Added:       jelly/src/test/org/apache/commons/jelly/jms sendObject.jelly
                        flushQueue.jelly sendMessage.jelly receiveMap.jelly
                        receiveObject.jelly sendText.jelly sendMap.jelly
                        receive.jelly
  Log:
  added a bunch of JMS example jelly scripts that demonstrate the JMS tag library in action
  
  Revision  Changes    Path
  1.1                  jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/sendObject.jelly
  
  Index: sendObject.jelly
  ===================================================================
  <?xml version="1.0"?>
  <jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
  
  About to send a JMS Object message
  
  <new className="java.util.Date" var="d"/>
  
  <jms:connection name="queue">
    <jms:send>
      <jms:destination name="myQueue"/>
      <jms:objectMessage object="${d}" type="Date" correlationID="4321"/>
    </jms:send>
  </jms:connection>
  
  Message sent!
  
  </jelly>
  
  
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/flushQueue.jelly
  
  Index: flushQueue.jelly
  ===================================================================
  <?xml version="1.0"?>
  <jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
  
  Flushing the input queue
  
  <jms:connection name="queue" var="conn">
    <forEach begin="1" end="1000">
      <jms:receive var="message" timeout="1">
        <jms:destination name="myQueue"/>
      </jms:receive>
      <if test="${message != null}">
  Found message: ${message}.
  	</if>
    </forEach>
    	
  </jms:connection>
  	
  </jelly>
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/sendMessage.jelly
  
  Index: sendMessage.jelly
  ===================================================================
  <?xml version="1.0"?>
  <jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
  
  About to send a JMS message
  
  <jms:connection name="queue">
    <jms:send>
      <jms:destination name="myQueue"/>
      <jms:message type="Pizza" correlationID="9999">
        <jms:property name="a" value="topping"/>
        <jms:property name="b" value="${123+456}"/>
        <jms:property name="c">cheese x ${2+2}</jms:property>
      </jms:message>
    </jms:send>
  </jms:connection>
  
  Message sent!
  
  </jelly>
  
  
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/receiveMap.jelly
  
  Index: receiveMap.jelly
  ===================================================================
  <?xml version="1.0"?>
  <jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
  
  Waiting until I receive a JMS message
  
  <jms:connection name="queue" var="conn">
    <jms:receive var="message">
      <jms:destination name="myQueue"/>
    </jms:receive>
  </jms:connection>
  
  Found message: ${message.JMSMessageID}.
  
  Map values are:
  <forEach items="${message.mapNames}" var="key">
    ${key} = ${message.getObject(key)}
  </forEach>
  	
  </jelly>
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/receiveObject.jelly
  
  Index: receiveObject.jelly
  ===================================================================
  <?xml version="1.0"?>
  <jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
  
  Waiting until I receive a JMS message
  
  <jms:connection name="queue" var="conn">
    <jms:receive var="message">
      <jms:destination name="myQueue"/>
    </jms:receive>
  </jms:connection>
  
  Found message: ${message}
  The object body is: ${message.getObject()}
  	
  </jelly>
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/sendText.jelly
  
  Index: sendText.jelly
  ===================================================================
  <?xml version="1.0"?>
  <jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
  
  About to send a JMS text message
  
  <jms:connection name="queue">
    <jms:send>
      <jms:destination>myQueue</jms:destination>
      <jms:textMessage type="Chat">This is some text via the tag body</jms:textMessage>
    </jms:send>
  
    <jms:send>
      <jms:destination name="myQueue"/>
      <jms:textMessage text="This is some text via the attribute" type="Chat"/>
    </jms:send>
  </jms:connection>
  
  Messages sent!
  
  </jelly>
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/sendMap.jelly
  
  Index: sendMap.jelly
  ===================================================================
  <?xml version="1.0"?>
  <jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
  
  About to send a JMS map message
  
  <jms:connection name="queue">
    <jms:send>
      <jms:destination name="myQueue"/>
      <jms:mapMessage type="Order" correlationID="1234">
        <jms:mapEntry name="a" value="pizza"/>
        <jms:mapEntry name="b">cheese</jms:mapEntry>
        <jms:mapEntry name="c" value="${12 * 20}"/>
      </jms:mapMessage>
    </jms:send>
  
    <new className="java.util.HashMap" var="m"/>
    <set target="${m}" property="a" value="pizza"/>  
    <set target="${m}" property="b" value="1234"/>  
    <set target="${m}" property="c" value="${12+57}"/>  
  
  Sending map message with map: ${m}
    
    <jms:send>
      <jms:destination name="myQueue"/>
      <jms:mapMessage type="Order2" correlationID="23456" map="${m}"/>
    </jms:send>
    
  </jms:connection>
  
  </jelly>
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jms/receive.jelly
  
  Index: receive.jelly
  ===================================================================
  <?xml version="1.0"?>
  <jelly xmlns="jelly:core" xmlns:jms="jelly:jms">
  
  Waiting until I receive a JMS message
  
  <jms:connection name="queue" var="conn">
    <jms:receive var="message">
      <jms:destination name="myQueue"/>
    </jms:receive>
  </jms:connection>
  
  Found message: ${message}
  
  Properties are:
  <forEach items="${message.propertyNames}" var="key">
    ${key} = ${message.getObjectProperty(key)}
  </forEach>
  
  The text body is: ${message.text}
  	
  </jelly>
  
  
  

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