Author: alessio.soldano(a)jboss.com
Date: 2010-05-13 04:22:15 -0400 (Thu, 13 May 2010)
New Revision: 12221
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java
Log:
[JBWS-3025] Cleaning default Bus in ServiceObjectFactory and improving port match in
ServiceRefStubPropertyConfigurer
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java 2010-05-13
08:21:26 UTC (rev 12220)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java 2010-05-13
08:22:15 UTC (rev 12221)
@@ -97,7 +97,7 @@
Bus bus;
//Reset bus before constructing Service
- BusFactory.setThreadDefaultBus(null);
+ BusFactory.setDefaultBus(null);
URL cxfConfig = getCXFConfiguration(serviceRef.getVfsRoot());
if (cxfConfig != null)
{
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java 2010-05-13
08:21:26 UTC (rev 12220)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java 2010-05-13
08:22:15 UTC (rev 12221)
@@ -33,6 +33,7 @@
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
+import org.jboss.logging.Logger;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
@@ -56,10 +57,6 @@
public void configureBean(Object beanInstance)
{
- if (beanInstance instanceof JaxWsProxyFactoryBean)
- {
- configureJaxWsProxyFactoryBean((JaxWsProxyFactoryBean)beanInstance);
- }
if (delegate != null)
{
delegate.configureBean(beanInstance);
@@ -68,9 +65,19 @@
public void configureBean(String name, Object beanInstance)
{
- if (beanInstance instanceof JaxWsProxyFactoryBean)
+ if (name != null && beanInstance instanceof JaxWsProxyFactoryBean)
{
- configureJaxWsProxyFactoryBean((JaxWsProxyFactoryBean)beanInstance);
+ QName portQName = null;
+ try
+ {
+ String portName = name.substring(0,
name.indexOf(".jaxws-client.proxyFactory"));
+ portQName = QName.valueOf(portName);
+ }
+ catch (Exception e)
+ {
+ Logger.getLogger(this.getClass()).warn("Unable to retrieve port QName
from '" + name + "', trying matching port using endpoint interface name
only.");
+ }
+ configureJaxWsProxyFactoryBean(portQName, (JaxWsProxyFactoryBean)beanInstance);
}
if (delegate != null)
{
@@ -78,10 +85,10 @@
}
}
- private synchronized void configureJaxWsProxyFactoryBean(JaxWsProxyFactoryBean
proxyFactory)
+ private synchronized void configureJaxWsProxyFactoryBean(QName portQName,
JaxWsProxyFactoryBean proxyFactory)
{
Class<?> clazz = proxyFactory.getServiceClass();
- UnifiedPortComponentRefMetaData upcmd = serviceRefMD.getPortComponentRef(clazz !=
null ? clazz.getName() : null, getServiceName(proxyFactory));
+ UnifiedPortComponentRefMetaData upcmd = serviceRefMD.getPortComponentRef(clazz !=
null ? clazz.getName() : null, portQName);
if (upcmd != null)
{
setProperties(proxyFactory, upcmd);
@@ -89,18 +96,6 @@
}
}
- private static QName getServiceName(JaxWsProxyFactoryBean proxyFactory)
- {
- try
- {
- return proxyFactory.getServiceName();
- }
- catch (Exception e) //ignore
- {
- return null;
- }
- }
-
private void setMTOM(JaxWsServiceFactoryBean serviceFactoryBean,
UnifiedPortComponentRefMetaData upcmd)
{
if (upcmd.getEnableMTOM())