Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
xml
xml
<?xml version="1.0" encoding="UTF-8"?>
<tns:ServerRuntime
	xmlns:tns="http://eclipse.org/jst/server/generic/ServerTypeDefinition"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://eclipse.org/jst/server/generic/ServerTypeDefinition"
	name="Apache ServiceMix 3.0" version="3.0">

	<property id="serverRootDirectory"
		label="%servicemix30.installation.path" type="directory"
		context="runtime" default="C:/servicemix-3.0" />

	<module>
		<type>jst.jbi.component</type>
		<publishDir>${serverRootDirectory}/install</publishDir>
		<publisherReference>org.eclipse.jst.server.generic.antpublisher</publisherReference>
	</module>
	
	<publisher id="org.eclipse.jst.server.generic.antpublisher">
		<publisherdata>
			<dataname>build.file</dataname>
			<datavalue>/buildfiles/servicemix30.xml</datavalue>
		</publisherdata>
		<publisherdata>
			<dataname>target.publish.jst.jbi.component</dataname>
			<datavalue>deploy.jbi.component</datavalue>
		</publisherdata>	
		<publisherdata>
			<dataname>target.unpublish.jst.jbi.component</dataname>
			<datavalue>undeploy.jbi.component</datavalue>
		</publisherdata>	
	</publisher>

	<project>
		<classpathReference>servicemix.project</classpathReference>
	</project>

	<start>
		<mainClass>org.codehaus.classworlds.Launcher</mainClass>
		<workingDirectory>${serverRootDirectory}</workingDirectory>
		<programArguments></programArguments>
		<vmParameters>
			-Xms128m
			-Dclassworlds.conf=${serverRootDirectory}\conf\servicemix.conf
			-Xmx512m
			-Djava.endorsed.dirs=${serverRootDirectory}\lib\endorsed
			-Dservicemix.home=${serverRootDirectory}
		</vmParameters>
		<classpathReference>servicemix</classpathReference>
	</start>

	<stop>
		<mainClass>org.probably.should.jbossdo.Shutdown<this</mainClass>
		<workingDirectory>${serverRootDirectory}/bin</workingDirectory>		
		<vmParameters></vmParameters>
		<classpathReference>jboss.shutdown<<classpathReference>servicemix</classpathReference>
	</stop>

	<publisher id="org.eclipse.jst.server.generic.antpublisher">
		<publisherdata>
			<dataname>build.file</dataname>
			<datavalue>/buildfiles/servicemix30.xml</datavalue>
		</publisherdata>
		<publisherdata>
			<dataname>target.publish.jbi</dataname>
			<datavalue>deploy.jbi.component</datavalue>
		</publisherdata>
		<publisherdata>
			<dataname>target.unpublish.jbi</dataname>
			<datavalue>undeploy.jbi.component</datavalue>
		</publisherdata>
	</publisher>

	<classpath id="servicemix">
		<archive path="${serverRootDirectory}/conf" />
		<archive
			path="${serverRootDirectory}/lib/classworlds-1.0.1.jar" />
	</classpath>

	<classpath id="servicemix.project">
		<archive path="${serverRootDirectory}/servicemix-3.0-M1.jar" />
	</classpath>
</tns:ServerRuntime>

Note that we use classworlds to get the server started, and yes we really ought to get the shutdown finished (smile)

Also note that we have used the ANT publisher in the definition of our servers, this means that the files buildfiles/servicemix30.xml will be used as the ANT project and when you choose to publish a JBI component or unpublish one the targets deploy.jbi.component and undeploy.jbi.component are used respectively. Note that in the server definition we also define classpath's for the server to use to start/stop and also for a project that will use this server definition to act as its runtime. This means we can get the classpath from the server when we are creating a project against it as a runtime, to make the project classpath available we need to add this extension point:

Code Block
xml
xml

    <extension point="org.eclipse.jst.server.core.runtimeClasspathProviders">
    	<runtimeClasspathProvider
	        id="org.eclipse.jst.server.generic.runtime.servicemix30"
	        runtimeTypeIds="org.eclipse.jst.server.generic.runtime.servicemix30"
	        class="org.eclipse.jst.server.generic.core.internal.GenericServerRuntimeTargetHandler"/>
    </extension>

So now thanks to the magic of WTP we have defined a module and a generic server to deal with it. Since we are proud of our creation so far we can use an extension point to give our runtime and server a nice icon.

Code Block
xml
xml

        <extension point="org.eclipse.wst.server.ui.serverImages">
		<image icon="/icons/servicemix.gif"
			id="org.apache.servicemix.server.image"
			typeIds="org.eclipse.jst.server.generic.servicemix30" />
		<image icon="/icons/servicemix.gif"
			id="org.apache.servicemix.server.image"
			typeIds="org.eclipse.jst.server.generic.runtime.servicemix30" />
	</extension>