Versions Compared

Key

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

...

Code Block
xml
xml
<extension point="org.eclipse.wst.server.core.moduleTypes">
    <moduleType id="jst.jbi.component" name="%jbi.component.module.type.name" />       
</extension>

A fine first move, and certainly one that we can be proud of. Now we have our new module type we will want to build up all that wonderful functionality around it.

Now we have a module type we need to move on to the defining the ServiceMix server, we aren't going to go into all the details here since it is more of a general overview of the functionality and steps required. Server Definitions are basically just plug-in themselves, though they need to implement some extension points to allow themselves to be added. WTP supports the concept of a generic server, this is one that is able to be started and controlled through a simple definition XML file and one that can handle publishing a project using an ANT task. You can override this functionality and implement real Java classes to do it all though for our purposes we should be able to function using the Generic (though we do need to override the behaviour since generic servers look for an http connection to be in place to determine that the server has started).

To start lets look at our plugin.xml :

Code Block
xml
xml

       <extension point="org.eclipse.wst.server.core.runtimeTypes">
	   <runtimeType	             
			id="org.eclipse.jst.server.generic.runtime.servicemix30"
			name="%servicemix30.runtime.name"
			description="%servicemix30.runtime.description" vendor="%servicemix30.vendor"
			version="3.0"
			class="org.eclipse.jst.server.generic.core.internal.GenericServerRuntime">
			<moduleType types="jst.jbi.component" versions="1.0" />
		</runtimeType>
	</extension>

First up we declare a runtime, in WTP there is a separation between a runtime which contains the libraries and functionality that wish to associate to a project and a server which is a running instance of the runtime. In this extension point we basically declare that we have a new runtime which is based on generic called servicemix30, we also associate our modulue type with this runtime.

Code Block
xml
xml

	<extension point="org.eclipse.wst.server.core.serverTypes">
		<serverType
			class="org.eclipse.jst.server.generic.core.internal.GenericServer"
			id="org.eclipse.jst.server.generic.servicemix30"
			initialState="stopped" supportsRemoteHosts="false"
			runtimeTypeId="org.eclipse.jst.server.generic.runtime.servicemix30"
			description="%servicemix30.server.description"
			launchConfigId="org.eclipse.jst.server.generic.core.launchConfigurationType"
			behaviourClass="org.eclipse.jst.server.servicemix.ServiceMixServerBehaviour"
			name="%servicemix30.server.name" startTimeout="75000" stopTimeout="15000"
			hasConfiguration="false" launchModes="run,debug,profile" runtime="true"
			startBeforePublish="false" />
	</extension>

Next up we need to declare our server type, it sits on top of our runtime and determine some basic information as to how the server is started and stopped as well as whether it needs to be running to publish to. Publish is where a project can be deployed (published) to a server, note that publishing is always to a server not a runtime.