All Downloads are FREE. Search and download functionalities are using the official Maven repository.

examples.jms.clustered-standalone.build.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project [
      <!ENTITY libraries SYSTEM "../../../thirdparty/libraries.ent">
      ]>
<!--
  ~ Copyright 2009 Red Hat, Inc.
  ~ Red Hat licenses this file to you under the Apache License, version
  ~ 2.0 (the "License"); you may not use this file except in compliance
  ~ with the License.  You may obtain a copy of the License at
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  ~ implied.  See the License for the specific language governing
  ~ permissions and limitations under the License.
  -->

<project default="run" name="HornetQ Clustered Standalone Example">

   <import file="../../common/build.xml"/>

   <target name="runRemote">
      <antcall target="runExample">
         <param name="example.classname" value="org.hornetq.jms.example.ClusteredStandaloneExample"/>
         <param name="hornetq.example.runServer" value="false"/>
      </antcall>
   </target>

	<!-- the example can be ran automatically from the distribution only -->
   <target name="run">
   	<property name="distro.bin.dir" value="../../../bin"/>

      <condition property="from.distro">
         <available file="${distro.bin.dir}/run.sh" />
      </condition>

      <antcall target="run-from-distro" />
   </target>

   <target name="run-from-distro" if="from.distro">
   	<property name="distro.bin.dir" value="../../../bin"/>
   	<echo message="${os.name}" />

   	<!-- start 3 clustered servers in parallel                   -->
   	<!-- then wait for 1 minute and run the example              -->
   	<!-- finally, stop the servers once the example has finished -->

      <property name="unix.arg" value="run.sh  ../config/stand-alone/clustered"/>
      <property name="windows.arg" value="/c run.bat ..\\config\\stand-alone\\clustered"/>
      <property name="cluster.props.node2" value="-Ddata.dir=../data-server2 -Djnp.port=2099 -Djnp.rmiPort=2098 -Dhornetq.remoting.netty.port=6445"/>
      <property name="cluster.props.node3" value="-Ddata.dir=../data-server3 -Djnp.port=3099 -Djnp.rmiPort=3098 -Dhornetq.remoting.netty.port=7445"/>
      <parallel>
         <sequential>

            <echo>Starting 3 clustered servers</echo>
            <parallel>
               <!-- start the 1st clustered server with default configuration -->
               <exec dir="${distro.bin.dir}" executable="sh" osfamily="unix">
                  <arg line="${unix.arg}"/>
               </exec>
               <exec dir="${distro.bin.dir}" executable="cmd" osfamily="windows">
                  <arg line="${windows.arg}"/>

               </exec>

               <!-- start the 2nd clustered server with modified configuration -->
               <exec dir="${distro.bin.dir}" executable="sh" osfamily="unix">
                  <env key="CLUSTER_PROPS" value="${cluster.props.node2}"/>
                <arg line="${unix.arg}"/>
               </exec>
                <exec dir="${distro.bin.dir}" executable="cmd" osfamily="windows">
                   <env key="CLUSTER_PROPS" value="${cluster.props.node2}" />
                   <arg line="${windows.arg}"/>

                </exec>

                <!-- start the 3rd clustered server with modified configuration -->
                <exec dir="${distro.bin.dir}" executable="sh" osfamily="unix">
                   <env key="CLUSTER_PROPS" value="${cluster.props.node3}"/>
                    <arg line="${unix.arg}"/>
                </exec>
                 <exec dir="${distro.bin.dir}" executable="cmd" osfamily="windows">
                    <env key="CLUSTER_PROPS" value="${cluster.props.node3}"/>

                    <arg line="${windows.arg}"/>
                 </exec>
            </parallel>
         </sequential>
         <sequential>
            <sleep minutes="1" />
            <echo>Running example</echo>
            <antcall target="runRemote"></antcall>

            <echo>Stopping servers</echo>
            <exec dir="${distro.bin.dir}" executable="sh" osfamily="unix">
               <arg line="stop.sh ../config/stand-alone/clustered"/>
            </exec>
            <exec dir="${distro.bin.dir}" executable="cmd" osfamily="windows">
               <arg line="/c stop.bat ..\\config\\stand-alone\\clustered"/>
            </exec>
         </sequential>

      </parallel>
   </target>

</project>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy