<!--
 -
 - Licensed to the Apache Software Foundation (ASF) under one
 - or more contributor license agreements.  See the NOTICE file
 - distributed with this work for additional information
 - regarding copyright ownership.  The ASF 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 name="qpid-jca-example-geronimo-properties" basedir="." default="">

    <property name="jndi.scheme" value="name"/>

    <property name="qpid.xacf.jndi.name" value="QpidJMSXA"/>

    <property name="jndi.prefix" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/"/>


    <property name="qpid.hello.queue.jndi.name" value="HelloQueue"/>
    <property name="qpid.goodbye.queue.jndi.name" value="GoodByeQueue"/>
    <property name="qpid.hello.topic.jndi.name" value="HelloTopic"/>
    <property name="qpid.goodbye.topic.jndi.name" value="GoodByeTopic"/>
    <property name="qpid.request.queue.jndi.name" value="RequestQueue"/>
    <property name="qpid.response.queue.jndi.name" value="ResponseQueue"/>

    <!--
    <property name="qpid.cf.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/QpidConnectionFactory"/>
    <property name="qpid.hello.queue.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/HelloQueue"/>
    <property name="qpid.goodbye.queue.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/GoodByeQueue"/>
    <property name="qpid.hello.topic.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/HelloTopic"/>
    <property name="qpid.goodbye.topic.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/GoodByeTopic"/>
    <property name="qpid.request.queue.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/RequestQueue"/>
    <property name="qpid.response.queue.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/ResponseQueue"/>
    -->
    <property name="qpid.ejb.jndi.name" value="name=&quot;QpidTestEJB&quot;"/>
    <property name="qpid.ejb.name" value="QpidTestBeanRemote"/>
    <property name="qpid.client.cf.jndi.name" value="${jndi.prefix}/QpidConnectionFactory"/>
    <property name="qpid.client.dest.jndi.name" value="${jndi.prefix}/${qpid.hello.queue.jndi.name}"/>

    <property name="jndi.context" value="org.openejb.client.RemoteInitialContextFactory"/>
    <property name="server.host" value="ejbd://localhost:4201"/>
    <property name="geronimo.home" location="${env.GERONIMO_HOME}"/>
    <property name="geronimo.user" value="system"/>
    <property name="geronimo.password" value="manager"/>

    <property name="geronimo.rar.group.id" value="qpid.jca"/>
    <property name="geronimo.rar.artifact.id" value="QpidJCAAdapter"/>
    <property name="geronimo.rar.version" value="1.0"/>
    <property name="geronimo.rar.type" value="rar"/>
    <property name="geronimo.rar.id" value="${geronimo.rar.group.id}/${geronimo.rar.artifact.id}/${geronimo.rar.version}/${geronimo.rar.type}"/>

    <property name="geronimo.ejb.group.id" value="qpid.jca.example"/>
    <property name="geronimo.ejb.artifact.id" value="QpidJCAEJBExample"/>
    <property name="geronimo.ejb.version" value="1.0"/>
    <property name="geronimo.ejb.type" value="car"/>
    <property name="geronimo.ejb.id" value="${geronimo.ejb.group.id}/${geronimo.ejb.artifact.id}/${geronimo.ejb.version}/${geronimo.ejb.type}"/>

    <property name="geronimo.war.group.id" value="qpid.jca.example"/>
    <property name="geronimo.war.artifact.id" value="QpidJCAWebExample"/>
    <property name="geronimo.war.version" value="1.0"/>
    <property name="geronimo.war.type" value="war"/>
    <property name="geronimo.war.id" value="${geronimo.war.group.id}/${geronimo.war.artifact.id}/${geronimo.war.version}/${geronimo.war.type}"/>

    <property name="geronimo.ear.group.id" value="qpid.jca.example"/>
    <property name="geronimo.ear.artifact.id" value="QpidJCAEARExample"/>
    <property name="geronimo.ear.version" value="1.0"/>
    <property name="geronimo.ear.type" value="ear"/>
    <property name="geronimo.ear.id" value="${geronimo.ear.group.id}/${geronimo.ear.artifact.id}/${geronimo.ear.version}/${geronimo.ear.type}"/>

    <property name="geronimo.rar.plan" value="${gen.dir}/geronimo-ra.xml"/>
    <property name="geronimo.ear.plan" value="${gen.dir}/geronimo-application.xml"/>

    <available file="${geronimo.home}/bin/deploy" value="deploy" property="geronimo.deploy.exec"/>
    <property name="geronimo.deploy.exec" value="deploy.sh"/>

    <path id="compile.classpath">
        <fileset dir="${geronimo.home}/repository/org/apache/geronimo/specs">
            <include name="geronimo-jms_1.1_spec/1.1.1/geronimo-jms_1.1_spec-1.1.1.jar"/>
            <include name="geronimo-servlet_2.5_spec/1.2/geronimo-servlet_2.5_spec-1.2.jar"/>
            <include name="geronimo-ejb_3.0_spec/1.0.1/geronimo-ejb_3.0_spec-1.0.1.jar"/>
            <include name="geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1.jar"/>

            <!--Geronimo 3.x-->
            <include name="geronimo-servlet_3.0_spec/1.0/geronimo-servlet_3.0_spec-1.0.jar"/>
            <include name="geronimo-ejb_3.1_spec/1.0.2/geronimo-ejb_3.1_spec-1.0.2.jar"/>
        </fileset>

        <fileset dir="${qpid.jca.dir}">
            <include name="slf4j-api-*.jar"/>
        </fileset>

    </path>

    <path id="run.classpath">
        <fileset dir="${lib.dir}">
            <include name="qpid-jca-*.jar"/>
            <include name="qpid-client-*.jar"/>
            <include name="qpid-common-*.jar"/>
            <!-- Old jar, for examples compatibility -->
            <include name="qpid-ra-*.jar"/>
        </fileset>
        <fileset dir="${geronimo.home}/repository/org/apache/geronimo/specs">
            <include name="geronimo-j2ee-connector_1.5_spec/2.0.0/geronimo-j2ee-connector_1.5_spec-2.0.0.jar"/>
            <include name="geronimo-jms_1.1_spec/1.1.1/geronimo-jms_1.1_spec-1.1.1.jar"/>
            <include name="geronimo-servlet_2.5_spec/1.2/geronimo-servlet_2.5_spec-1.2.jar"/>
            <include name="geronimo-ejb_3.0_spec/1.0.1/geronimo-ejb_3.0_spec-1.0.1.jar"/>
            <include name="geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1.jar"/>
        </fileset>
        <fileset dir="${geronimo.home}/lib/">
            <include name="slf4j-api-*.jar"/>
            <include name="slf4j-log4j*-*.jar"/>
            <include name="log4j-*.jar"/>
        </fileset>
         <fileset dir="${geronimo.home}/repository/org/apache/openejb/openejb-client/3.1.4/"/>
    </path>

    <filterset id="extra.filterset">
        <filter token="geronimo.ejb.group.id" value="${geronimo.ejb.group.id}"/>
        <filter token="geronimo.ejb.artifact.id" value="${geronimo.ejb.artifact.id}"/>
        <filter token="geronimo.ejb.version" value="${geronimo.ejb.version}"/>
        <filter token="geronimo.ejb.type" value="${geronimo.ejb.type}"/>
        <filter token="geronimo.war.group.id" value="${geronimo.war.group.id}"/>
        <filter token="geronimo.war.artifact.id" value="${geronimo.war.artifact.id}"/>
        <filter token="geronimo.war.version" value="${geronimo.war.version}"/>
        <filter token="geronimo.war.type" value="${geronimo.war.type}"/>
        <filter token="geronimo.ear.group.id" value="${geronimo.ear.group.id}"/>
        <filter token="geronimo.ear.artifact.id" value="${geronimo.ear.artifact.id}"/>
        <filter token="geronimo.ear.version" value="${geronimo.ear.version}"/>
        <filter token="geronimo.ear.type" value="${geronimo.ear.type}"/>
    </filterset>

    <macrodef name="geronimo">
        <attribute name="user" default="${geronimo.user}"/>
        <attribute name="password" default="${geronimo.password}"/>
        <attribute name="action" default="list-modules"/>
        <attribute name="module"/>
        <attribute name="plan" default=""/>
        <sequential>
            <exec executable="${geronimo.home}/bin/${geronimo.deploy.exec}">
                <arg line="-u @{user} -p @{password} @{action} @{module} @{plan}"/>
            </exec>
        </sequential>
    </macrodef>

    <!-- Deployment is target specific so is included here -->
    <target name="deploy-rar" depends="generate" description="Deploy the RAR file.">
        <geronimo action="deploy" module="${qpid.jca.dir}/${rar.name}" plan="${geronimo.rar.plan}"/>
    </target>

    <target name="undeploy-rar" description="Undeploys the RAR deployment.">
        <geronimo action="undeploy" module="${geronimo.rar.id}"/>
    </target>

    <target name="start-rar" description="Starts the RAR deployment in the Geronimo environment.">
        <geronimo action="start" module="${geronimo.rar.id}"/>
    </target>

    <target name="stop-rar" description="Stops the RAR deployment in the Geronimo environment.">
        <geronimo action="stop" module="${geronimo.rar.id}"/>
    </target>

    <target name="restart-rar" description="Restarts the RAR deployment in the Geronimo environment.">
        <geronimo action="restart" module="${geronimo.rar.id}"/>
    </target>

    <target name="deploy-ear" depends="package-ear" description="Deploys the EAR archive.">
        <geronimo action="deploy" module="${build.dir}/${ear.name}" plan="${geronimo.ear.plan}"/>
    </target>

    <target name="undeploy-ear" description="Undeployes the EAR archive.">
        <geronimo action="undeploy" module="${geronimo.ear.id}"/>
    </target>

    <target name="start-ear" description="Starts the EAR deployment in the Geronimo environment.">
        <geronimo action="start" module="${geronimo.ear.id}"/>
    </target>

    <target name="stop-ear" description="Stops the EAR deployment in the Geronimo environment.">
        <geronimo action="stop" module="${geronimo.ear.id}"/>
    </target>

    <target name="restart-ear" description="Restarts the EAR deployment in the Geronimo environment.">
        <geronimo action="restart" module="${geronimo.ear.id}"/>
    </target>

</project>
