Author: objectiser
Date: 2010-11-17 06:51:14 -0500 (Wed, 17 Nov 2010)
New Revision: 1119
Added:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/JBossServiceDeployer.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEServiceEndpointReference.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/EndpointMetaData.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/ServiceEndpointReference.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/ServiceProvider.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/deployer/
trunk/runtime/si/src/main/java/org/jboss/soa/si/deployer/ServiceDeployer.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/WebServiceProviderFactory.java
Removed:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointMetaData.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ServiceEndpointReference.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/ServiceInvoker.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/WebServiceFactory.java
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/BPELEngine.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEWebServiceFactory.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/BaseWebServiceEndpoint.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/WebServiceProviderGenerator.java
Log:
Renamed some classes to more appropriate names - using 'service provider' to
represent the component that implements the service, and service provider generator for
the javassist code generator, rather than factory.
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/BPELEngine.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/BPELEngine.java 2010-11-17
10:07:48 UTC (rev 1118)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/BPELEngine.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -18,7 +18,7 @@
package org.jboss.soa.bpel.runtime.engine;
import org.jboss.soa.si.InvocationAdapter;
-import org.jboss.soa.si.ServiceInvoker;
+import org.jboss.soa.si.ServiceProvider;
/**
* This interface represents a BPEL engine.
@@ -27,7 +27,7 @@
* @author Heiko Braun
*
*/
-public interface BPELEngine extends ServiceInvoker {
+public interface BPELEngine extends ServiceProvider {
public static final String Service="bpel/Engine";
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java 2010-11-17
10:07:48 UTC (rev 1118)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -23,6 +23,7 @@
import org.jboss.soa.bpel.runtime.engine.PartnerChannel;
import org.jboss.soa.bpel.runtime.integration.ServerConfigFactory;
import org.jboss.soa.bpel.runtime.ws.*;
+import org.jboss.soa.si.EndpointMetaData;
import org.jboss.soa.si.ws.WSDLReference;
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2010-11-17
10:07:48 UTC (rev 1118)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -42,7 +42,9 @@
import org.jboss.soa.bpel.runtime.engine.ode.UDDIRegistration;
import org.jboss.soa.bpel.runtime.integration.KernelLocator;
import org.jboss.soa.bpel.runtime.integration.ServerConfigFactory;
+import org.jboss.soa.si.EndpointMetaData;
import org.jboss.soa.si.ServerConfig;
+import org.jboss.soa.si.ServiceEndpointReference;
import org.jboss.soa.si.ws.BaseWebServiceEndpoint;
import org.jboss.soa.si.ws.DeploymentBuilder;
import org.jboss.soa.si.ws.WSDLParser;
@@ -83,6 +85,9 @@
private UDDIRegistration uddiRegistration = null;
private boolean stableInterface=false;
+ private JBossServiceDeployer m_deployer=new JBossServiceDeployer();
+
+
public EndpointManager(ExecutionEnvironment executionEnvironment)
{
this.executionEnvironment = executionEnvironment;
@@ -155,6 +160,22 @@
.setProvider(providerImpl)
.build();
+ if (!stableInterface) {
+ // Undeploy
+ try {
+ log.debug("Check if can remove existing service:
"+metaData.getServiceName()+":"+metaData.getPortName());
+ removeEndpoint(metaData.getServiceName(), metaData.getPortName());
+ } catch(IllegalStateException ise) {
+ // Ignore for now - endpoint may not exist if first version
+ }
+ }
+
+ URL serviceUrl = new
WSDLParser(wsdlRef.getDefinition()).getServiceLocationURL(metaData.getServiceName(),
metaData.getPortName());
+
+ ServiceEndpointReference ref = m_deployer.deploy(metaData,
providerImpl.getClass(),
+ serviceUrl, classLoader, warArchive);
+
+ /*
//Deployment deployment = createInMemoryDeployment(endpointId);
Deployment deployment = createVFSDeployment(warArchive);
@@ -178,7 +199,6 @@
mutableAttachments.addAttachment(JBossWebMetaData.class,
wmdFactory.createWebMetaData(classLoader));
mutableAttachments.addAttachment(DeploymentUnitFilter.class, new
RiftsawWSDeploymentUnitFilter());
-
if (!stableInterface) {
// Undeploy
try {
@@ -191,21 +211,23 @@
getMainDeployer().deploy(deployment);
- ServiceEndpointReference ref = new ServiceEndpointReference(
+ ODEServiceEndpointReference ref = new ODEServiceEndpointReference(
metaData.getEndpointId(), serviceUrl.toExternalForm(), deployment.getName()
);
ref.setArchiveLocation(warArchive.getAbsolutePath());
+*/
endpointMapping.put(
createEndpointKey(metaData.getServiceName(), metaData.getPortName()),
ref
);
if (uddiRegistration!=null) {
- uddiRegistration.registerEPR(metaData.getServiceName().getLocalPart(),
metaData.getPortName(), serviceUrl);
+ uddiRegistration.registerEPR(metaData.getServiceName().getLocalPart(),
metaData.getPortName(),
+ ref.getServiceUrl());
}
- return ref;
+ return ODEServiceEndpointReference.toODE(ref);
}
catch (Exception e)
{
@@ -213,38 +235,11 @@
}
}
- private String[] deriveWebContextFromServiceUrl(URL serviceUrl)
- {
- // metadata based on soapAddress
- String urlPathInfo = serviceUrl.getPath(); // has always leading slash
- urlPathInfo = urlPathInfo.substring(1, urlPathInfo.length());
-
- String actualWebContext;
- String actualUrlPattern;
- actualWebContext = urlPathInfo;
- actualUrlPattern = "/*";
-
- return new String[] {actualWebContext, actualUrlPattern};
- }
private String createEndpointKey(QName service, String port)
{
return service.toString()+":"+port;
}
- /*private Deployment createInMemoryDeployment(String endpointId)
- {
- AbstractDeployment deployment = new AbstractDeployment();
- deployment.setName("file://BPELEndpoint_"+endpointId+".war");
- return deployment;
- }*/
-
- private Deployment createVFSDeployment(File war)
- throws IOException
- {
- VirtualFile webAppVFS = VFS.getRoot(war.toURL());
- return VFSDeploymentFactory.getInstance().createVFSDeployment(webAppVFS);
- }
-
public void removeEndpoint(QName service, String port) throws
EndpointManagementException
{
String key = createEndpointKey(service, port);
@@ -252,24 +247,21 @@
if(null==ref)
throw new IllegalStateException("Unable to resolve ServiceEndpointReference
for key: "+key);
- String deploymentId = ref.getDeploymentName();
-
if (log.isDebugEnabled()) {
- log.debug("Remove endpoint service="+service+"
port="+port+" deploymentId="+deploymentId+" ref="+ref);
+ log.debug("Remove endpoint service="+service+"
port="+port+" deploymentName="+ref.getDeploymentName()+"
ref="+ref);
}
if(ref!=null)
{
try
{
- // undeploy call
- getMainDeployer().undeploy(deploymentId);
-
+ m_deployer.undeploy(ref);
+
// unregister
endpointMapping.remove(key);
if (log.isDebugEnabled()) {
- log.debug("Undeployed web service with deploymentId="+deploymentId);
+ log.debug("Undeployed web service with
deploymentName="+ref.getDeploymentName());
}
// remove physical artifacts
@@ -288,7 +280,7 @@
}
catch (Exception e)
{
- throw new EndpointManagementException("Failed to undeploy
"+deploymentId, e);
+ throw new EndpointManagementException("Failed to undeploy
"+ref.getDeploymentName(), e);
}
}
else
@@ -297,20 +289,13 @@
}
}
- private DeployerClient getMainDeployer()
- {
- Kernel mc = KernelLocator.getKernel();
- ControllerContext context =
mc.getController().getInstalledContext("MainDeployer");
- DeployerClient mainDeployer = (DeployerClient)context.getTarget();
- return mainDeployer;
- }
-
public EndpointReference maintains(QName service, String port)
{
String key = createEndpointKey(service, port);
- return endpointMapping.get(key);
+ return ODEServiceEndpointReference.toODE(endpointMapping.get(key));
}
+ /*
public class DelegatingClassLoaderFactory implements ClassLoaderFactory
{
private ClassLoader delegate;
@@ -339,6 +324,7 @@
return false;
}
}
+ */
public WebServiceClient createClient(
EndpointMetaData metaData, BPELEngineImpl server, ProcessConf pconf)
Deleted:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointMetaData.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointMetaData.java 2010-11-17
10:07:48 UTC (rev 1118)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointMetaData.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.soa.bpel.runtime.ws;
-
-import javax.xml.namespace.QName;
-
-/**
- * Minimum endpoint meta data that's required to create
- * endpoints. Anything else is derived by the {@link
org.jboss.soa.bpel.runtime.ws.EndpointManager}
- * itself.
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class EndpointMetaData
-{
- private QName serviceName;
- private String portName;
- private String endpointId;
- private QName processId;
-
- public EndpointMetaData(QName serviceName, String portName, QName processId, String
endpointId)
- {
- this.serviceName = serviceName;
- this.portName = portName;
- this.processId = processId;
- this.endpointId = endpointId;
- }
-
- public QName getServiceName()
- {
- return serviceName;
- }
-
- public String getPortName()
- {
- return portName;
- }
-
- public QName getProcessId()
- {
- return processId;
- }
-
- public String getEndpointId()
- {
- return endpointId;
- }
-
- public void setEndpointId(String endpointId)
- {
- this.endpointId = endpointId;
- }
-}
Added:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/JBossServiceDeployer.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/JBossServiceDeployer.java
(rev 0)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/JBossServiceDeployer.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.soa.bpel.runtime.ws;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.attachments.MutableAttachments;
+import org.jboss.deployers.structure.spi.ClassLoaderFactory;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.structure.spi.DeploymentUnitFilter;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.kernel.Kernel;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.soa.bpel.runtime.integration.KernelLocator;
+import org.jboss.soa.si.EndpointMetaData;
+import org.jboss.soa.si.ServiceEndpointReference;
+import org.jboss.soa.si.deployer.ServiceDeployer;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+
+public class JBossServiceDeployer implements ServiceDeployer {
+
+ public ServiceEndpointReference deploy(EndpointMetaData metaData, Class<?>
providerImpl, URL serviceUrl,
+ final ClassLoader classLoader, File warArchive) throws Exception {
+ Deployment deployment = createVFSDeployment(warArchive);
+
+ // Classloading
+ ClassLoaderFactory clf = new DelegatingClassLoaderFactory(classLoader);
+
+ // WebMetaData
+ String[] webContext = deriveWebContextFromServiceUrl(serviceUrl);
+
+ WebMetaDataFactory wmdFactory = new WebMetaDataFactory(
+ metaData.getEndpointId(), webContext[0], webContext[1],
providerImpl.getName()
+ );
+
+ MutableAttachments mutableAttachments =
+ (MutableAttachments)deployment.getPredeterminedManagedObjects();
+
+ // Applies to in memory only. Not used with VFS underneath
+ //mutableAttachments.addAttachment(StructureMetaData.class, new
StructureMetaDataImpl());
+ mutableAttachments.addAttachment(ClassLoaderFactory.class, clf);
+ mutableAttachments.addAttachment(JBossWebMetaData.class,
wmdFactory.createWebMetaData(classLoader));
+ mutableAttachments.addAttachment(DeploymentUnitFilter.class, new
RiftsawWSDeploymentUnitFilter());
+
+ getMainDeployer().deploy(deployment);
+
+ ODEServiceEndpointReference ref = new ODEServiceEndpointReference(
+ metaData.getEndpointId(), serviceUrl, deployment.getName()
+ );
+
+ ref.setArchiveLocation(warArchive.getAbsolutePath());
+
+ return(ref);
+ }
+
+ public void undeploy(ServiceEndpointReference ref) throws Exception {
+ getMainDeployer().undeploy(ref.getDeploymentName());
+ }
+
+ private String[] deriveWebContextFromServiceUrl(URL serviceUrl) {
+ // metadata based on soapAddress
+ String urlPathInfo = serviceUrl.getPath(); // has always leading slash
+ urlPathInfo = urlPathInfo.substring(1, urlPathInfo.length());
+
+ String actualWebContext;
+ String actualUrlPattern;
+ actualWebContext = urlPathInfo;
+ actualUrlPattern = "/*";
+
+ return new String[] {actualWebContext, actualUrlPattern};
+ }
+
+ private Deployment createVFSDeployment(File war) throws IOException {
+ VirtualFile webAppVFS = VFS.getRoot(war.toURI().toURL());
+ return VFSDeploymentFactory.getInstance().createVFSDeployment(webAppVFS);
+ }
+
+ private DeployerClient getMainDeployer() {
+ Kernel mc = KernelLocator.getKernel();
+ ControllerContext context =
mc.getController().getInstalledContext("MainDeployer");
+ DeployerClient mainDeployer = (DeployerClient)context.getTarget();
+ return mainDeployer;
+ }
+
+ public class DelegatingClassLoaderFactory implements ClassLoaderFactory {
+ private ClassLoader delegate;
+
+ public DelegatingClassLoaderFactory(final ClassLoader delegate) {
+ this.delegate = delegate;
+ }
+
+ public ClassLoader createClassLoader(DeploymentUnit unit) throws Exception {
+ return delegate;
+ }
+
+ public void removeClassLoader(DeploymentUnit unit) throws Exception {
+ // cleanup?
+ }
+ }
+
+ public class RiftsawWSDeploymentUnitFilter implements DeploymentUnitFilter {
+ public boolean accepts(DeploymentUnit unit) {
+ // When I am attached, it's always a BPEL deployment
+ return false;
+ }
+ }
+
+}
Copied:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEServiceEndpointReference.java
(from rev 1113,
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ServiceEndpointReference.java)
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEServiceEndpointReference.java
(rev 0)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEServiceEndpointReference.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.bpel.runtime.ws;
+
+import org.apache.ode.bpel.iapi.EndpointReference;
+import org.w3c.dom.Document;
+import org.jboss.soa.si.ServiceEndpointReference;
+
+/**
+ * References webservice endpoint deployment properties.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public final class ODEServiceEndpointReference extends ServiceEndpointReference
implements EndpointReference
+{
+ public ODEServiceEndpointReference(String endpointId, java.net.URL location, String
deploymentName)
+ {
+ super(endpointId, location, deploymentName);
+ }
+
+ public Document toXML() {
+ Document ret=null;
+
+ try {
+ ret =
javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
+
+ org.w3c.dom.Element elem=ret.createElement("attr");
+ elem.setAttribute("location", getServiceUrl().toExternalForm());
+ elem.setAttribute("endpointId", getEndpointId());
+ elem.setAttribute("deploymentName", getDeploymentName());
+
+ ret.appendChild(elem);
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+
+ return(ret);
+ }
+
+ public static ODEServiceEndpointReference toODE(ServiceEndpointReference ref) {
+ if (ref instanceof ODEServiceEndpointReference) {
+ return((ODEServiceEndpointReference)ref);
+ }
+ return(null);
+ }
+}
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEWebServiceFactory.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEWebServiceFactory.java 2010-11-17
10:07:48 UTC (rev 1118)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEWebServiceFactory.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -22,14 +22,14 @@
import javax.xml.namespace.QName;
import org.jboss.soa.bpel.runtime.engine.BPELEngine;
-import org.jboss.soa.si.ServiceInvoker;
+import org.jboss.soa.si.ServiceProvider;
import org.jboss.soa.si.ws.SOAPMessageAdapter;
import org.jboss.soa.si.ws.WSInvocationAdapter;
-import org.jboss.soa.si.ws.WebServiceFactory;
+import org.jboss.soa.si.ws.WebServiceProviderFactory;
-public class ODEWebServiceFactory implements WebServiceFactory {
+public class ODEWebServiceFactory implements WebServiceProviderFactory {
- public ServiceInvoker getServiceInvoker() {
+ public ServiceProvider getServiceProvider() {
return(getEngine());
}
Deleted:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ServiceEndpointReference.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ServiceEndpointReference.java 2010-11-17
10:07:48 UTC (rev 1118)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ServiceEndpointReference.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -1,115 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.soa.bpel.runtime.ws;
-
-import org.apache.ode.bpel.iapi.EndpointReference;
-import org.w3c.dom.Document;
-
-/**
- * References webservice endpoint deployment properties.
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public final class ServiceEndpointReference implements EndpointReference
-{
- private String endpointId;
- private String serviceUrl;
- private String deploymentName;
- private String archiveLocation;
-
- public ServiceEndpointReference(String endpointId, String location, String
deploymentName)
- {
- this.endpointId = endpointId;
- this.serviceUrl = location;
- this.deploymentName = deploymentName;
- }
-
- public String getArchiveLocation()
- {
- return archiveLocation;
- }
-
- public void setArchiveLocation(String archiveLocation)
- {
- this.archiveLocation = archiveLocation;
- }
-
- public Document toXML() {
- Document ret=null;
-
- try {
- ret =
javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
-
- org.w3c.dom.Element elem=ret.createElement("attr");
- elem.setAttribute("location", serviceUrl);
- elem.setAttribute("endpointId", endpointId);
- elem.setAttribute("deploymentName", deploymentName);
-
- ret.appendChild(elem);
- } catch(Exception e) {
- e.printStackTrace();
- }
-
- return(ret);
- }
-
- public String getEndpointId()
- {
- return endpointId;
- }
-
- public String getServiceUrl()
- {
- return serviceUrl;
- }
-
- public String getDeploymentName()
- {
- return deploymentName;
- }
-
- @Override
- public boolean equals(Object o)
- {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ServiceEndpointReference that = (ServiceEndpointReference) o;
-
- if (!archiveLocation.equals(that.archiveLocation)) return false;
- if (!deploymentName.equals(that.deploymentName)) return false;
- if (!endpointId.equals(that.endpointId)) return false;
- if (!serviceUrl.equals(that.serviceUrl)) return false;
-
- return true;
- }
-
- @Override
- public int hashCode()
- {
- int result = endpointId.hashCode();
- result = 31 * result + serviceUrl.hashCode();
- result = 31 * result + deploymentName.hashCode();
- result = 31 * result + archiveLocation.hashCode();
- return result;
- }
-}
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2010-11-17
10:07:48 UTC (rev 1118)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -53,6 +53,7 @@
import org.jboss.soa.bpel.runtime.engine.ode.UDDIClientFactory;
import org.jboss.soa.bpel.runtime.engine.ode.UDDIRegistration;
import org.jboss.soa.bpel.runtime.integration.ServerConfigFactory;
+import org.jboss.soa.si.EndpointMetaData;
import org.jboss.soa.si.ws.DOMWriter;
import org.jboss.soa.si.ws.JavaUtils;
import org.jboss.soa.si.ws.SOAPMessageAdapter;
Copied: trunk/runtime/si/src/main/java/org/jboss/soa/si/EndpointMetaData.java (from rev
1113,
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointMetaData.java)
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/EndpointMetaData.java
(rev 0)
+++ trunk/runtime/si/src/main/java/org/jboss/soa/si/EndpointMetaData.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.si;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Minimum endpoint meta data that's required to create
+ * endpoints. Anything else is derived by the {@link
org.jboss.soa.bpel.runtime.ws.EndpointManager}
+ * itself.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class EndpointMetaData
+{
+ private QName serviceName;
+ private String portName;
+ private String endpointId;
+ private QName processId;
+
+ public EndpointMetaData(QName serviceName, String portName, QName processId, String
endpointId)
+ {
+ this.serviceName = serviceName;
+ this.portName = portName;
+ this.processId = processId;
+ this.endpointId = endpointId;
+ }
+
+ public QName getServiceName()
+ {
+ return serviceName;
+ }
+
+ public String getPortName()
+ {
+ return portName;
+ }
+
+ public QName getProcessId()
+ {
+ return processId;
+ }
+
+ public String getEndpointId()
+ {
+ return endpointId;
+ }
+
+ public void setEndpointId(String endpointId)
+ {
+ this.endpointId = endpointId;
+ }
+}
Added: trunk/runtime/si/src/main/java/org/jboss/soa/si/ServiceEndpointReference.java
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/ServiceEndpointReference.java
(rev 0)
+++
trunk/runtime/si/src/main/java/org/jboss/soa/si/ServiceEndpointReference.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.si;
+
+/**
+ * References webservice endpoint deployment properties.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ServiceEndpointReference
+{
+ private String endpointId;
+ private java.net.URL serviceUrl;
+ private String deploymentName;
+ private String archiveLocation;
+
+ public ServiceEndpointReference(String endpointId, java.net.URL location, String
deploymentName)
+ {
+ this.endpointId = endpointId;
+ this.serviceUrl = location;
+ this.deploymentName = deploymentName;
+ }
+
+ public String getArchiveLocation()
+ {
+ return archiveLocation;
+ }
+
+ public void setArchiveLocation(String archiveLocation)
+ {
+ this.archiveLocation = archiveLocation;
+ }
+
+ public String getEndpointId()
+ {
+ return endpointId;
+ }
+
+ public java.net.URL getServiceUrl()
+ {
+ return serviceUrl;
+ }
+
+ public String getDeploymentName()
+ {
+ return deploymentName;
+ }
+
+ @Override
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ServiceEndpointReference that = (ServiceEndpointReference) o;
+
+ if (!archiveLocation.equals(that.archiveLocation)) return false;
+ if (!deploymentName.equals(that.deploymentName)) return false;
+ if (!endpointId.equals(that.endpointId)) return false;
+ if (!serviceUrl.equals(that.serviceUrl)) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = endpointId.hashCode();
+ result = 31 * result + serviceUrl.hashCode();
+ result = 31 * result + deploymentName.hashCode();
+ result = 31 * result + archiveLocation.hashCode();
+ return result;
+ }
+}
Deleted: trunk/runtime/si/src/main/java/org/jboss/soa/si/ServiceInvoker.java
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/ServiceInvoker.java 2010-11-17
10:07:48 UTC (rev 1118)
+++ trunk/runtime/si/src/main/java/org/jboss/soa/si/ServiceInvoker.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.soa.si;
-
-public interface ServiceInvoker {
-
- /**
- * This method initializes the service invoker. This method must
- * be called before using the invoker.
- *
- * @throws Exception Failed to initialize
- */
- public void init() throws Exception;
-
- /**
- * This method invokes the associated service using the invocation
- * adapter supplied.
- *
- * @param invocationAdapter The invocation adapter
- * @throws Exception Failed to invoke the service
- */
- public void invoke(InvocationAdapter<?> invocationAdapter) throws Exception;
-
- /**
- * This method closes the service invoker.
- *
- * @throws Exception Failed to close
- */
- public void close() throws Exception;
-
-}
Copied: trunk/runtime/si/src/main/java/org/jboss/soa/si/ServiceProvider.java (from rev
1115, trunk/runtime/si/src/main/java/org/jboss/soa/si/ServiceInvoker.java)
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/ServiceProvider.java
(rev 0)
+++ trunk/runtime/si/src/main/java/org/jboss/soa/si/ServiceProvider.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.soa.si;
+
+public interface ServiceProvider {
+
+ /**
+ * This method initializes the service invoker. This method must
+ * be called before using the invoker.
+ *
+ * @throws Exception Failed to initialize
+ */
+ public void init() throws Exception;
+
+ /**
+ * This method invokes the associated service using the invocation
+ * adapter supplied.
+ *
+ * @param invocationAdapter The invocation adapter
+ * @throws Exception Failed to invoke the service
+ */
+ public void invoke(InvocationAdapter<?> invocationAdapter) throws Exception;
+
+ /**
+ * This method closes the service invoker.
+ *
+ * @throws Exception Failed to close
+ */
+ public void close() throws Exception;
+
+}
Added: trunk/runtime/si/src/main/java/org/jboss/soa/si/deployer/ServiceDeployer.java
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/deployer/ServiceDeployer.java
(rev 0)
+++
trunk/runtime/si/src/main/java/org/jboss/soa/si/deployer/ServiceDeployer.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.soa.si.deployer;
+
+import java.net.URL;
+
+import org.jboss.soa.si.EndpointMetaData;
+import org.jboss.soa.si.ServiceEndpointReference;
+
+public interface ServiceDeployer {
+
+ public ServiceEndpointReference deploy(EndpointMetaData metaData, Class<?>
providerImpl, URL serviceUrl,
+ ClassLoader classLoader, java.io.File deployment) throws Exception;
+
+ public void undeploy(ServiceEndpointReference ref) throws Exception;
+
+}
Modified: trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/BaseWebServiceEndpoint.java
===================================================================
---
trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/BaseWebServiceEndpoint.java 2010-11-17
10:07:48 UTC (rev 1118)
+++
trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/BaseWebServiceEndpoint.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -51,7 +51,7 @@
private SOAPMessageAdapter soapAdapter;
private QName serviceQName;
private Definition wsdlDefinition;
- private WebServiceFactory serviceFactory;
+ private WebServiceProviderFactory serviceFactory;
private boolean isInitialized;
@@ -72,7 +72,7 @@
try {
Class<?> cls=Class.forName(details.factory());
- serviceFactory = (WebServiceFactory)cls.newInstance();
+ serviceFactory = (WebServiceProviderFactory)cls.newInstance();
} catch(ClassNotFoundException cnfe) {
throw new RuntimeException("Unable to find Web Service Factory class
'"+
@@ -116,7 +116,7 @@
invocationContext.setSOAPMessage(soapMessage);
// Invoke ODE
- serviceFactory.getServiceInvoker().invoke(invocationContext);
+ serviceFactory.getServiceProvider().invoke(invocationContext);
// Handle response
SOAPMessage responseMessage = null;
Deleted: trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/WebServiceFactory.java
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/WebServiceFactory.java 2010-11-17
10:07:48 UTC (rev 1118)
+++ trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/WebServiceFactory.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -1,31 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.soa.si.ws;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.soa.si.ServiceInvoker;
-
-public interface WebServiceFactory {
-
- public ServiceInvoker getServiceInvoker();
-
- public WSInvocationAdapter getInvocationAdapter(String operationName,
- QName serviceName, String portName, SOAPMessageAdapter soapAdapter);
-
-}
Copied: trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/WebServiceProviderFactory.java
(from rev 1115,
trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/WebServiceFactory.java)
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/WebServiceProviderFactory.java
(rev 0)
+++
trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/WebServiceProviderFactory.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.soa.si.ws;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.soa.si.ServiceProvider;
+
+public interface WebServiceProviderFactory {
+
+ public ServiceProvider getServiceProvider();
+
+ public WSInvocationAdapter getInvocationAdapter(String operationName,
+ QName serviceName, String portName, SOAPMessageAdapter soapAdapter);
+
+}
Modified:
trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/WebServiceProviderGenerator.java
===================================================================
---
trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/WebServiceProviderGenerator.java 2010-11-17
10:07:48 UTC (rev 1118)
+++
trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/WebServiceProviderGenerator.java 2010-11-17
11:51:14 UTC (rev 1119)
@@ -50,7 +50,7 @@
WSDLReference wsdlRef,
ClassLoader loader,
java.io.File handlerFile,
- Class<? extends WebServiceFactory> providerFactory
+ Class<? extends WebServiceProviderFactory> providerFactory
)
throws Exception
{