Author: kurtstam
Date: 2010-03-01 21:54:09 -0500 (Mon, 01 Mar 2010)
New Revision: 522
Added:
trunk/distribution/src/main/release/db/juddi/esb.juddi300.client.xml
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ClassUtil.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/UDDIClientFactory.java
Modified:
trunk/distribution/src/main/release/db/bpel.properties
trunk/distribution/src/main/release/db/juddi/esb.juddi.client.xml
trunk/distribution/src/main/release/install/build.xml
trunk/runtime/engine-assembly/pom.xml
trunk/runtime/engine-assembly/src/main/resources/bpel.properties
trunk/runtime/engine/pom.xml
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/UDDIRegistration.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java
trunk/runtime/pom.xml
Log:
Riftsaw-140, Change UDDI integration over to use the jUDDI-3.0.1 libs when those are
released. The installation figures out if the target is:
1. plain jboss-5.1
2. jboss-5.1 + jbesb-4.7
3. SOA-P 5 - only this install uses jUDDI-3.0.1
Modified: trunk/distribution/src/main/release/db/bpel.properties
===================================================================
--- trunk/distribution/src/main/release/db/bpel.properties 2010-03-01 16:45:34 UTC (rev
521)
+++ trunk/distribution/src/main/release/db/bpel.properties 2010-03-02 02:54:09 UTC (rev
522)
@@ -90,7 +90,13 @@
# if set to true will self-register BPEL endpoints upon deployment to a UDDI.
# this uses the juddi-client-3.0.0 and the uddi client config can be set in the uddi.xml
# file
-bpel.uddi.registration=true
+bpel.uddi.registration=false
+# implementation of the client integration class
+bpel.uddi.client.impl=org.jboss.soa.bpel.uddi.UDDIRegistration
+# name of the clerk manager
+bpel.uddi.clerk.manager=esb-registry
+# name of the clerk
+bpel.uddi.clerk=BPEL_clerk
hibernate.dialect=@dialect@
hibernate.hbm2ddl.auto=update
Modified: trunk/distribution/src/main/release/db/juddi/esb.juddi.client.xml
===================================================================
--- trunk/distribution/src/main/release/db/juddi/esb.juddi.client.xml 2010-03-01 16:45:34
UTC (rev 521)
+++ trunk/distribution/src/main/release/db/juddi/esb.juddi.client.xml 2010-03-02 02:54:09
UTC (rev 522)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<uddi>
- <reloadDelay>5000</reloadDelay>
- <manager name="test-manager">
+ <reloadDelay>3600000</reloadDelay>
+ <manager name="esb-registry">
<nodes>
<node>
<!-- required 'default' node -->
@@ -34,7 +34,7 @@
<subscriptionListenerUrl>org.apache.juddi.api.impl.UDDISubscriptionListenerImpl</subscriptionListenerUrl>
<juddiApiUrl>org.apache.juddi.api.impl.JUDDIApiImpl</juddiApiUrl>
<!-- RMI Transport Settings
-
<proxyTransport>org.apache.juddi.v3.client.transport.RMITransport</proxyTransport>
+
<proxyTransport>org.jboss.internal.soa.esb.registry.client.JuddiRMITransport</proxyTransport>
<custodyTransferUrl>/juddiv3/UDDICustodyTransferService</custodyTransferUrl>
<inquiryUrl>/juddiv3/UDDIInquiryService</inquiryUrl>
<publishUrl>/juddiv3/UDDIPublicationService</publishUrl>
@@ -47,6 +47,19 @@
<javaNamingProviderUrl>jnp://${jboss.esb.bind.address}:1099</javaNamingProviderUrl>
-->
</node>
+ <node>
+ <name>default-ws</name>
+ <description>jUDDI console node</description>
+ <!-- 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="default"
publisher="jbossesb" password="jbossesb" />
Copied: trunk/distribution/src/main/release/db/juddi/esb.juddi300.client.xml (from rev
520, trunk/distribution/src/main/release/db/juddi/esb.juddi.client.xml)
===================================================================
--- trunk/distribution/src/main/release/db/juddi/esb.juddi300.client.xml
(rev 0)
+++ trunk/distribution/src/main/release/db/juddi/esb.juddi300.client.xml 2010-03-02
02:54:09 UTC (rev 522)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<uddi>
+ <reloadDelay>5000</reloadDelay>
+ <manager name="test-manager">
+ <nodes>
+ <node>
+ <!-- required 'default' node -->
+ <name>default</name>
+ <description>Main jUDDI node</description>
+ <properties>
+ <property name="keyDomain"
value="esb.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>
+ <!-- JAX-WS Transport
+
<proxyTransport>org.apache.juddi.v3.client.transport.JAXWSTransport</proxyTransport>
+
<custodyTransferUrl>http://${jboss.esb.bind.address}:8080/juddiv3/services/custody-transfer?wsdl</custodyTransferUrl>
+
<inquiryUrl>http://${jboss.esb.bind.address}:8080/juddiv3/services/inquiry?wsdl</inquiryUrl>
+
<publishUrl>http://${jboss.esb.bind.address}:8080/juddiv3/services/publish?wsdl</publishUrl>
+
<securityUrl>http://${jboss.esb.bind.address}:8080/juddiv3/services/security?wsdl</securityUrl>
+
<subscriptionUrl>http://${jboss.esb.bind.address}:8080/juddiv3/services/subscription?wsdl</subscriptionUrl>
+
<subscriptionListenerUrl>http://${jboss.esb.bind.address}:8080/juddiv3/services/subscription-listener?wsdl</subscriptionListenerUrl>
+
<juddiApiUrl>http://${jboss.esb.bind.address}:8080/juddiv3/services/juddi-api?wsdl</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.apache.juddi.v3.client.transport.RMITransport</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>
+ </nodes>
+ <clerks registerOnStartup="true">
+ <clerk name="BPELClerk" node="default"
publisher="jbossesb" password="jbossesb" />
+ </clerks>
+ </manager>
+</uddi>
Property changes on: trunk/distribution/src/main/release/db/juddi/esb.juddi300.client.xml
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: trunk/distribution/src/main/release/install/build.xml
===================================================================
--- trunk/distribution/src/main/release/install/build.xml 2010-03-01 16:45:34 UTC (rev
521)
+++ trunk/distribution/src/main/release/install/build.xml 2010-03-02 02:54:09 UTC (rev
522)
@@ -237,13 +237,33 @@
<condition property="is.jbossesb-registry">
<available file="${deploy.dir}/jbossesb-registry.sar" />
</condition>
+ <condition property="isNot.jbossesb-registry">
+ <isfalse value="${is.jbossesb-registry}"/>
+ </condition>
</target>
- <target name="deploy.esb.uddi.config" if="is.jbossesb-registry"
depends="check.jbossesb-registry">
+ <target name="check.esb.juddi.client.xml.old"
if="is.jbossesb-registry" depends="check.jbossesb-registry">
+ <condition property="is.renamedToOld">
+ <available
file="${deploy.dir}/jbossesb-registry.sar/esb.juddi.client.xml.old" />
+ </condition>
+ <condition property="isNot.renamedToOld">
+ <isfalse value="${is.renamedToOld}"/>
+ </condition>
+ </target>
+
+ <target name="check.UDDI300" if="is.jbossesb-registry"
depends="check.jbossesb-registry">
+ <condition property="is.juddi300">
+ <available
file="${deployers.dir}/esb.deployer/lib/juddi-client-3.0.0.aop.jar" />
+ </condition>
+ <condition property="is.juddi">
+ <isfalse value="${is.juddi300}"/>
+ </condition>
+ </target>
+
+ <target name="deploy.esb.uddi.config" if="is.jbossesb-registry"
depends="check.jbossesb-registry,removeUDDI,removeUDDI300,renameEsbJUDDIClientXML">
<echo>deploy jUDDI configuration</echo>
- <move file="${deploy.dir}/jbossesb.sar/esb.juddi.client.xml"
tofile="${deploy.dir}/jbossesb.sar/esb.juddi.client.xml.old"/>
- <copy file="../db/juddi/esb.juddi.client.xml"
- todir="${deploy.dir}/jbossesb.sar" />
+
+
<move
file="${deploy.dir}/jbossesb-registry.sar/juddi_custom_install_data/jbossesb_tModels.xml"
tofile="${deploy.dir}/jbossesb-registry.sar/juddi_custom_install_data/jbossesb_tModels.xml.old"/>
<copy file="../db/juddi/jbossesb_tModels.xml"
@@ -251,8 +271,48 @@
<copy file="../db/juddi/jbossesb_BusinessEntity.xml"
todir="${deploy.dir}/jbossesb-registry.sar/juddi_custom_install_data/"
/>
<replace file="${deploy.dir}/riftsaw.sar/bpel.properties"
token="bpel.uddi.registration=false"
value="bpel.uddi.registration=true"/>
+ <replace file="${deploy.dir}/jbossesb-registry.sar/esb.juddi.xml">
+
<replacetoken><![CDATA[juddi.seed.always">false]]></replacetoken>
+
<replacevalue><![CDATA[juddi.seed.always">true]]></replacevalue>
+ </replace>
+ <echo>${manager.name}</echo>
+ <replace file="${deploy.dir}/riftsaw.sar/bpel.properties"
+ token="bpel.uddi.clerk.manager=esb-registry"
+ value="bpel.uddi.clerk.manager=${manager.name}"/>
+ <replace file="${deploy.dir}/riftsaw.sar/bpel.properties"
+ token="bpel.uddi.client.impl=org.jboss.soa.bpel.uddi.UDDIRegistration"
+ value="bpel.uddi.client.impl=${UDDI.impl}"/>
</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="../db/juddi/esb.${juddi.version}.client.xml"
+ tofile="${deploy.dir}/jbossesb.sar/esb.juddi.client.xml" />
+ </target>
+
+ <!-- remove riftsaw-uddi jar if esb contains juddi-300 client artifacts -->
+ <target name="removeUDDI" if="is.juddi300"
depends="check.UDDI300">
+ <echo>remove riftsaw-uddi.jar</echo>
+ <property name="juddi.version" value="juddi300"/>
+ <property name="manager.name" value="test-manager"/>
+ <property name="UDDI.impl"
value="org.jboss.soa.bpel.uddi300.UDDI300Registration" />
+ <delete>
+ <fileset dir="${deploy.dir}/riftsaw.sar/lib/"
includes="riftsaw-uddi-*.jar"/>
+ </delete>
+ </target>
+
+ <!-- remove riftsaw-uddi300 jar if esb contains juddi-301 or higher client artifacts
-->
+ <target name="removeUDDI300" if="is.juddi"
depends="check.UDDI300">
+ <echo>remove riftsaw-uddi300.jar</echo>
+ <property name="juddi.version" value="juddi"/>
+ <property name="manager.name" value="esb-registry"/>
+ <property name="UDDI.impl"
value="org.jboss.soa.bpel.uddi.UDDIRegistration" />
+ <delete>
+ <fileset dir="${deploy.dir}/riftsaw.sar/lib/"
includes="riftsaw-uddi300-*.jar"/>
+ </delete>
+ </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"/>
Modified: trunk/runtime/engine/pom.xml
===================================================================
--- trunk/runtime/engine/pom.xml 2010-03-01 16:45:34 UTC (rev 521)
+++ trunk/runtime/engine/pom.xml 2010-03-02 02:54:09 UTC (rev 522)
@@ -125,16 +125,7 @@
<artifactId>h2</artifactId>
<scope>provided</scope>
</dependency>
- <!-- UDDI v3 -->
- <dependency>
- <artifactId>juddi-client</artifactId>
- <groupId>org.apache.juddi</groupId>
- <version>3.0.0</version>
- <scope>provided</scope>
- </dependency>
-
-
</dependencies>
Added: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ClassUtil.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ClassUtil.java
(rev 0)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ClassUtil.java 2010-03-02
02:54:09 UTC (rev 522)
@@ -0,0 +1,53 @@
+/*
+ * 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;
+
+/**
+ * @author Kurt T Stam <kurt.stam(a)jboss.com>
+ */
+
+public class ClassUtil {
+ @SuppressWarnings("unchecked")
+ public static Class forName(String name, Class caller)
+ throws ClassNotFoundException
+ {
+ ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader();
+ if (threadClassLoader != null) {
+ try {
+ return Class.forName(name, true, threadClassLoader) ;
+ } catch (ClassNotFoundException cnfe) {
+ if (cnfe.getException() != null) {
+ throw cnfe;
+ }
+ }
+ }
+
+ ClassLoader callerClassLoader = caller.getClassLoader();
+ if (callerClassLoader != null) {
+ try {
+ return Class.forName(name, true, callerClassLoader) ;
+ } catch (final ClassNotFoundException cnfe) {
+ if (cnfe.getException() != null) {
+ throw cnfe ;
+ }
+ }
+ }
+
+ return Class.forName(name, true, ClassLoader.getSystemClassLoader()) ;
+ }
+}
Added:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/UDDIClientFactory.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/UDDIClientFactory.java
(rev 0)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/UDDIClientFactory.java 2010-03-02
02:54:09 UTC (rev 522)
@@ -0,0 +1,55 @@
+/*
+ * 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.engine.ode;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.bpel.runtime.ClassUtil;
+
+/**
+ *
+ * @author Kurt T Stam <kurt.stam(a)jboss.com>
+ *
+ */
+public class UDDIClientFactory {
+
+ private static Logger log = Logger.getLogger(UDDIClientFactory.class);
+ public static final String UDDI_REGISTRATION_IMPL="UDDI-registration-impl";
+ public static final String
DEFAULT_UDDI_REG_IMPL="org.jboss.soa.bpel.uddi.UDDIRegistration";
+
+ public static UDDIRegistration newInstance(Properties properties) throws
ClassNotFoundException,
+ InstantiationException, IllegalAccessException, IllegalArgumentException,
SecurityException, InvocationTargetException, NoSuchMethodException {
+
+ String uddiRegistrationImpl =
properties.getProperty(UDDI_REGISTRATION_IMPL,DEFAULT_UDDI_REG_IMPL);
+ Class<?> regClass = null;
+ try {
+ regClass = ClassUtil.forName(uddiRegistrationImpl, UDDIClientFactory.class);
+ } catch (ClassNotFoundException cnfe) {
+ log.error("Could not find class " + UDDI_REGISTRATION_IMPL);
+ throw cnfe;
+ }
+ UDDIRegistration uddiRegistration = (UDDIRegistration)
regClass.getConstructor(Properties.class).newInstance(properties);
+ return uddiRegistration;
+ }
+}
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/UDDIRegistration.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/UDDIRegistration.java 2010-03-01
16:45:34 UTC (rev 521)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/UDDIRegistration.java 2010-03-02
02:54:09 UTC (rev 522)
@@ -21,57 +21,17 @@
*/
package org.jboss.soa.bpel.runtime.engine.ode;
-import java.rmi.RemoteException;
-import java.util.Map;
-import java.util.Properties;
-
import javax.xml.namespace.QName;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.juddi.api_v3.AccessPointType;
-import org.apache.juddi.v3.annotations.AnnotationProcessor;
-import org.apache.juddi.v3.client.config.TokenResolver;
-import org.apache.juddi.v3.client.config.UDDIClerk;
-import org.apache.juddi.v3.client.config.UDDIClerkManager;
-import org.apache.juddi.v3.client.transport.TransportException;
import org.jboss.soa.bpel.runtime.ws.EndpointMetaData;
-import org.jboss.soa.bpel.runtime.ws.ServiceEndpointReference;
import org.jboss.soa.bpel.runtime.ws.WSDLReference;
-import org.uddi.api_v3.AccessPoint;
-import org.uddi.api_v3.BindingTemplate;
-import org.uddi.api_v3.BindingTemplates;
-import org.uddi.api_v3.BusinessService;
-import org.uddi.api_v3.CategoryBag;
-import org.uddi.api_v3.Description;
-import org.uddi.api_v3.Name;
-import org.uddi.api_v3.TModelInstanceDetails;
-import org.uddi.api_v3.TModelInstanceInfo;
-import org.uddi.v3_service.DispositionReportFaultMessage;
/**
*
- * * @author Kurt T Stam <kurt.stam(a)jboss.com>
+ * @author Kurt T Stam <kurt.stam(a)jboss.com>
*
*/
-public class UDDIRegistration extends AnnotationProcessor {
-
- protected static final Log log = LogFactory.getLog(UDDIRegistration.class);
- public static final String BPEL_CLERK = "BPELClerk";
- public static final String DEFAULT_SERVICE_KEY_FORMAT =
"uddi:${keyDomain}:bpel-services-";
- public static final String DEFAULT_BINDING_KEY_FORMAT =
"uddi:${keyDomain}:bindings-";
- //Can be set in the uddi.xml property section
- public static final String LANG = "lang";
- public static final String SERVICE_DESCRIPTION =
"serviceDescription";
- public static final String SERVICE_CATEGORY_BAG =
"serviceCategoryBag";
- public static final String BINDING_DESCRIPTION =
"bindingDescription";
- public static final String BINDING_CATEGORY_BAG =
"bindingCategoryBag";
- public static final String BINDING_TMODEL_KEYS =
"bindingTModelKeys";
- public static final String SERVICE_KEY_FORMAT = "serviceKeyFormat";
- public static final String BINDING_KEY_FORMAT = "bindingKeyFormat";
-
-
+public interface UDDIRegistration {
/**
* Registers a BPEL ServiceEndpointReference (EPR) into a UDDI registry using the jUDDI
client code.
* If the serviceKey does not already exist we register the service along with the EPR.
@@ -80,193 +40,12 @@
* @param metaData
* @param wsdlRef
*/
- public void registerEPR(EndpointMetaData metaData, WSDLReference wsdlRef) {
- boolean selfRegister = false;
- try {
- selfRegister = UDDIClerkManager.getClientConfig().isRegisterOnStartup();
- if (selfRegister) {
- Map<String,UDDIClerk> clerks =
UDDIClerkManager.getClientConfig().getUDDIClerks();
- UDDIClerk bpelClerk = clerks.get(BPEL_CLERK);
- if (bpelClerk!=null) {
- try {
- BusinessService service = createBusinessService(bpelClerk, metaData, wsdlRef);
- bpelClerk.register(service, bpelClerk.getUDDINode().getApiNode());
- } catch (Exception e) {
- log.error("Unable to register service " + metaData.getServiceName()
- + " ." + e.getMessage(),e);
- } catch (Throwable t) {
- log.error("Unable to register service " + metaData.getServiceName()
- + " ." + t.getMessage(),t);
- }
- } else {
- throw new ConfigurationException("Could not find UDDI Clerk named "+
BPEL_CLERK);
- }
- }
- } catch (ConfigurationException ce) {
- if (selfRegister) {
- log.error(ce.getMessage(),ce);
- } else {
- log.info(ce.getMessage());
- }
- }
- }
+ public void registerEPR(EndpointMetaData metaData, WSDLReference wsdlRef);
/**
* UnRegisters the binding from the UDDI Registry.
* @param EPR
* @param metaData
* @param wsdlRef
*/
- public void unRegisterEPR(QName service, String port) {
- boolean selfRegister = false;
- try {
- selfRegister = UDDIClerkManager.getClientConfig().isRegisterOnStartup();
- if (selfRegister) {
- Map<String,UDDIClerk> clerks =
UDDIClerkManager.getClientConfig().getUDDIClerks();
- UDDIClerk bpelClerk = clerks.get(BPEL_CLERK);
- String bindingName = service.getLocalPart() + "-" + port;
- if (bpelClerk!=null) {
- try {
- Properties properties = bpelClerk.getUDDINode().getProperties();
- //Constructing the bindingKey
- String bindingKey = TokenResolver.replaceTokens(DEFAULT_BINDING_KEY_FORMAT +
bindingName, properties);
- if (properties.containsKey(BINDING_KEY_FORMAT)) {
- bindingKey =
TokenResolver.replaceTokens((String)properties.get(BINDING_KEY_FORMAT) + bindingName,
properties);
- }
- bindingKey = bindingKey.toLowerCase();
- //Lookup the binding
- BindingTemplate binding = null;
- try {
- binding = bpelClerk.findServiceBinding(bindingKey,
bpelClerk.getUDDINode().getApiNode());
- //TODO Kurt: Just delete this binding -not all bindings- upgrade the jUDDI client
to support this.
- BusinessService businessService = bpelClerk.findService(binding.getServiceKey(),
bpelClerk.getUDDINode().getApiNode());
- bpelClerk.unRegister(businessService, bpelClerk.getUDDINode().getApiNode());
- } catch (Exception e) {
- log.warn("Could not find BindingTemplate with key " + bindingKey +
" for unRegistration.");
- }
- } catch (Exception e) {
- log.error("Unable to unRegister EPR " + bindingName
- + " ." + e.getMessage(),e);
- } catch (Throwable t) {
- log.error("Unable to unRegister EPR " + bindingName
- + " ." + t.getMessage(),t);
- }
- } else {
- throw new ConfigurationException("Could not find UDDI Clerk named "+
BPEL_CLERK);
- }
- }
- } catch (ConfigurationException ce) {
- if (selfRegister) {
- log.error(ce.getMessage(),ce);
- } else {
- log.info(ce.getMessage());
- }
- }
- }
-
- private BusinessService createBusinessService(UDDIClerk clerk,
- EndpointMetaData metaData, WSDLReference wsdlRef)
- throws DispositionReportFaultMessage, RemoteException, ConfigurationException,
TransportException {
- Properties properties = clerk.getUDDINode().getProperties();
- //Constructing the serviceKey
- String serviceKey = TokenResolver.replaceTokens(DEFAULT_SERVICE_KEY_FORMAT +
metaData.getServiceName().getLocalPart(), properties);
- if (properties.containsKey(SERVICE_KEY_FORMAT)) {
- serviceKey = TokenResolver.replaceTokens((String)properties.get(SERVICE_KEY_FORMAT) +
metaData.getServiceName(), properties);
- }
- BusinessService service = null;
- try {
- //Checking if this serviceKey already exist
- service = clerk.findService(serviceKey, clerk.getUDDINode().getApiNode());
- log.debug("Service " + metaData.getServiceName() + " already present in
the UDDI Registry");
- } catch (Exception e) {
- //If it does not exist construct service information
- log.debug("Constructing Service UDDI Information for " +
metaData.getServiceName());
- service = new BusinessService();
- service.setBusinessKey(TokenResolver.replaceTokens("uddi:${keyDomain}:${businessKey}",
properties));
- service.setServiceKey(serviceKey);
- if (properties.containsKey(SERVICE_DESCRIPTION)) {
- Description description = new Description();
- String lang = "en";
- if (properties.containsKey(LANG)) lang = properties.getProperty(LANG);
- description.setLang(lang);
- description.setValue(properties.getProperty(SERVICE_DESCRIPTION));
- Name serviceName = new Name();
- serviceName.setLang(lang);
- serviceName.setValue(metaData.getServiceName().getLocalPart());
- service.getName().add(serviceName);
- service.getDescription().add(description);
- }
- //default categoryBag on the binding
- if (properties.containsKey(SERVICE_CATEGORY_BAG)) {
- String defaultCategoryBag = properties.getProperty(SERVICE_CATEGORY_BAG);
- log.info("Adding categoryBag: " + defaultCategoryBag);
- CategoryBag categoryBag = parseCategoryBag(defaultCategoryBag);
- service.setCategoryBag(categoryBag);
- }
- }
- //Construct bindingTemplate
- BindingTemplate binding = createBindingTemplate(clerk, metaData, wsdlRef);
- //Add the bindingTemplate on the service
- if (service.getBindingTemplates()==null) {
- BindingTemplates bindingTemplates = new BindingTemplates();
- service.setBindingTemplates(bindingTemplates);
- }
- service.getBindingTemplates().getBindingTemplate().add(binding);
- return service;
- }
-
- private BindingTemplate createBindingTemplate(UDDIClerk clerk,
- EndpointMetaData metaData, WSDLReference wsdlRef) {
-
- Properties properties = clerk.getUDDINode().getProperties();
- BindingTemplate bindingTemplate = new BindingTemplate();
- //Constructing the bindingKey
- String bindingKey = TokenResolver.replaceTokens(DEFAULT_BINDING_KEY_FORMAT +
metaData.getServiceName().getLocalPart() + "-"
- + metaData.getPortName(), properties);
- if (properties.containsKey(BINDING_KEY_FORMAT)) {
- bindingKey = TokenResolver.replaceTokens((String)properties.get(BINDING_KEY_FORMAT) +
metaData.getServiceName().getLocalPart() + "-"
- + metaData.getPortName(), properties);
- }
-
- bindingTemplate.setBindingKey(bindingKey);
-
- String lang = "en";
- if (properties.containsKey(LANG)) lang = properties.getProperty(LANG);
- if (properties.containsKey(BINDING_DESCRIPTION)) {
- Description bindingDescription = new Description();
- bindingDescription.setLang(lang);
- bindingDescription.setValue(properties.getProperty(BINDING_DESCRIPTION));
- bindingTemplate.getDescription().add(bindingDescription);
- }
-
- AccessPoint accessPoint = new AccessPoint();
- accessPoint.setUseType(AccessPointType.WSDL_DEPLOYMENT.toString());
- accessPoint.setValue(wsdlRef.getWsdlFileURL().toString());
- bindingTemplate.setAccessPoint(accessPoint);
-
- //default tModelKeys on the binding
- String defaultTModelKeys = properties.getProperty("tModelKeys");
- if (defaultTModelKeys!=null && !"".equals(defaultTModelKeys)) {
- String[] tModelKeys= defaultTModelKeys.split(",");
- for (String tModelKey : tModelKeys) {
- TModelInstanceInfo instanceInfo = new TModelInstanceInfo();
- instanceInfo.setTModelKey(tModelKey);
- if (bindingTemplate.getTModelInstanceDetails()==null) {
- bindingTemplate.setTModelInstanceDetails(new TModelInstanceDetails());
- }
- bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo().add(instanceInfo);
- }
- }
- //default categoryBag on the binding
- String defaultCategoryBag = properties.getProperty("bindingCategoryBag");
- if (defaultCategoryBag!=null && !"".equals(defaultCategoryBag)) {
- log.info("Adding categoryBag: " + defaultCategoryBag);
- CategoryBag categoryBag = parseCategoryBag(defaultCategoryBag);
- bindingTemplate.setCategoryBag(categoryBag);
- }
-
- return bindingTemplate;
- }
-
-
-
+ public void unRegisterEPR(QName service, String port);
}
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-03-01
16:45:34 UTC (rev 521)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2010-03-02
02:54:09 UTC (rev 522)
@@ -21,11 +21,8 @@
*/
package org.jboss.soa.bpel.runtime.ws;
-import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.juddi.v3.client.config.UDDIClerk;
-import org.apache.juddi.v3.client.config.UDDIClerkManager;
import org.apache.ode.bpel.iapi.EndpointReference;
import org.jboss.dependency.spi.ControllerContext;
import org.jboss.deployers.client.spi.DeployerClient;
@@ -38,13 +35,13 @@
import org.jboss.kernel.Kernel;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
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.bpel.runtime.integration.KernelLocator;
import org.jboss.soa.bpel.runtime.integration.ServerConfig;
import org.jboss.soa.bpel.runtime.integration.ServerConfigFactory;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
-import org.uddi.api_v3.BusinessService;
import javax.xml.namespace.QName;
import java.io.File;
@@ -74,14 +71,19 @@
private ServerConfig serverConfig;
private ExecutionEnvironment executionEnvironment;
- private UDDIRegistration uddiRegistration;
+ private UDDIRegistration uddiRegistration = null;
public EndpointManager(ExecutionEnvironment executionEnvironment)
{
this.executionEnvironment = executionEnvironment;
this.serverConfig = ServerConfigFactory.getServerConfig();
if (isUDDIRegistration()) {
- uddiRegistration = new UDDIRegistration();
+ try {
+ uddiRegistration =
UDDIClientFactory.newInstance(executionEnvironment.getOdeConfig().getProperties());
+ } catch (Exception e) {
+ log.error(e.getMessage());
+ log.error("Running without UDDI integration.");
+ }
}
}
@@ -146,7 +148,7 @@
createEndpointKey(metaData.getServiceName(), metaData.getPortName()),
ref
);
- if (isUDDIRegistration()) {
+ if (uddiRegistration!=null) {
uddiRegistration.registerEPR(metaData, wsdlRef);
}
@@ -228,7 +230,7 @@
{
log.warn(ref.getArchiveLocation() + " cannot be removed (doesn't
exist).");
}
- if (isUDDIRegistration()) {
+ if (uddiRegistration!=null) {
uddiRegistration.unRegisterEPR(service, port);
}
}
Modified: trunk/runtime/engine-assembly/pom.xml
===================================================================
--- trunk/runtime/engine-assembly/pom.xml 2010-03-01 16:45:34 UTC (rev 521)
+++ trunk/runtime/engine-assembly/pom.xml 2010-03-02 02:54:09 UTC (rev 522)
@@ -21,6 +21,16 @@
<version>${riftsaw.engine.version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.soa.bpel.runtime</groupId>
+ <artifactId>riftsaw-uddi</artifactId>
+ <version>${riftsaw.engine.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.soa.bpel.runtime</groupId>
+ <artifactId>riftsaw-uddi300</artifactId>
+ <version>${riftsaw.engine.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>riftsaw-bpel-compiler</artifactId>
</dependency>
Modified: trunk/runtime/engine-assembly/src/main/resources/bpel.properties
===================================================================
--- trunk/runtime/engine-assembly/src/main/resources/bpel.properties 2010-03-01 16:45:34
UTC (rev 521)
+++ trunk/runtime/engine-assembly/src/main/resources/bpel.properties 2010-03-02 02:54:09
UTC (rev 522)
@@ -91,6 +91,12 @@
# this uses the juddi-client-3.0.0 and the uddi client config can be set in the uddi.xml
# file
bpel.uddi.registration=false
+# implementation of the client integration class
+bpel.uddi.client.impl=org.jboss.soa.bpel.uddi.UDDIRegistration
+# name of the clerk manager
+bpel.uddi.clerk.manager=esb-registry
+# name of the clerk
+bpel.uddi.clerk=BPEL_clerk
hibernate.dialect=org.hibernate.dialect.H2Dialect
hibernate.hbm2ddl.auto=update
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2010-03-01 16:45:34 UTC (rev 521)
+++ trunk/runtime/pom.xml 2010-03-02 02:54:09 UTC (rev 522)
@@ -17,9 +17,12 @@
<modules>
<module>deployer</module>
<module>engine</module>
+ <module>uddi</module>
+ <module>uddi300</module>
<module>engine-assembly</module>
<module>jbossesb-bpel</module>
<module>jbossesb-bpel-assembly</module>
+
</modules>
</project>