Author: Grid.Qian
Date: 2010-10-09 04:09:15 -0400 (Sat, 09 Oct 2010)
New Revision: 25662
Added:
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/.classpath
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/.project
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/META-INF/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/META-INF/MANIFEST.MF
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/bin/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/build.properties
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/definition/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/definition/ode.xml
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/icons/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/icons/obj16/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/icons/obj16/ode.gif
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/plugin.properties
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/plugin.xml
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/pom.xml
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/GenericBPELPublisher.java
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdeBPELPublisher.java
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdePlugin.java
Log:
JBIDE-6588: add ode.runtime plugin into code base
Added: trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/.classpath
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/.classpath
(rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/.classpath 2010-10-09 08:09:15
UTC (rev 25662)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/.project
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/.project
(rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/.project 2010-10-09 08:09:15
UTC (rev 25662)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.bpel.apache.ode.runtime</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/META-INF/MANIFEST.MF
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/META-INF/MANIFEST.MF
(rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/META-INF/MANIFEST.MF 2010-10-09
08:09:15 UTC (rev 25662)
@@ -0,0 +1,31 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.bpel.apache.ode.runtime;singleton:=true
+Bundle-Version: 0.6.0.qualifier
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.wst.server.core;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.emf.ecore;bundle-version="[2.4.0,3.0.0)",
+ org.eclipse.jst.server.generic.core;bundle-version="[1.0.305,2.0.0)",
+ org.eclipse.wst.wsdl;bundle-version="[1.1.200,2.0.0)",
+ org.eclipse.bpel.model;bundle-version="0.5.0",
+ org.eclipse.jem.util;bundle-version="[2.0.100,3.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
+ org.jboss.tools.bpel.runtimes;bundle-version="0.4.0",
+ org.eclipse.jst.server.generic.ui;bundle-version="[1.0.305,2.0.0)",
+ org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)",
+ org.eclipse.bpel.ui;bundle-version="0.5.0",
+ org.apache.xerces;bundle-version="[2.9.0,3.0.0)",
+ org.eclipse.xsd;bundle-version="[2.4.0,3.0.0)",
+ org.eclipse.jst.server.ui;bundle-version="[1.0.303,2.0.0)",
+ org.eclipse.jst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)",
+ org.eclipse.jst.server.core;bundle-version="[1.1.0,2.0.0)",
+ javax.wsdl;bundle-version="[1.5.0,1.6.0)",
+ org.eclipse.bpel.apache.ode.deploy.model;bundle-version="0.5.0"
+Bundle-Activator: org.eclipse.bpel.apache.ode.runtime.OdePlugin
+Export-Package: org.eclipse.bpel.apache.ode.runtime
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Added: trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/build.properties
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/build.properties
(rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/build.properties 2010-10-09
08:09:15 UTC (rev 25662)
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ bin/,\
+ definition/,\
+ icons/,\
+ plugin.properties
Added: trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/definition/ode.xml
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/definition/ode.xml
(rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/definition/ode.xml 2010-10-09
08:09:15 UTC (rev 25662)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<tns:ServerRuntime
+
xmlns:tns="http://eclipse.org/jst/server/generic/ServerTypeDefinitio...
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://eclipse.org/jst/server/generic/ServerType...
ServerTypeDefinitionSchema.xsd "
+ name="Apache ODE" version="v1.x">
+ <property id="ode.home"
+ label="%odeHome"
+ type="directory"
+ context="runtime"
+ default="/your_ode_root/" />
+ <property id="tomcat.home"
+ label="%tomcatHome"
+ type="directory"
+ context="runtime"
+ default="/your_tomcat_root/" />
+
+ <property id="port"
+ label="%port"
+ type="string"
+ context="runtime"
+ default="8080" />
+
+ <port>
+ <no>${port}</no>
+ <name>Http</name>
+ <protocol>http</protocol>
+ </port>
+
+ <module>
+ <type>jbt.bpel.module</type>
+ <publishDir>${ode.home}/WEB-INF/processes</publishDir>
+ <publisherReference>org.eclipse.bpel.apache.ode.runtime.publisher</publisherReference>
+ </module>
+
+ <project>
+ <classpathReference>ode.project</classpathReference>
+ </project>
+
+ <start>
+ <mainClass>org.apache.catalina.startup.Bootstrap</mainClass>
+ <workingDirectory>${tomcat.home}</workingDirectory>
+ <programArguments>start</programArguments>
+ <vmParameters>-Dcatalina.home="${tomcat.home}"
-Djava.endorsed.dirs="${tomcat.home}\common\endorsed"</vmParameters>
+ <classpathReference>tomcat</classpathReference>
+ </start>
+
+ <stop>
+ <mainClass>org.apache.catalina.startup.Bootstrap</mainClass>
+ <workingDirectory>${tomcat.home}</workingDirectory>
+ <programArguments>stop</programArguments>
+ <vmParameters>-Dcatalina.home="${tomcat.home}"
-Djava.endorsed.dirs="${tomcat.home}\common\endorsed"</vmParameters>
+ <classpathReference>tomcat</classpathReference>
+ </stop>
+
+ <classpath id="ode">
+ <archive path="${ode.home}/WEB-INF/lib" />
+ </classpath>
+
+ <classpath id="tomcat">
+ <archive path="${tomcat.home}/bin/bootstrap.jar" />
+ </classpath>
+
+</tns:ServerRuntime>
\ No newline at end of file
Added: trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/icons/obj16/ode.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/icons/obj16/ode.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/plugin.properties
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/plugin.properties
(rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/plugin.properties 2010-10-09
08:09:15 UTC (rev 25662)
@@ -0,0 +1,5 @@
+pluginName = Apache ODE Runtime Adapter
+providerName = JBoss by Red Hat
+odeHome = ODE's home directory:
+tomcatHome = Tomcat's home directory:
+port = Port:
\ No newline at end of file
Added: trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/plugin.xml
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/plugin.xml
(rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/plugin.xml 2010-10-09 08:09:15
UTC (rev 25662)
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension point="org.eclipse.wst.server.core.runtimeTypes">
+ <runtimeType
+ id="org.eclipse.bpel.apache.ode.runtime.rt"
+ name="Apache Ode 1.x Runtime"
+ description="Apache's BPEL 2.0 execution engine - Runtime"
+ vendor="Apache"
+ version="1.0"
+
class="org.eclipse.jst.server.generic.core.internal.GenericServerRuntime">
+ <moduleType
+ types="jbt.bpel.module"
+ versions="1.1, 2.0"/>
+ </runtimeType>
+ </extension>
+ <extension point="org.eclipse.wst.server.core.serverTypes">
+ <serverType
+ runtime="true"
+ class="org.eclipse.jst.server.generic.core.internal.GenericServer"
+ id="org.eclipse.bpel.apache.ode.runtime.st"
+ initialState="stopped"
+ supportsRemoteHosts="true"
+ runtimeTypeId="org.eclipse.bpel.apache.ode.runtime.rt"
+ description="Apache's BPEL 2.0 execution engine - Server"
+ launchConfigId="org.eclipse.jst.server.generic.core.launchConfigurationType"
+ behaviourClass="org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour"
+ name="Ode v1.x Server"
+ hasConfiguration="false"
+ startTimeout="480000"
+ stopTimeout="60000"
+ launchModes="run, debug"
+ startBeforePublish="true">
+ </serverType>
+ </extension>
+ <extension point="org.eclipse.wst.server.ui.serverImages">
+ <image
+ id="org.eclipse.jst.server.generic.image"
+ icon="icons/obj16/ode.gif"
+ typeIds="org.eclipse.bpel.apache.ode.runtime.rt"/>
+ <image
+ id="org.eclipse.jst.server.generic.image"
+ icon="icons/obj16/ode.gif"
+ typeIds="org.eclipse.bpel.apache.ode.runtime.st"/>
+ </extension>
+
+ <extension
point="org.eclipse.jst.server.generic.core.genericpublisher">
+ <genericpublisher
+ class="org.eclipse.bpel.apache.ode.runtime.OdeBPELPublisher"
+ id="org.eclipse.bpel.apache.ode.runtime.publisher"/>
+ </extension>
+ <extension
point="org.eclipse.wst.common.project.facet.core.runtimes">
+ <runtime-component-type
+ id="org.eclipse.bpel.apache.ode.runtime.rt"/>
+
+ <runtime-component-version
+ type="org.eclipse.bpel.apache.ode.runtime.rt"
+ version="2.0"/>
+
+ <adapter>
+ <runtime-component
+ id="org.eclipse.bpel.apache.ode.runtime.rt"/>
+ <factory
+ class="org.eclipse.jst.server.core.internal.RuntimeClasspathProvider$Factory"/>
+ <type
+ class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
+ </adapter>
+
+ <supported>
+ <runtime-component
+ id="org.eclipse.bpel.apache.ode.runtime.rt"
+ version="2.0"/>
+ <facet
+ id="jbt.bpel.facet.core"
+ version="2.0"/>
+ </supported>
+ </extension>
+ <extension point="org.eclipse.wst.common.project.facet.ui.images">
+ <image
+ runtime-component-type="org.eclipse.bpel.apache.ode.runtime.rt"
+ path="icons/obj16/ode.gif"/>
+ </extension>
+
+
+ <extension point="org.eclipse.wst.common.project.facet.core.runtimes">
+ <adapter>
+ <runtime-component id="org.eclipse.bpel.apache.ode.runtime.rt"/>
+ <factory
class="org.eclipse.jst.server.ui.internal.RuntimeLabelProvider$Factory"/>
+ <type
class="org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLabelProvider"/>
+ </adapter>
+ </extension>
+
+ <extension point="org.eclipse.jst.server.core.runtimeFacetMappings">
+ <runtimeFacetMapping
+ runtimeTypeId="org.eclipse.bpel.apache.ode.runtime.rt"
+ runtime-component="org.eclipse.bpel.apache.ode.runtime.rt"
+ version="2.0"/>
+ </extension>
+ <extension
point="org.eclipse.jst.server.generic.core.serverdefinition">
+ <serverdefinition id="org.eclipse.bpel.apache.ode.runtime.rt"
definitionfile="definition/ode.xml">
+ </serverdefinition>
+ </extension>
+ <extension point="org.eclipse.wst.server.ui.wizardFragments">
+ <fragment
+ id="org.eclipse.jst.server.generic.runtime"
+ typeIds="org.eclipse.bpel.apache.ode.runtime.rt"
+ class="org.eclipse.jst.server.generic.ui.internal.GenericServerRuntimeWizardFragment"/>
+ <fragment
+ id="org.eclipse.jst.server.generic.server"
+ typeIds="org.eclipse.bpel.apache.ode.runtime.st"
+ class="org.eclipse.jst.server.generic.ui.internal.GenericServerWizardFragment"/>
+ </extension>
+
+</plugin>
Added: trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/pom.xml
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/pom.xml
(rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/pom.xml 2010-10-09 08:09:15 UTC
(rev 25662)
@@ -0,0 +1,13 @@
+<project
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.bpel.plugins</groupId>
+ <artifactId>org.eclipse.bpel.apache.ode.runtime</artifactId>
+ <version>0.6.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
Added:
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/GenericBPELPublisher.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/GenericBPELPublisher.java
(rev 0)
+++
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/GenericBPELPublisher.java 2010-10-09
08:09:15 UTC (rev 25662)
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2006 University College London Software Systems Engineering
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bruno Wassermann - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.apache.ode.runtime;
+
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jst.server.generic.core.internal.GenericPublisher;
+import org.eclipse.jst.server.generic.core.internal.GenericServer;
+import org.eclipse.jst.server.generic.servertype.definition.Port;
+import org.eclipse.wst.server.core.IModuleArtifact;
+
+/**
+ * An abstract base class offering some utility methods facilitating the process
+ * of deploying a BPEL process onto a runtime and indicating a publisher of
+ * BPEL processes. This extends the generic server
+ * framework. Implementers of the <code>genericpublishers</code> extension
point
+ * wishing to publish BPEL processes onto some runtime, may find it convenient
+ * to sub-class this class.
+ * <p>
+ * The minimum requirement on sub-classes is to provide an implementation of
+ * <code>GenericPublisher{@link #publish(IModuleArtifact[],
IProgressMonitor)}</code>,
+ * <code>GenericPublisher{@link #unpublish(IProgressMonitor)}</code> and of
+ * <code></code>
+ * <p>
+ * Clients should not instantiate this class or its sub-classes as they will be
+ * instantiated by the WTP server framework. Clients can make use of any
+ * convenience methods contained in this class (all methods defined directly
+ * on <code>GenericBPELPublisher</code>).
+ *
+ *
+ * @author Bruno Wassermann, written Jun 8, 2006
+ */
+public abstract class GenericBPELPublisher extends GenericPublisher {
+
+// TODO add utility methods that may be useful to concrete implementations
+
+ /**
+ * Displays engine-specific validation warnings and errors in the BPEL
+ * Designer.
+ * <p>
+ * Sub-classes can call this method to provide information
+ * about any problems detected during deployment.
+ */
+ protected final void submitValidationMarkers() {
+ // TODO decide on signature/arguments
+ }
+
+ /**
+ * Provides access to the relevant project in the workspace in order to
+ * store a local copy of a generated deployment archive
+ *
+ * @param deployArchive
+ * @param path should probably be relative from project root and if null
+ * will save archive in project root
+ */
+ protected void storeDeploymentArchive(IFile deployArchive, IPath path) {
+ // TODO figure out whether this is really useful
+ // TODO figure out the signature (should it be a file, what's the best
+ // way to allow specifying an additional path?) - maybe look at some
+ // of the methods in the WTP tutorial.
+ }
+
+ /**
+ * Returns the host part of the server on which module is to be published.
+ * For example, 'localhost'.
+ *
+ * @return <code>String</code> representing host part of server on which
+ * module is to be published. Will return <code>null</code>, if called
+ * before {@link GenericPublisher#initialize()} has been called.
+ */
+ protected String getHost() {
+ return getServer().getServer().getHost();
+ }
+
+ /**
+ * Returns http port defined for the server module is to be published on.
+ * <p>
+ * This replicates {@link GenericServer#getHttpPort()}.
+ *
+ * @return int
+ */
+ protected int getHttpPort() {
+ int port = -1;
+ Iterator pIter = getServer().getServerDefinition().getPort().iterator();
+
+ while (pIter.hasNext()) {
+ Port aPort = (Port) pIter.next();
+
+ if(port == -1) {
+ port =
Integer.parseInt(getServer().getServerDefinition().getResolver().resolveProperties(aPort.getNo()));
+ }
+ else if( "http".equals(aPort.getProtocol() ) ) { //$NON-NLS-1$
+ port = Integer.parseInt(aPort.getNo());
+ }
+ }
+ if( port == -1) {
+ port = 8080;
+ }
+ return port;
+ }
+
+ /*
+ * we don't have something like validate in here as we are not the provider
+ * of an extension point, but simply providing some utility methods for
+ * sub-classes to use if they so wish.
+ *
+ * if we had provided our own extension point to do publishing, then
+ * we would probably have specified a validate() method in the abstract base
+ * class so that our framework could call its implementation in extensions.
+ *
+ * If it's just a utility method it should have static methods. Otherwise,
+ * allow it to be sub-classed and declare some methods as abstract to
+ * indicate to sub-classes what they need to implement.
+ *
+ * What is true though is that we cannot call such methods automatically as
+ * we are not really offering an extension point.
+ *
+ * TODO clarify explain this point about usage in the class comment! the methods
+ * will not be called automatically as we are not providing an extension
+ * point as initially expected.
+ */
+
+
+}
Added:
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdeBPELPublisher.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdeBPELPublisher.java
(rev 0)
+++
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdeBPELPublisher.java 2010-10-09
08:09:15 UTC (rev 25662)
@@ -0,0 +1,95 @@
+package org.eclipse.bpel.apache.ode.runtime;
+
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation, University of Stuttgart (IAAS) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation, University of Stuttgart (IAAS) - initial API and implementation
+ *******************************************************************************/
+
+import java.io.File;
+
+import org.eclipse.bpel.apache.ode.runtime.GenericBPELPublisher;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jst.server.core.PublishUtil;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.ModuleDelegate;
+
+/**
+ * BPEL publisher for Apache ODE.
+ *
+ * @author Tammo van Lessen (IAAS)
+ * @author Simon Moser (IBM)
+ */
+public class OdeBPELPublisher extends GenericBPELPublisher {
+
+ public OdeBPELPublisher() {
+ super();
+ }
+
+ @Override
+ public IStatus[] publish(IModuleArtifact[] artifacts, IProgressMonitor monitor) {
+ // resources will always be null for some weird reason :(
+ // therefore we generate a BPELModuleArtifact
+ // the module id value enables us to get BPEL file path relative to its project
+ IModule[] modules = super.getModule();
+
+ try {
+ IModule last = modules[modules.length-1];
+ IPath root = createDeploymentDestination(last);
+ ModuleDelegate delegate = (ModuleDelegate)last.loadAdapter(ModuleDelegate.class, new
NullProgressMonitor());
+ IModuleResource[] resources = delegate.members();
+ PublishUtil.publishFull(resources, root, monitor);
+ } catch( CoreException ce ) {
+ // TODO return bad status
+ }
+ return new IStatus[]{Status.OK_STATUS};
+
+ }
+
+ @Override
+ public IStatus[] unpublish(IProgressMonitor monitor) {
+ IModule[] modules = super.getModule();
+ IModule last = modules[modules.length - 1];
+ IStatus[] result = new Status[modules.length];
+ IPath root = createDeploymentDestination(last);
+ PublishUtil.deleteDirectory(root.toFile(), monitor);
+ return result;
+ }
+
+ /**
+ * This method will create a folder inside the WEB-INF\processes subfolder
+ * of the ODE installation
+ */
+ protected IPath createDeploymentDestination(IModule module) {
+ String moduleName = module.getName();
+ String deployAppName = moduleName;
+
+ // get TOMCAT_HOME
+ IRuntime serverDef = getServerRuntime().getRuntime();
+ IPath tomcatHome = serverDef.getLocation();
+
+ // append ODE's Process target Dir tomcatHome
+ IPath deployTarget = tomcatHome.append("webapps").append("ode")
+ .append("WEB-INF").append("processes").append(deployAppName);
+
+ File f = deployTarget.toFile();
+ if (!f.exists()) {
+ f.mkdir();
+ }
+
+ return deployTarget;
+ }
+}
Added:
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdePlugin.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdePlugin.java
(rev 0)
+++
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdePlugin.java 2010-10-09
08:09:15 UTC (rev 25662)
@@ -0,0 +1,41 @@
+package org.eclipse.bpel.apache.ode.runtime;
+
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation, University of Stuttgart (IAAS) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation, University of Stuttgart (IAAS) - initial API and implementation
+ *******************************************************************************/
+
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * Runtime contributor for Apache ODE.
+ *
+ * @author Tammo van Lessen (IAAS)
+ * @author Simon Moser (IBM)
+ */
+public class OdePlugin extends AbstractUIPlugin {
+ public static final String PLUGIN_ID = "org.eclipse.bpel.apache.ode.runtime";
+ private static OdePlugin plugin;
+
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ public static OdePlugin getDefault() {
+ return plugin;
+ }
+
+}