Resin 3 EE Application Server Module

Public Targets

TargetDescription
deploydeploys archive to jboss
undeployremoves archive from jboss deploy folder
fdeploycopy deployment folder to jboss
fundeployremoves deployment folder from jboss
startstart resin
stopstop resin

Source: appserver-resin3.xml

				<?xml version="1.0" encoding="UTF-8"?>
<project name="appserver" default="default" basedir=".">
	<description>
  + ==\_/============J=A=V=A=G=E=N===A=N=T===M=O=D=U=L=E=S================= +
  +  \(_)/                                                                  +
  +  -(_)-           Resin 3 EE Application Server Module                   +
  +  /(_)\                                                                  +
  + ======================================================================= +
  +    Copyright (c) 2002-2005 Outsource Cafe, Inc.  All rights reserved.   +
  + ======================================================================= +
  +
  + THIS NEEDS WORK!!  -  EJB packaging is funky, requires special handling...
  +
  + This file defines Resin properties and targets.
  + This file implements the standard targets for application servers.
  + 
  + Interface: check.appserver, verify, deploy, undeploy
  + Prerequisites: ${dist.name}, ${dist.dir}, ${module.name},
  + 
  + developer: RichardEasterling@OutsourceCafe.com
  + ======================================================================= +
  + Licensed 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.
  + =J=A=M===========================================J=A=V=A=G=E=N=.=C=O=M= +
   </description>
	<property name="APPSERVER.PRESENT" value="true"></property>
	<property name="RESIN3.PRESENT" value="true"></property>
	<!-- override jspc properties: 
	<property name="build.jspc.java.folder" location="work"/>
	<property name="build.jspc.classes.dir" location="${build.jspc.java.dir}"/>
	-->
	<!-- Resin wants to see the namespaces for tag libraries -->
	<property name="web.jsp.namespaces" value="true"></property>
	<!-- ==================================================================== -->
	<!-- Resin properties: -->
	<!-- ==================================================================== -->
	<!-- db settings 
	<property name="resin.datasource.name" value="java:/DefaultDS"/>
	<property name="resin.type.mapping" value="Hypersonic SQL"/>
	-->
	<!-- resin properties -->
	<property environment="env"></property>
	<property name="resin.home" location="${env.RESIN_HOME}"></property>
	<property name="resin.version" value="3.0.6"></property>
	<property name="resin.lib" location="${resin.home}/lib"></property>
	<property name="resin.client.jar" location="${resin.lib}/resin-ejb.jar"></property>
	<!-- global app server settings -->
	<property name="appserver.name" value="Resin EE"></property>
	<property name="appserver.version" value="3.0.x"></property>
	<property name="appserver.deploy.dir" location="${resin.home}/deploy"></property>
	<property name="appserver.http.port" value="8080"></property>
	<property name="appserver.host" value="localhost"></property>
	<property name="appserver.start.delay" value="45"></property>
	<property name="appserver.deploy.delay" value="15"></property>
	<!-- log.folder is relative to RESIN_HOME folder -->
	<property name="appserver.log.folder" value="log/"></property>
	<!-- ==================================================================== -->
	<!-- Resin client properties: -->
	<!-- ==================================================================== -->
	<!--
	<jndi-factory>com.caucho.ejb.BurlapContextFactory</jndi-factory>
   <init-param java.naming.provider.url="http://localhost:8080/cmp/example"/>
	<property name="appserver.java.naming.provider.url" value="jnp://localhost:1099"/>
	<property name="appserver.java.naming.factory.initial" value="com.caucho.burlap.BurlapContextFactory"/>
	-->
	<property name="appserver.java.naming.factory.initial" value="com.caucho.naming.InitialContextFactoryImpl"></property>
	<property name="appserver.java.naming.provider.url" value="http://localhost:8080/cmp"></property>
	<property name="appserver.java.naming.factory.url.pkgs" value="com.caucho.naming"></property>
	<path id="appserver.client.classpath">
		<fileset dir="${resin.lib}">
			<include name="*.jar"></include>
		</fileset>
	</path>
	<!-- ==================================================================== -->
	<!-- Resin setup checks: -->
	<!-- ==================================================================== -->
	<target name="check.appserver" depends="check.resin">
		<available property="resin.present" file="${resin.home}/lib/resin.jar"></available>
		<antcall target="check.wrong.resin"></antcall>
	</target>
	<target name="check.resin" unless="resin.home">
		<fail>Property "resin.home" is not set. Please use the file "resin-ee-*.xml" in the ${basedir} directory to set this property. It must point to the directory which contains the following directory: "bin", "lib", "webapps" etc.</fail>
	</target>
	<target name="check.wrong.resin" unless="resin.present">
		<fail>Property "resin.home" is set but it does not seem to point to the right directory. The file "resin.jar" must be available at ${resin.home}/lib. </fail>
	</target>
	<!-- =================================================================== -->
	<!-- verify ejb jar files using jboss verifier -->
	<!-- =================================================================== -->
	<target name="verify" depends="">
		<echo>  NOT IMPLEMENTED...</echo>
		<!--
		<java classname="org.jboss.verifier.Main" fork="true" failonerror="true">
			<classpath refid="xdoclet.path"/>
			<arg value="${build.ejb.jar.dir}/${ejb.deploy.file}.jar"/>
		</java>
		-->
	</target>
	<!-- =================================================================== -->
	<!-- deploy archive (jar/war/ear) to server                                            -->
	<!-- =================================================================== -->
	<target name="deploy" depends="" description="deploys archive to jboss">
		<copy todir="${appserver.deploy.dir}">
			<fileset dir="${dist.dir}" includes="${dist.name}"></fileset>
		</copy>
	</target>
	<!-- =================================================================== -->
	<!-- remove archive (jar/war/ear) from server                                          -->
	<!-- =================================================================== -->
	<target name="undeploy" description="removes archive from jboss deploy folder">
		<delete file="${appserver.deploy.dir}/${dist.name}"></delete>
	</target>
	<!-- =================================================================== -->
	<!-- deploy files to server                                            -->
	<!-- =================================================================== -->
	<target name="fdeploy" depends="" description="copy deployment folder to jboss">
		<mkdir dir="${appserver.deploy.dir}/${dist.name}"></mkdir>
		<unzip src="${dist.file}" dest="${appserver.deploy.dir}/${dist.name}"></unzip>
	</target>
	<!-- =================================================================== -->
	<!-- remove deployment files from server - server must be stopped        -->
	<!-- =================================================================== -->
	<target name="fundeploy" description="removes deployment folder from jboss">
		<delete dir="${appserver.deploy.dir}/${dist.name}"></delete>
	</target>
	<!-- =================================================================== -->
	<!-- deploydelay -->
	<!-- =================================================================== -->
	<target name="deploydelay">
		<echo>sleeping ${appserver.deploy.delay}s...</echo>
		<sleep seconds="${appserver.deploy.delay}"></sleep>
	</target>
	<!-- =================================================================== -->
	<!-- verify war file -->
	<!-- =================================================================== -->
	<target name="war.verify">
		<echo>war.verify NOT IMPLEMENTED...</echo>
	</target>
	<!-- =================================================================== -->
	<!-- start resin -->
	<!-- =================================================================== -->
	<!--
