<?xml version="1.0" encoding="UTF-8"?>
<project name="JMS_Samples" basedir=".">

   <property name="activemq.home" value=".." />

   <property name="PTP1" value=".\QueuePTPSamples\QueueMonitor"/>
   <property name="QMON" location=".\QueuePTPSamples\QueueMonitor\QueueMonitor.properties"/>
   <property name="PTP2" value=".\QueuePTPSamples\QueueRoundTrip"/>
   <property name="PTP3" value=".\QueuePTPSamples\RequestReply"/>
   <property name="PTP4" value=".\QueuePTPSamples\SelectorTalk"/>
   <property name="PTP5" value=".\QueuePTPSamples\Talk"/>
   <property name="PTP6" value=".\QueuePTPSamples\TransactedTalk"/>
   <property name="PS1" value=".\TopicPubSubSamples\Chat"/>
   <property name="PS2" value=".\TopicPubSubSamples\DurableChat"/>
   <property name="PS3" value=".\TopicPubSubSamples\HierarchicalChat"/>
   <property name="PS4" value=".\TopicPubSubSamples\MessageMonitor"/>
   <property name="PS5" value=".\TopicPubSubSamples\RequestReply"/>
   <property name="PS6" value=".\TopicPubSubSamples\SelectorChat"/>
   <property name="PS7" value=".\TopicPubSubSamples\TransactedChat"/>
   
   <property name="PUBSUB_SAMPLES" value="${PS1};${PS2};${PS3};${PS4};${PS5};${PS6};${PS7};"/>
   
   <property name="PTP_SAMPLES" value="${PTP1};${PTP2};${PTP3};${PTP4};${PTP5};${PTP6};"/>

	<target name="init">
		<path id="javac.classpath">
			<pathelement path="conf" />
			<fileset dir="../lib">
				<include name="**/*.jar" />
			</fileset>
		</path>
	</target>

	<target name="compile" depends="init" description="Compile all Java">
		<javac srcdir="${PTP1}"><classpath refid="javac.classpath"/></javac>
		<javac srcdir="${PTP2}"><classpath refid="javac.classpath"/></javac>
		<javac srcdir="${PTP3}"><classpath refid="javac.classpath"/></javac>
		<javac srcdir="${PTP4}"><classpath refid="javac.classpath"/></javac>
		<javac srcdir="${PTP5}"><classpath refid="javac.classpath"/></javac>
		<javac srcdir="${PTP6}"><classpath refid="javac.classpath"/></javac>
		<javac srcdir="${PS1}"><classpath refid="javac.classpath"/></javac>
		<javac srcdir="${PS2}"><classpath refid="javac.classpath"/></javac>
		<javac srcdir="${PS3}"><classpath refid="javac.classpath"/></javac>
		<javac srcdir="${PS4}"><classpath refid="javac.classpath"/></javac>		
		<javac srcdir="${PS5}"><classpath refid="javac.classpath"/></javac>		
		<javac srcdir="${PS6}"><classpath refid="javac.classpath"/></javac>	
		<javac srcdir="${PS7}"><classpath refid="javac.classpath"/></javac>
	</target>

   <target name="chat1" depends="compile" description="In the Chat application, whenever anyone sends a text message to a given
    topic, all active applications running Chat receive that message as subscribers
    to that topic. This is the most basic form of publish and subscribe activity.">
   	<java classname="Chat" fork="false">
		   <classpath>
             <path refid="javac.classpath"/>
             <pathelement path="${PUBSUB_SAMPLES}"/>
           </classpath>

   	       <arg value="-u"/>
   	       <arg value="Chatter1"/>
   	</java>
   </target>
   
  <target name="chat2" depends="compile" description="In the Chat application, whenever anyone sends a text message to a given
   topic, all active applications running Chat receive that message as subscribers
   to that topic. This is the most basic form of publish and subscribe activity.">
   	<java classname="Chat" fork="false">
		   <classpath>
          	 <path refid="javac.classpath"/>
             <pathelement path="${PUBSUB_SAMPLES}"/>
           </classpath>
   	       <arg value="-u"/>
   	       <arg value="Chatter2"/>
   	</java>
   </target>
   
  <target name="chat3" depends="compile" description="In the Chat application, whenever anyone sends a text message to a given
   topic, all active applications running Chat receive that message as subscribers
   to that topic. This is the most basic form of publish and subscribe activity.">
   	<java classname="Chat" fork="false">
		   <classpath>
       	     <path refid="javac.classpath"/>
             <pathelement path="${PUBSUB_SAMPLES}"/>
           </classpath>   	       
   		   <arg value="-u"/>
   	       <arg value="Chatter3"/>
   	</java>
   </target>
   
  <target name="durable1" depends="compile" description="In Pub/Sub messaging, when messages are produced, they are sent to all
   active consumers who subscribe to a topic. Some subscribers register an
   enduring interest in receiving messages that were sent while they were
   inactive. These durable subscriptions are permanent records in the broker’s
   persistent storage mechanism.">
   	<java classname="DurableChat" fork="false">
		   <classpath>
       	     <path refid="javac.classpath"/>
             <pathelement path="${PUBSUB_SAMPLES}"/>
           </classpath>
   		   <arg value="-u"/>
   	       <arg value="DurableChatter_1"/>
   	</java>
   </target>
   
  <target name="durable2" depends="compile" description="In Pub/Sub messaging, when messages are produced, they are sent to all
   active consumers who subscribe to a topic. Some subscribers register an
   enduring interest in receiving messages that were sent while they were
   inactive. These durable subscriptions are permanent records in the broker’s
   persistent storage mechanism.">
   	<java classname="DurableChat" fork="false">
		   <classpath>
       	     <path refid="javac.classpath"/>
             <pathelement path="${PUBSUB_SAMPLES}"/>
           </classpath>   		
   	       <arg value="-u"/>
   	       <arg value="DurableChatter_2"/>
   	</java>
   </target>

  <target name="durable3" depends="compile" description="In Pub/Sub messaging, when messages are produced, they are sent to all
   active consumers who subscribe to a topic. Some subscribers register an
   enduring interest in receiving messages that were sent while they were
   inactive. These durable subscriptions are permanent records in the broker’s
   persistent storage mechanism.">
   	<java classname="DurableChat" fork="false">
		   <classpath>
       	     <path refid="javac.classpath"/>
             <pathelement path="${PUBSUB_SAMPLES}"/>
           </classpath>
   	       <arg value="-u"/>
   	       <arg value="DurableChatter_3"/>
   	</java>
   </target>
   
  <target name="wildcard" depends="compile" description="The HierarchicalChat application is subscribing to a topic that
   ends in asterisk (*), a wildcard that accepts any topic with the root
   jms.samples. It is important to note that this is referred to a hierarchical
   wildcard, as it must be adjacent to dot delimiters.">
   	<java classname="HierarchicalChat" fork="false">
		   <classpath>
       	     <path refid="javac.classpath"/>
             <pathelement path="${PUBSUB_SAMPLES}"/>
           </classpath>
   	       <arg value="-u"/>
   	       <arg value="HierarchicalChatter"/>
   	</java>
   </target>
   
  <target name="tmonitor" depends="compile" description="The MessageMonitor sample application provides an example of a supervisory
   application with a graphical interface. By subscribing with the wildcard syntax
   used in the HierarchicalChat, the monitor gets messages on all topics in
   the topic hierarchy. The application listens for any message activity, and then
   displays each message in its window.">
   	<java classname="MessageMonitor" fork="true">
		   <classpath>
       	     <path refid="javac.classpath"/>
             <pathelement path="${PUBSUB_SAMPLES}"/>
           </classpath>   	
   	</java>
   </target>
   
  <target name="filterchat1" depends="compile" description="In the SelectorChat samples, each of the SelectorChat samples publishes
   to the jms.samples.chat topic with messages that have a property set to
   a different value, and then sets the subscriber to select only messages set to
   the appropriate property value.">
   	<java classname="SelectorChat" fork="false">
   	       <arg value="-u"/>
   	       <arg value="SelectiveChatter_1"/>
   	       <arg value="-s"/>
   	       <arg value="SelectiveChatter_1"/>
		   <classpath>
       	     <path refid="javac.classpath"/>
             <pathelement path="${PUBSUB_SAMPLES}"/>
           </classpath>
   	</java>
   </target>
   
  <target name="filterchat2" depends="compile" description="In the SelectorChat samples, each of the SelectorChat samples publishes
   to the jms.samples.chat topic with messages that have a property set to
   a different value, and then sets the subscriber to select only messages set to
   the appropriate property value.">
   	<java classname="SelectorChat" fork="false">
   	       <arg value="-u"/>
   	       <arg value="SelectiveChatter_2"/>
   	       <arg value="-s"/>
   	       <arg value="2"/>
		   <classpath>
       	     <path refid="javac.classpath"/>
             <pathelement path="${PUBSUB_SAMPLES}"/>
           </classpath>
   	</java>
   </target>
   
  <target name="xnchat" depends="compile" description="Transacted messages are a group of messages that form a single unit of work.
   Much like an accounting transaction made up of a set of balancing entries,
   a messaging example might be a set of financial statistics where each entry
   is a completely formed message and the full set of data comprises the update.
   A session is declared as transacted when the session is created. While
   producers—PTP Senders and Pub/Sub Publishers—produce messages as
   usual, the messages are stored at the broker until the broker is notified to act
   on the transaction by delivering or deleting the messages. To determine when
   the transaction is complete, the programmer must commit or rollback the set of messages.">
   	<java classname="TransactedChat" fork="false">
   	       <arg value="-u"/>
   	       <arg value="TransactedChatter"/>
		   <classpath>
       	     <path refid="javac.classpath"/>
             <pathelement path="${PUBSUB_SAMPLES}"/>
           </classpath>
   	</java>
   </target>
   
  <target name="talk1" depends="compile" description="In the Talk application, whenever a text message is sent to a given queue,
   all active Talk applications that are waiting to receive messages on that
   queue take turns receiving the message at the front of the queue.">
   	<java classname="Talk" fork="false">
   	       <arg value="-u"/>
   	       <arg value="Talker_1"/>
   	       <arg value="-qs"/>
   	       <arg value="Q1"/>
   	       <arg value="-qr"/>
   	       <arg value="Q2"/>
		   <classpath>
       	     <path refid="javac.classpath"/>
             <pathelement path="${PTP_SAMPLES}"/>
           </classpath>
   	</java>
   </target>
   
  <target name="talk2" depends="compile" description="In the Talk application, whenever a text message is sent to a given queue,
   all active Talk applications that are waiting to receive messages on that
   queue take turns receiving the message at the front of the queue.">
   	<java classname="Talk" fork="false">
   	       <arg value="-u"/>
   	       <arg value="Talker_2"/>
   	       <arg value="-qs"/>
   	       <arg value="Q2"/>
   	       <arg value="-qr"/>
   	       <arg value="Q1"/>
		   <classpath>
    	     <path refid="javac.classpath"/>
             <pathelement path="${PTP_SAMPLES}"/>
           </classpath>   		
   	</java>
   </target>
   
  <target name="talk3" depends="compile" description="In the Talk application, whenever a text message is sent to a given queue,
   all active Talk applications that are waiting to receive messages on that
   queue take turns receiving the message at the front of the queue.">
   	<java classname="Talk" fork="false">
   	       <arg value="-u"/>
   	       <arg value="Talker_3"/>
   	       <arg value="-qs"/>
   	       <arg value="Q3"/>
   	       <arg value="-qr"/>
   	       <arg value="Q1"/>
		   <classpath>
 	         <path refid="javac.classpath"/>
             <pathelement path="${PTP_SAMPLES}"/>
           </classpath> 
   	</java>
   </target>
   
  <target name="qmonitor" depends="compile" description="The QueueMonitor moves through a specified set of queues, listing the active
   messages it finds as it examines each queue. In the examples to this point,
   the Talk samples left no messages in any queue.">
   	<java classname="QueueMonitor" fork="true">
		   <classpath>
 	         <path refid="javac.classpath"/>
             <pathelement path="${PTP_SAMPLES}"/>
           </classpath> 
   	</java>
   </target>
   
  <target name="filtertalk1" depends="compile" description="The SelectorTalk sample applications are similar yet consistent with the
   behavior of the messaging model. The SelectiveTalkers both send and
   receive on Q1. The Talkers do not specify selection parameters.">
   	<java classname="SelectorTalk" fork="false">
   	       <arg value="-u"/>
   	       <arg value="SelectiveTalker_1"/>
   	       <arg value="-s"/>
   	       <arg value="1"/>
   	       <arg value="-qs"/>
   	       <arg value="Q1"/>
   	       <arg value="-qr"/>
   	       <arg value="Q1"/>
		   <classpath>
 	         <path refid="javac.classpath"/>
             <pathelement path="${PTP_SAMPLES}"/>
           </classpath> 
   	</java>
   </target>
   
  <target name="filtertalk2" depends="compile" description="The SelectorTalk sample applications are similar yet consistent with the
   behavior of the messaging model. The SelectiveTalkers both send and
   receive on Q1. The Talkers do not specify selection parameters.">
   	<java classname="SelectorTalk" fork="false">
   	       <arg value="-u"/>
   	       <arg value="SelectiveTalker_2"/>
   	       <arg value="-s"/>
   	       <arg value="2"/>
   	       <arg value="-qs"/>
   	       <arg value="Q1"/>
   	       <arg value="-qr"/>
   	       <arg value="Q1"/>
		   <classpath>
 	         <path refid="javac.classpath"/>
             <pathelement path="${PTP_SAMPLES}"/>
           </classpath> 
   	</java>
   </target>
   
  <target name="xntalk" depends="compile" description="The transaction samples show that the transaction scope is between the client
   in the JMS session and the broker. When the broker receives commitment,
   the messages are placed onto queues or topics in the order in which they
   were buffered as standard messages.">
   	<java classname="TransactedTalk" fork="false" classpath="${javac.classpath}">
   	       <arg value="-u"/>
   	       <arg value="TransactedTalker"/>
   	       <arg value="-qs"/>
   	       <arg value="Q1"/>
   	       <arg value="-qr"/>
   	       <arg value="Q2"/>
		   <classpath>
	         <path refid="javac.classpath"/>
             <pathelement path="${PTP_SAMPLES}"/>
           </classpath> 
   	</java>
   </target>
   
  <target name="qreply" depends="compile" description="In the PTP domain, the requestor application can be started and even send
   a message before the replier application is started. The queue holds the
   message until the replier is available. The requestor is still blocked, but when
   the replier’s message listener receives the message, it releases the blocked
   requestor. The sample code includes an option (-m) to switch the mode
   between uppercase and lowercase.">
   	<java classname="Replier" fork="false" classpath="${javac.classpath}">
   	       <arg value="-u"/>
   	       <arg value="ReplyingTalker"/>
		   <classpath>
	         <path refid="javac.classpath"/>
             <pathelement path="${PTP_SAMPLES}"/>
           </classpath> 
   	</java>
   </target>
   
  <target name="qrequest" depends="compile" description="In the PTP domain, the requestor application can be started and even send
   a message before the replier application is started. The queue holds the
   message until the replier is available. The requestor is still blocked, but when
   the replier’s message listener receives the message, it releases the blocked
   requestor. The sample code includes an option (-m) to switch the mode
   between uppercase and lowercase.">
   	<java classname="Requestor" fork="false" classpath="${javac.classpath}">
   	       <arg value="-u"/>
   	       <arg value="RequestingTalker"/>
		   <classpath>
	         <path refid="javac.classpath"/>
             <pathelement path="${PTP_SAMPLES}"/>
           </classpath> 
   	</java>
   </target>
   
  <target name="treply" depends="compile" description="In this example in the Pub/Sub domain, the replier application must be started
   before the requestor so that the Pub/Sub replier’s message listener can receive
   the message and release the blocked requestor.">
   	<java classname="Replier" fork="false" classpath="${javac.classpath}">
   	       <arg value="-u"/>
   	       <arg value="ReplyingChatter"/>
		   <classpath>
	         <path refid="javac.classpath"/>
             <pathelement path="${PUBSUB_SAMPLES}"/>
           </classpath> 
   	</java>
   </target>
   
  <target name="trequest" depends="compile" description="In this example in the Pub/Sub domain, the replier application must be started
   before the requestor so that the Pub/Sub replier’s message listener can receive
   the message and release the blocked requestor.">
   	<java classname="Requestor" fork="false" classpath="${javac.classpath}">
   	       <arg value="-u"/>
   	       <arg value="RequestingChatter"/>
		   <classpath>
	         <path refid="javac.classpath"/>
             <pathelement path="${PUBSUB_SAMPLES}"/>
           </classpath> 
   	</java>
   </target>
   
  <target name="roundtrip" depends="compile" description="The RoundTrip sample application sends a brief message to a sample queue
   and then uses a temporary queue to receive the message back. A counter is
   incremented and the message is sent for another trip. After completing the
   number of cycles you entered when you started the test, the run completes
   by displaying summary and average statistics.">
   	<java classname="QueueRoundTrip" fork="false" classpath="${javac.classpath}">
   	       <arg value="-u"/>
   	       <arg value="QueueRoundTrip"/>
   	       <arg value="-n"/>
   	       <arg value="10000"/>
		   <classpath>
	         <path refid="javac.classpath"/>
             <pathelement path="${PTP_SAMPLES}"/>
           </classpath> 
   	</java>
   </target>	
	
</project>
