Author: kurtstam
Date: 2011-06-07 10:32:54 -0400 (Tue, 07 Jun 2011)
New Revision: 1372
Added:
trunk/distribution/src/main/release/conf/juddi/riftsaw.uddi.xml
Removed:
trunk/distribution/src/main/release/conf/juddi/esb.juddi.client.xml
Modified:
trunk/distribution/src/main/release/conf/bpel.properties
trunk/distribution/src/main/release/conf/jboss/jboss-beans.xml
trunk/distribution/src/main/release/conf/juddi/riftsaw_BusinessEntity.xml
trunk/distribution/src/main/release/install/build.xml
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/ExecutionEnvironment.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/WebServiceClient.java
trunk/runtime/uddi/pom.xml
Log:
RIFTSAW-368, adding a riftsaw.uddi.xml file, so we have our own client config. Also moved
endpoint lookup to invokation time, rather then deploy time.
Modified: trunk/distribution/src/main/release/conf/bpel.properties
===================================================================
--- trunk/distribution/src/main/release/conf/bpel.properties 2011-06-07 13:39:25 UTC (rev
1371)
+++ trunk/distribution/src/main/release/conf/bpel.properties 2011-06-07 14:32:54 UTC (rev
1372)
@@ -103,11 +103,8 @@
bpel.uddi.lookup=false
# implementation of the client integration class
bpel.uddi.client.impl=org.jboss.soa.bpel.uddi.UDDIRegistrationImpl
-# the uddi client config in case you want to use your own client config rather then
-# jbossesb.saw/esb.uddi.client.xml. Commented out by default.
-#bpel.uddi.config=META-INF/bpel.uddi.client.xml
-# only if you don't specify the bpel.uddi.config you need to specify the name of the
clerk manager
-bpel.uddi.clerk.manager=uddi-portlet-manager
+# the uddi client config riftsaw.sar/META-INF/riftsaw.uddi.xml
+bpel.uddi.config=META-INF/riftsaw.uddi.xml
# name of the clerk
bpel.uddi.clerk=BPELClerk
Modified: trunk/distribution/src/main/release/conf/jboss/jboss-beans.xml
===================================================================
--- trunk/distribution/src/main/release/conf/jboss/jboss-beans.xml 2011-06-07 13:39:25 UTC
(rev 1371)
+++ trunk/distribution/src/main/release/conf/jboss/jboss-beans.xml 2011-06-07 14:32:54 UTC
(rev 1372)
@@ -18,6 +18,7 @@
<depends>jboss:service=Naming</depends>
<depends>BPELDatabaseInitializer</depends>
<depends>BPELDeployer</depends>
+ <!--<depends>jboss.esb:service=JuddiClient</depends>-->
</bean>
<!--
Deleted: trunk/distribution/src/main/release/conf/juddi/esb.juddi.client.xml
===================================================================
--- trunk/distribution/src/main/release/conf/juddi/esb.juddi.client.xml 2011-06-07
13:39:25 UTC (rev 1371)
+++ trunk/distribution/src/main/release/conf/juddi/esb.juddi.client.xml 2011-06-07
14:32:54 UTC (rev 1372)
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<uddi>
- <reloadDelay>3600000</reloadDelay>
- <manager name="uddi-portlet-manager">
- <nodes>
- <node isHomeJUDDI="true">
- <!-- required 'default' node -->
- <name>default</name>
- <description>Main jUDDI node</description>
- <!-- JAX-WS Transport - The ESB transport requires Service Endpoint URLs and not
the WSDL URLs.
-
<proxyTransport>org.jboss.internal.soa.esb.registry.client.JuddiJAXWSTransport</proxyTransport>
-
<custodyTransferUrl>http://REMOTE_HOST:REMOTE_PORT/juddiv3/services/custody-transfer</custodyTransferUrl>
-
<inquiryUrl>http://REMOTE_HOST:REMOTE_PORT/juddiv3/services/inquiry</inquiryUrl>
-
<publishUrl>http://REMOTE_HOST:REMOTE_PORT/juddiv3/services/publish</publishUrl>
-
<securityUrl>http://REMOTE_HOST:REMOTE_PORT/juddiv3/services/security</securityUrl>
-
<subscriptionUrl>http://REMOTE_HOST:REMOTE_PORT/juddiv3/services/subscription</subscriptionUrl>
-
<subscriptionListenerUrl>http://REMOTE_HOST:REMOTE_PORT/juddiv3/services/subscription-listener</subscriptionListenerUrl>
-
<juddiApiUrl>http://REMOTE_HOST:REMOTE_PORT/juddiv3/services/juddi-api</juddiApiUrl>
- -->
- <!-- In VM Transport Settings -->
-
<proxyTransport>org.jboss.internal.soa.esb.registry.client.JuddiInVMTransport</proxyTransport>
-
<custodyTransferUrl>org.apache.juddi.api.impl.UDDICustodyTransferImpl</custodyTransferUrl>
-
<inquiryUrl>org.apache.juddi.api.impl.UDDIInquiryImpl</inquiryUrl>
-
<publishUrl>org.apache.juddi.api.impl.UDDIPublicationImpl</publishUrl>
-
<securityUrl>org.apache.juddi.api.impl.UDDISecurityImpl</securityUrl>
-
<subscriptionUrl>org.apache.juddi.api.impl.UDDISubscriptionImpl</subscriptionUrl>
-
<subscriptionListenerUrl>org.apache.juddi.api.impl.UDDISubscriptionListenerImpl</subscriptionListenerUrl>
-
<juddiApiUrl>org.apache.juddi.api.impl.JUDDIApiImpl</juddiApiUrl>
- <!-- RMI Transport Settings
-
<proxyTransport>org.jboss.internal.soa.esb.registry.client.JuddiRMITransport</proxyTransport>
-
<custodyTransferUrl>/juddiv3/UDDICustodyTransferService</custodyTransferUrl>
- <inquiryUrl>/juddiv3/UDDIInquiryService</inquiryUrl>
- <publishUrl>/juddiv3/UDDIPublicationService</publishUrl>
- <securityUrl>/juddiv3/UDDISecurityService</securityUrl>
-
<subscriptionUrl>/juddiv3/UDDISubscriptionService</subscriptionUrl>
-
<subscriptionListenerUrl>/juddiv3/UDDISubscriptionListenerService</subscriptionListenerUrl>
- <juddiApiUrl>/juddiv3/JUDDIApiService</juddiApiUrl>
-
<javaNamingFactoryInitial>org.jnp.interfaces.NamingContextFactory</javaNamingFactoryInitial>
-
<javaNamingFactoryUrlPkgs>org.jboss.naming</javaNamingFactoryUrlPkgs>
-
<javaNamingProviderUrl>jnp://${jboss.esb.bind.address}:1099</javaNamingProviderUrl>
- -->
- </node>
- <node>
- <name>riftsaw</name>
- <description>Riftsaw node</description>
- <properties>
- <property name="keyDomain"
value="riftsaw.jboss.org"/>
- <property name="businessKey"
value="redhat-jboss"/>
- <property name="serviceDescription" value="BPEL Service
deployed by Riftsaw"/>
- <property name="bindingDescription" value="BPEL Endpoint
deployed by Riftsaw"/>
- </properties>
- <!--In VM Transport Settings -->
-
<proxyTransport>org.jboss.internal.soa.esb.registry.client.JuddiInVMTransport</proxyTransport>
-
<custodyTransferUrl>org.apache.juddi.api.impl.UDDICustodyTransferImpl</custodyTransferUrl>
-
<inquiryUrl>org.apache.juddi.api.impl.UDDIInquiryImpl</inquiryUrl>
-
<publishUrl>org.apache.juddi.api.impl.UDDIPublicationImpl</publishUrl>
-
<securityUrl>org.apache.juddi.api.impl.UDDISecurityImpl</securityUrl>
-
<subscriptionUrl>org.apache.juddi.api.impl.UDDISubscriptionImpl</subscriptionUrl>
-
<subscriptionListenerUrl>org.apache.juddi.api.impl.UDDISubscriptionListenerImpl</subscriptionListenerUrl>
-
<juddiApiUrl>org.apache.juddi.api.impl.JUDDIApiImpl</juddiApiUrl>
-
- </node>
- </nodes>
- <clerks registerOnStartup="true">
- <clerk name="BPELClerk" node="riftsaw"
password="" publisher="riftsaw"/>
- </clerks>
- </manager>
-</uddi>
\ No newline at end of file
Copied: trunk/distribution/src/main/release/conf/juddi/riftsaw.uddi.xml (from rev 1351,
trunk/distribution/src/main/release/conf/juddi/esb.juddi.client.xml)
===================================================================
--- trunk/distribution/src/main/release/conf/juddi/riftsaw.uddi.xml
(rev 0)
+++ trunk/distribution/src/main/release/conf/juddi/riftsaw.uddi.xml 2011-06-07 14:32:54
UTC (rev 1372)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uddi>
+ <reloadDelay>3600000</reloadDelay>
+ <manager name="riftsaw-manager">
+ <nodes>
+ <node isHomeJUDDI="true">
+ <name>riftsaw</name>
+ <description>Riftsaw node</description>
+ <properties>
+ <property name="keyDomain"
value="riftsaw.jboss.org"/>
+ <property name="businessName"
value="redhat-jboss"/>
+ <property name="serviceDescription" value="BPEL Service
deployed by Riftsaw"/>
+ <property name="bindingDescription" value="BPEL Endpoint
deployed by Riftsaw"/>
+ </properties>
+ <!--In VM Transport Settings -->
+
<proxyTransport>org.apache.juddi.v3.client.transport.InVMTransport</proxyTransport>
+
<custodyTransferUrl>org.apache.juddi.api.impl.UDDICustodyTransferImpl</custodyTransferUrl>
+
<inquiryUrl>org.apache.juddi.api.impl.UDDIInquiryImpl</inquiryUrl>
+
<publishUrl>org.apache.juddi.api.impl.UDDIPublicationImpl</publishUrl>
+
<securityUrl>org.apache.juddi.api.impl.UDDISecurityImpl</securityUrl>
+
<subscriptionUrl>org.apache.juddi.api.impl.UDDISubscriptionImpl</subscriptionUrl>
+
<subscriptionListenerUrl>org.apache.juddi.api.impl.UDDISubscriptionListenerImpl</subscriptionListenerUrl>
+
<juddiApiUrl>org.apache.juddi.api.impl.JUDDIApiImpl</juddiApiUrl>
+ </node>
+ </nodes>
+ <clerks registerOnStartup="true">
+ <clerk name="BPELClerk" node="riftsaw"
password="" publisher="riftsaw"/>
+ </clerks>
+ </manager>
+</uddi>
\ No newline at end of file
Modified: trunk/distribution/src/main/release/conf/juddi/riftsaw_BusinessEntity.xml
===================================================================
--- trunk/distribution/src/main/release/conf/juddi/riftsaw_BusinessEntity.xml 2011-06-07
13:39:25 UTC (rev 1371)
+++ trunk/distribution/src/main/release/conf/juddi/riftsaw_BusinessEntity.xml 2011-06-07
14:32:54 UTC (rev 1372)
@@ -38,7 +38,7 @@
See below for other fields that you may want to edit...
-->
-<businessEntity xmlns="urn:uddi-org:api_v3"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
businessKey="uddi:riftsaw.jboss.org:redhat-jboss">
+<businessEntity xmlns="urn:uddi-org:api_v3"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
businessKey="uddi:riftsaw.jboss.org:business_redhat-jboss">
<name xml:lang="en">Riftsaw Business</name>
<!-- Change the description field to provided a brief description of your registry
-->
<description xml:lang="en">The business that owns all the services
deployed by Riftsaw</description>
Modified: trunk/distribution/src/main/release/install/build.xml
===================================================================
--- trunk/distribution/src/main/release/install/build.xml 2011-06-07 13:39:25 UTC (rev
1371)
+++ trunk/distribution/src/main/release/install/build.xml 2011-06-07 14:32:54 UTC (rev
1372)
@@ -322,7 +322,7 @@
</condition>
</target>
- <target name="deploy.esb.uddi.config" if="is.jbossesb-registry"
depends="check.jbossesb-registry,renameEsbJUDDIClientXML">
+ <target name="deploy.esb.uddi.config" if="is.jbossesb-registry"
depends="check.jbossesb-registry">
<echo>deploy jUDDI configuration</echo>
<copy file="../conf/juddi/riftsaw_Publisher.xml"
@@ -331,34 +331,22 @@
todir="${deploy.dir}/jbossesb-registry.sar/juddi_custom_install_data/"
overwrite="true"/>
<copy file="../conf/juddi/riftsaw_BusinessEntity.xml"
todir="${deploy.dir}/jbossesb-registry.sar/juddi_custom_install_data/"
overwrite="true" />
+ <copy file="../conf/juddi/riftsaw.uddi.xml"
+ todir="${deploy.dir}/riftsaw.sar/META-INF/"
overwrite="true" />
<replace file="${deploy.dir}/riftsaw.sar/bpel.properties"
token="bpel.uddi.registration=false"
value="bpel.uddi.registration=true"/>
<replace file="${deploy.dir}/riftsaw.sar/bpel.properties"
token="bpel.uddi.lookup=false"
value="bpel.uddi.lookup=true"/>
+ <replace file="${deploy.dir}/riftsaw.sar/META-INF/jboss-beans.xml"
+
token="<!--<depends>jboss.esb:service=JuddiClient</depends>-->"
+
value="<depends>jboss.esb:service=JuddiClient</depends>"/>
- <!-- juddi-client, should be removed once esb catches up to 3.0.4-->
- <!-- now deletes the 3.0.3 version, and then copy the 3.0.4 into the
esb.deployer/lib-->
- <delete file="${deployers.dir}/esb.deployer/lib/juddi-client-3.0.3.jar"
/>
- <copy todir="${deployers.dir}/esb.deployer/lib"
overwrite="true">
- <fileset dir="../conf/juddi">
- <include name="juddi-client-*.jar"/>
- </fileset>
- </copy>
-
</target>
-
- <target name="renameEsbJUDDIClientXML" if="isNot.renamedToOld"
depends="check.esb.juddi.client.xml.old">
- <move file="${deploy.dir}/jbossesb.sar/esb.juddi.client.xml"
- tofile="${deploy.dir}/jbossesb.sar/esb.juddi.client.xml.old" />
- <copy file="../conf/juddi/esb.juddi.client.xml"
- tofile="${deploy.dir}/jbossesb.sar/esb.juddi.client.xml" />
- </target>
-
+
<target name="undeploy.esb.uddi.config"
if="is.jbossesb-registry" depends="check.jbossesb-registry">
<echo>undeploy jUDDI configuration</echo>
- <move file="${deploy.dir}/jbossesb.sar/esb.juddi.client.xml.old"
tofile="${deploy.dir}/jbossesb.sar/esb.juddi.client.xml"/>
<delete
file="${deploy.dir}/jbossesb-registry.sar/juddi_custom_install_data/riftsaw_Publisher.xml"
/>
<delete
file="${deploy.dir}/jbossesb-registry.sar/juddi_custom_install_data/riftsaw_BusinessEntity.xml"
/>
<delete
file="${deploy.dir}/jbossesb-registry.sar/juddi_custom_install_data/riftsaw_tModels.xml"
/>
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java 2011-06-07
13:39:25 UTC (rev 1371)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java 2011-06-07
14:32:54 UTC (rev 1372)
@@ -43,12 +43,14 @@
import org.jboss.soa.bpel.runtime.engine.BPELEngine;
import org.jboss.soa.bpel.runtime.ws.ODEMessageAdapter;
import org.jboss.soa.dsp.InvocationAdapter;
+import org.jboss.soa.dsp.server.ServerConfig;
import org.jboss.soa.bpel.runtime.JBossDSPFactory;
import org.w3c.dom.Element;
import javax.transaction.*;
import javax.transaction.xa.XAResource;
+import java.net.URL;
import java.util.List;
import java.util.StringTokenizer;
import java.util.concurrent.*;
@@ -61,7 +63,10 @@
*/
public class BPELEngineImpl implements BPELEngine, ExecutionEnvironment
{
-
+ private final static String BPEL_UDDI_REGISTRATION = "uddi.registration";
+ public final static String BPEL_WEBSERVICE_SECURE = "webservice.secure";
+ public final static String BPEL_WEBSERVICE_BASEURL = "webservice.baseurl";
+
protected final Log __log = LogFactory.getLog(getClass());
protected final Log __logTx = LogFactory.getLog("org.apache.ode.tx");
@@ -77,6 +82,7 @@
protected ExecutorService _executorService;
protected CronScheduler _cronScheduler;
protected CacheProvider _cacheProvider;
+ protected UDDIRegistration _uddiRegistration;
/**
* The default constructor.
@@ -299,6 +305,8 @@
initCacheProvider();
__log.debug("Initializing BPEL process store.");
initProcessStore(eprContext);
+ __log.debug("Initializing UDDI registration");
+ initUDDIRegistration();
__log.debug("Initializing BPEL server.");
initBpelServer(eprContext);
@@ -350,6 +358,16 @@
_cacheProvider.stop();
+ if (_uddiRegistration != null)
+ try {
+ __log.debug("shutting down UDDI Registration client.");
+ _uddiRegistration.shutdown();
+ _uddiRegistration = null;
+ } catch (Throwable ex) {
+ __log.debug("Error stopping UDDI Registration client.", ex);
+ }
+
+
if( _cronScheduler != null ) {
try {
__log.debug("shutting down cron scheduler.");
@@ -478,6 +496,33 @@
_store = createProcessStore(eprContext, _txMgr, _storeCF);
_store.registerListener(new ProcessStoreListenerImpl());
}
+
+ protected void initUDDIRegistration() {
+ _odeConfig.getProperties();
+ boolean isRegistration =
Boolean.valueOf(_odeConfig.getProperty(BPEL_UDDI_REGISTRATION, "false"));
+ boolean isWebserviceSecure =
Boolean.valueOf(_odeConfig.getProperty(BPEL_WEBSERVICE_SECURE, "false"));
+ if (isRegistration) {
+ try {
+
+ ServerConfig serverConfig=JBossDSPFactory.getServerConfig();
+ String webServiceHost = serverConfig.getWebServiceHost();
+ int webServicePort = serverConfig.getWebServicePort();
+ URL url = new URL("http://" + webServiceHost + ":" +
webServicePort);
+ if (isWebserviceSecure) {
+ int secureWebServicePort = serverConfig.getWebServicePort();
+ url = new URL("https://" + webServiceHost + ":" +
secureWebServicePort);
+ }
+ //give the user the option to override
+ if (_odeConfig.getProperty(BPEL_WEBSERVICE_BASEURL)==null) {
+ _odeConfig.getProperties().setProperty(BPEL_WEBSERVICE_BASEURL,
url.toExternalForm());
+ }
+ _uddiRegistration = UDDIClientFactory.newInstance(_odeConfig.getProperties());
+ } catch (Exception e) {
+ __log.error(e.getMessage());
+ __log.error("Continuing without UDDI integration.");
+ }
+ }
+ }
protected ProcessStoreImpl createProcessStore(EndpointReferenceContext eprContext,
TransactionManager txm, ConfStoreDAOConnectionFactory cf) {
return new RiftSawProcessStore(eprContext, txm, cf, _cacheProvider);
@@ -816,4 +861,8 @@
return _txMgr;
}
+ public UDDIRegistration getUDDIRegistration() {
+ return _uddiRegistration;
+ }
+
}
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/ExecutionEnvironment.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/ExecutionEnvironment.java 2011-06-07
13:39:25 UTC (rev 1371)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/ExecutionEnvironment.java 2011-06-07
14:32:54 UTC (rev 1372)
@@ -39,4 +39,6 @@
CronScheduler getCronScheduler();
OdeConfigProperties getOdeConfig();
+
+ UDDIRegistration getUDDIRegistration();
}
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 2011-06-07
13:39:25 UTC (rev 1371)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java 2011-06-07
14:32:54 UTC (rev 1372)
@@ -48,7 +48,6 @@
private BPELEngineImpl engine;
private EndpointManager endpointManager;
- private UDDIRegistration uddiRegistration = null;
public JAXWSBindingContext(BPELEngineImpl server) {
this.engine = server;
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 2011-06-07
13:39:25 UTC (rev 1371)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2011-06-07
14:32:54 UTC (rev 1372)
@@ -29,12 +29,10 @@
import org.jboss.soa.bpel.runtime.JBossDSPFactory;
import org.jboss.soa.bpel.runtime.engine.ode.BPELEngineImpl;
import org.jboss.soa.bpel.runtime.engine.ode.ExecutionEnvironment;
-import org.jboss.soa.bpel.runtime.engine.ode.UDDIClientFactory;
import org.jboss.soa.bpel.runtime.engine.ode.UDDIRegistration;
import org.jboss.soa.dsp.EndpointMetaData;
import org.jboss.soa.dsp.ServiceEndpointReference;
import org.jboss.soa.dsp.server.ServerConfig;
-import org.jboss.soa.bpel.runtime.JBossDSPFactory;
import org.jboss.soa.dsp.ws.BaseWebServiceEndpoint;
import org.jboss.soa.dsp.ws.DeploymentBuilder;
import org.jboss.soa.dsp.ws.WSDLParser;
@@ -61,29 +59,21 @@
public class EndpointManager
{
protected final Log log = LogFactory.getLog(getClass());
- // we should consider having our own OdeConfigProperties class if we need more
properties
- private final static String BPEL_UDDI_REGISTRATION = "uddi.registration";
+
private static final String BPEL_WS_STABLE_INTERFACE = "ws.stableInterface";
private Map<String, ServiceEndpointReference> endpointMapping = new
ConcurrentHashMap<String, ServiceEndpointReference>();
private ServerConfig serverConfig;
private ExecutionEnvironment executionEnvironment;
- private UDDIRegistration uddiRegistration = null;
+ private UDDIRegistration uddiRegistration;
private boolean stableInterface=false;
public EndpointManager(ExecutionEnvironment executionEnvironment)
{
this.executionEnvironment = executionEnvironment;
this.serverConfig = JBossDSPFactory.getServerConfig();
- if (isUDDIRegistration()) {
- try {
- uddiRegistration =
UDDIClientFactory.newInstance(executionEnvironment.getOdeConfig().getProperties());
- } catch (Exception e) {
- log.error(e.getMessage());
- log.error("Running without UDDI integration.");
- }
- }
+ this.uddiRegistration = executionEnvironment.getUDDIRegistration();
stableInterface =
executionEnvironment.getOdeConfig().getProperty(BPEL_WS_STABLE_INTERFACE,
"false").equalsIgnoreCase("true");
@@ -202,8 +192,10 @@
ref
);
if (uddiRegistration!=null) {
- uddiRegistration.registerEPR(metaData.getServiceName().getLocalPart(),
metaData.getPortName(),
- ref.getServiceUrl());
+ String processId = metaData.getProcessId().getLocalPart();
+ String version =
processId.substring(processId.lastIndexOf("-")+1,processId.length());
+ uddiRegistration.registerBPELProcess(metaData.getServiceName(),
+ version, metaData.getPortName(), serviceUrl, wsdlRef.getWsdlURL(),
wsdlRef.getDefinition());
}
return ODEServiceEndpointReference.toODE(ref);
@@ -252,7 +244,7 @@
log.warn(ref.getArchiveLocation() + " cannot be removed (doesn't
exist).");
}
if (uddiRegistration!=null) {
- uddiRegistration.unRegisterEPR(service, port);
+ uddiRegistration.unRegisterBPELEPR(service, port, ref.getServiceUrl());
}
}
catch (Exception e)
@@ -301,8 +293,4 @@
return( path.delete() );
}
- public boolean isUDDIRegistration() {
- return
Boolean.valueOf(executionEnvironment.getOdeConfig().getProperty(BPEL_UDDI_REGISTRATION,
"false"));
- }
-
}
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 2011-06-07
13:39:25 UTC (rev 1371)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2011-06-07
14:32:54 UTC (rev 1372)
@@ -35,6 +35,7 @@
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPFault;
import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Dispatch;
import javax.xml.ws.Service;
@@ -72,10 +73,6 @@
public class WebServiceClient implements PartnerChannel
{
private static final String JAXWS_CLIENT_INITIALIZER =
"jaxws.client.initializer.impl";
-//we should consider having our own OdeConfigProperties class if we need more properties
- public final static String BPEL_UDDI_LOOKUP = "uddi.lookup";
- public final static String BPEL_WEBSERVICE_SECURE = "webservice.secure";
- public final static String BPEL_WEBSERVICE_BASEURL = "webservice.baseurl";
protected final Log log = LogFactory.getLog(getClass());
private boolean isInitialized=false;
@@ -105,6 +102,7 @@
this.engine = engine;
this.executionEnvironment = env;
this.metaData = metaData;
+ this.uddiRegistration = executionEnvironment.getUDDIRegistration();
this.id = metaData.getEndpointId();
this.serviceName = metaData.getServiceName();
@@ -127,41 +125,11 @@
}
private synchronized void initialize() {
- if (isUDDILookup()) {
- try {
- ServerConfig serverConfig=JBossDSPFactory.getServerConfig();
- String webServiceHost = serverConfig.getWebServiceHost();
- int webServicePort = serverConfig.getWebServicePort();
- URL url = new URL("http://" + webServiceHost + ":" +
webServicePort);
- if (isWebserviceSecure()) {
- int secureWebServicePort = serverConfig.getWebServicePort();
- url = new URL("https://" + webServiceHost + ":" +
secureWebServicePort);
- }
- //give the user the option to override
- if (engine.getOdeConfig().getProperty(BPEL_WEBSERVICE_BASEURL)==null) {
- engine.getOdeConfig().getProperties().setProperty(BPEL_WEBSERVICE_BASEURL,
url.toExternalForm());
- }
- uddiRegistration =
UDDIClientFactory.newInstance(engine.getOdeConfig().getProperties());
- } catch (Exception e) {
- log.error(e.getMessage());
- log.error("Continuing without UDDI integration.");
- }
- }
- if (isUDDILookup()) {
- WSDLReference wsdlReference = uddiRegistration.lookupWSDL(
- metaData.getServiceName(),
- metaData.getPortName());
- if (wsdlReference!=null) {
- wsdlDefinition = wsdlReference.getDefinition();
- wsdlUrl = wsdlReference.getWsdlURL();
- }
- }
- if (isUDDILookup()==false || wsdlUrl==null) {
- WSDLReference wsdlReference = new WSDLHelper().createWSDLReference(engine,
- metaData.getProcessId(), metaData.getServiceName(), metaData.getPortName());
- wsdlDefinition = wsdlReference.getDefinition();
- wsdlUrl = wsdlReference.getWsdlURL();
- }
+
+ WSDLReference wsdlReference = new WSDLHelper().createWSDLReference(engine,
+ metaData.getProcessId(), metaData.getServiceName(), metaData.getPortName());
+ wsdlDefinition = wsdlReference.getDefinition();
+ wsdlUrl = wsdlReference.getWsdlURL();
this.messageAdapter = new SOAPMessageAdapter(this.wsdlDefinition, serviceName,
port.getLocalPart());
isInitialized=true;
@@ -287,6 +255,7 @@
// The actual WS invocation
Dispatch<SOAPMessage> proxy = getDispatcher(epr, port);
+ setEndpointFromUDDI(proxy);
try {
// Set SOAPAction
@@ -302,7 +271,7 @@
// Set client side timeout for the invocation
proxy.getRequestContext().put("javax.xml.ws.client.receiveTimeout",
Long.toString(timeout));
- SOAPMessage soapResponseMessage =
(SOAPMessage)proxy.invoke(soapRequestMessage);
+ SOAPMessage soapResponseMessage = proxy.invoke(soapRequestMessage);
if (log.isDebugEnabled()) {
log.debug("Riftsaw soap response message: \n" +
JavaUtils.getSoapMessageASString(soapResponseMessage));
@@ -415,7 +384,8 @@
}
// The actual WS invocation
- Dispatch proxy = getDispatcher(epr, port);
+ Dispatch<SOAPMessage> proxy = getDispatcher(epr, port);
+ setEndpointFromUDDI(proxy);
// Set SOAPAction
if (soapAction != null) {
@@ -485,7 +455,7 @@
private synchronized Dispatch<SOAPMessage>
getDispatcher(javax.xml.ws.EndpointReference epr, QName portName)
{
-
+
if(null==dispatcher) {
log.debug("Creating Dispatcher ("+this.id+") on " + wsdlUrl +
": "+serviceName);
@@ -512,7 +482,6 @@
initializer.serviceCreated();
}
}
-
return dispatcher;
}
@@ -540,21 +509,22 @@
return(initializer);
}
+
+ private void setEndpointFromUDDI(Dispatch<SOAPMessage> proxy) {
+ if (uddiRegistration!=null) {
+ String endpoint = uddiRegistration.lookupEndpoint(serviceName,
port.getLocalPart());
+ if (endpoint!=null) {
+ proxy.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
endpoint);
+ } else {
+ log.debug("Could not find endpoint in UDDI registry for service " +
serviceName.getLocalPart());
+ }
+ }
+ }
public String toString()
{
return "WebServiceClient
{service="+serviceName+",port="+port+"}";
}
- public boolean isUDDILookup() {
- return Boolean.valueOf(engine.getOdeConfig().getProperty(BPEL_UDDI_LOOKUP,
"false"));
- }
-
- public boolean isWebserviceSecure() {
- return Boolean.valueOf(engine.getOdeConfig().getProperty(BPEL_WEBSERVICE_SECURE,
"false"));
- }
-
-
-
}
Modified: trunk/runtime/uddi/pom.xml
===================================================================
--- trunk/runtime/uddi/pom.xml 2011-06-07 13:39:25 UTC (rev 1371)
+++ trunk/runtime/uddi/pom.xml 2011-06-07 14:32:54 UTC (rev 1372)
@@ -26,7 +26,7 @@
<dependency>
<artifactId>juddi-client</artifactId>
<groupId>org.apache.juddi</groupId>
- <version>3.0.4</version>
+ <version>3.1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>