usage: Resin [flags]
  -h                 : this help
  -verbose           : information on launching java
  -java_home <dir>   : sets the JAVA_HOME
  -java_exe <path>   : path to java executable
  -resin_home <dir>  : home of Resin
  -classpath <dir>   : java classpath
  -Jxxx              : JVM arg xxx
  -Dfoo=bar          : Set JVM variable
  -Xxxx              : JVM -X parameter
  -install           : install as NT service
  -install-as <name> : install as a named NT service
  -remove            : remove as NT service
  -remove-as <name>  : remove as a named NT service
  -conf <resin.conf> : alternate configuration file
  -port <port>       : TCP port to listen to
  
  TODO: THIS NEEDS WORK!!!
  	-->
	<target name="start" depends="started" unless="server.started" description="start resin">
		<java classname="com.caucho.server.http.ResinServer" fork="yes">
			<jvmarg value="-Djava.util.logging.manager=com.caucho.log.LogManagerImpl"></jvmarg>
			<jvmarg value="-Dprogram.name=${resin.home}/bin/httpd.exe"></jvmarg>
			<arg line="-conf"></arg>
			<arg line="${resin.home}/conf/resin.conf"></arg>
			<classpath>
				<path refid="appserver.client.classpath"></path>
				<pathelement location="${tools.jar}"></pathelement>
			</classpath>
		</java>
	</target>
	<target name="started">
		<condition property="server.started">
			<and>
				<socket port="${appserver.http.port}" server="${appserver.host}"></socket>
			</and>
		</condition>
		<echo>server.started = ${server.started}</echo>
	</target>
	<!-- =================================================================== -->
	<!-- stop resin -->
	<!-- =================================================================== -->
	<target name="stop" depends="stopped" if="can.end" description="stop resin">
		<!--
		<java classname="com.caucho.server.http.ResinServer" fork="yes">
			<jvmarg value="-Djava.util.logging.manager=com.caucho.log.LogManagerImpl"/>
			<arg line="-conf"/>
			<arg line="${resin.home}/conf/resin.conf"/>
			<classpath>
				<path refid="appserver.client.classpath"/>
				<pathelement location="${tools.jar}"/>
			</classpath>
		</java>
		<echo>sleeping 4s...</echo>
		<sleep seconds="4"/>
		-->
		<echo>stop NOT IMPLEMENTED</echo>
	</target>
	<target name="stopped">
		<condition property="can.end">
			<and>
				<socket port="${appserver.http.port}" server="${appserver.host}"></socket>
				<not>
					<isset property="server.started"></isset>
				</not>
			</and>
		</condition>
		<echo>can.end = ${can.end}</echo>
	</target>
	<!-- =================================================================== -->
	<!-- ejb-jar resin 3.0.6 fix removing method-permission and m-param tags -->
	<!-- add to 'gen' target after ejbdoclet generates ejb-jar.xml -->
	<!-- =================================================================== -->
	<target name="resin.ejb.patch" if="RESIN3.PRESENT">
		<move file="${xdoclet.build.metainf.dir}/ejb-jar.xml" tofile="${xdoclet.build.metainf.dir}/ejb-jar.junk"></move>
		<xslt basedir="${xdoclet.build.metainf.dir}" destdir="${xdoclet.build.metainf.dir}" includes="ejb-jar.junk" style="${javagen-ant}/xsl/ejb-jar-resin-patch.xsl" extension=".xml">
			<!--param name="includeFolder" expression="${html.page.includeFolder}"/-->
			<xmlcatalog refid="j2ee.catalog"></xmlcatalog>
		</xslt>
		<delete file="${xdoclet.build.metainf.dir}/ejb-jar.junk" failonerror="false"></delete>
	</target>
	<!--
> Hi, 
> I have done some kind of automated "batch script" to precompile de jsps using the -compile-host -compile resin server parameters. 
> Here is: 

> time /T 
> @echo off 
> SET OLD_CLASSPATH=%CLASSPATH% 
> SET CLASSPATH=%JAVA_HOME%\lib\tools.jar;jar/resin/resin.jar;jar/resin/dom.jar;jar/resin/jaxp.jar;jar/resin/jndi.jar;jar/resin/jsdk23.jar;jar/resin/jta-spec1_0_1.jar;jar/resin/sax.jar;jar/resin/webutil.jar;jar/resin/jdbc2_0-stdext.jar;jar/resin/jmx.jar 
> SET NEWKNOW_HOST=localhost:88 
> SET PRECOMPILE_CMD=%JAVA_HOME%\bin\java -Dresin.home=. com.caucho.server.http.HttpServer -conf etc/resin.conf -compile-host %NEWKNOW_HOST% -compile 
> %PRECOMPILE_CMD% /navigation/views/adaptationView.jsp /navigation/views/addRateView.jsp XXXXX/XXXX.jsp 
>	-->
	<!-- END RESIN-WEBAPP-MODULE============================================ -->
</project>