staf.xml revision 23f633e1b8cc53fdac740eca4ab7e0341890bba2
<!--
! CDDL HEADER START
!
! The contents of this file are subject to the terms of the
! Common Development and Distribution License, Version 1.0 only
! (the "License"). You may not use this file except in compliance
! with the License.
!
! You can obtain a copy of the license at
! See the License for the specific language governing permissions
! and limitations under the License.
!
! When distributing Covered Code, include this CDDL HEADER in each
! file and include the License file at
! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
! add the following below this CDDL HEADER, with the fields enclosed
! by brackets "[]" replaced with your own identifying information:
! Portions Copyright [yyyy] [name of copyright owner]
!
! CDDL HEADER END
!
!
! Copyright 2008-2009 Sun Microsystems, Inc.
! -->
<project name="staf">
<description>
</description>
<!-- Install STAF and services -->
<target name="install">
<echo>Installing staf, please wait...</echo>
<if>
<not>
<available file="${staf.install.dir}/bin/STAF.cfg"/>
</not>
<then>
<mkdir dir="${tmp.dir}"/>
<!-- Install STAF -->
<echo>Installing staf, please wait...</echo>
<mkdir dir="${staf.install.dir}"/>
<untar dest="${tmp.dir}">
<fileset dir="${tmp.dir}">
<include name="*.tar"/>
</fileset>
</untar>
<arg value="-source"/>
<arg value="${tmp.dir}/staf"/>
<arg value="-target"/>
<arg value="${staf.install.dir}"/>
<arg value="-acceptlicense"/>
</exec>
<delete dir="${repository.dir}/staf"/>
<!-- Install services -->
<echo>Installing services, please wait...</echo>
<mkdir dir="${staf.install.dir}/services"/>
<unzip src="${archives.dir}/${email.archive}"
dest="${staf.install.dir}/services"/>
<unzip src="${archives.dir}/${event.archive}"
dest="${staf.install.dir}/services"/>
<unzip src="${archives.dir}/${eventmanager.archive}"
dest="${staf.install.dir}/services"/>
<unzip src="${archives.dir}/${stax.archive}"
dest="${staf.install.dir}/services"/>
<unzip src="${archives.dir}/${http.archive}"
dest="${staf.install.dir}/services"/>
<!-- Add DSML service extension -->
<mkdir dir="${staf.install.dir}/services/DSML"/>
<copy todir="${staf.install.dir}/services/DSML">
<fileset dir="${basedir}/staf-tests/shared/dsml"
includes="dsmlService.jar"/>
</copy>
<delete includeemptydirs="true">
</delete>
</then>
<else>
</else>
</if>
</target>
<!-- Uninstall STAF and services -->
<target name="uninstall">
<if>
<available file="${staf.install.dir}/bin/STAF.cfg"/>
<then>
<echo>Uninstalling staf, please wait...</echo>
<exec executable="${staf.install.dir}/STAFUninst"/>
<delete dir="${staf.install.dir}"/>
</then>
<else>
<echo>Staf is not installed</echo>
</else>
</if>
</target>
<!-- Start STAF -->
<target name="start">
<!-- Copy staf.cfg -->
<mkdir dir="${staf.config.dir}"/>
<filterchain>
<expandproperties/>
</filterchain>
</copy>
<if>
<not>
</not>
<then>
<delete dir="${staf.install.dir}/logs"/>
<echo>Starting staf, please wait...</echo>
<exec dir="${staf.bin.dir}"
executable="${staf.daemon}"
spawn="true">
<arg value="${staf.config.file}"/>
<env key="${var.path}" path="${java.path}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin"/>
<env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}:${project.home}/ext/svnkit/svnkit.jar:."/>
<env key="STAFCODEPAGE" value="LATIN_1"/>
<env key="STAF_INSTANCE_NAME" value="STAF"/>
</exec>
<echo>Waiting for service to become available...</echo>
<waitfor maxwait="3"
maxwaitunit="minute"
checkevery="10"
checkeveryunit="second"
timeoutproperty="timeout">
</waitfor>
<echo>STAF is now ready to serve requests</echo>
</then>
<else>
</else>
</if>
</target>
<!-- Stop STAF -->
<target name="stop">
<if>
<then>
<echo>Stopping staf, please wait...</echo>
<exec executable="${staf.executable}">
<arg line="local shutdown shutdown"/>
<env key="${var.path}" path="${java.path}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin"/>
</exec>
<echo>Waiting for service to shutdown gracefully...</echo>
<waitfor maxwait="3"
maxwaitunit="minute"
checkevery="10"
checkeveryunit="second"
timeoutproperty="timeoutSocketListening">
<not>
</not>
</waitfor>
<echo>STAF stopped</echo>
</then>
<else>
<echo>Staf is not running</echo>
</else>
</if>
</target>
<!-- Display STAF status -->
<target name="status">
<echo></echo>
<if>
<available file="${staf.install.dir}/bin/STAF.cfg"/>
<then>
</then>
<else>
<echo>Staf is not installed</echo>
</else>
</if>
<echo></echo>
<if>
<then>
</then>
<else>
<echo>Staf is not running</echo>
</else>
</if>
</target>
<!-- Display STAF gui -->
<target name="gui">
<exec dir="${staf.install.dir}"
spawn="true">
<env key="${var.path}" path="${java.path}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin"/>
<arg value="-classpath"/>
<arg value="${staf.install.dir}/services/stax/STAXMon.jar${path.separator}${staf.lib.dir}/JSTAF.jar"/>
</exec>
</target>
<!-- Display jvmlogs -->
<target name="jvmlogs">
<exec dir="${staf.install.dir}"
spawn="true">
<env key="${var.path}" path="${java.path}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin"/>
<arg value="-classpath"/>
<arg value="${staf.lib.dir}${path.separator}${staf.lib.dir}/JSTAF.jar"/>
<arg value="com.ibm.staf.STAFJVMLogViewer"/>
</exec>
</target>
</project>