You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2009/01/16 11:19:30 UTC
svn commit: r734961 - in /activemq/camel/branches/camel-1.x: ./
components/camel-cxf/src/main/java/org/apache/camel/component/cxf/
components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/
components/camel-cxf/src/test/java/org/apache/cam...
Author: ningjiang
Date: Fri Jan 16 02:19:27 2009
New Revision: 734961
URL: http://svn.apache.org/viewvc?rev=734961&view=rev
Log:
Merged revisions 734932 via svnmerge from
https://svn.apache.org/repos/asf/activemq/camel/trunk
........
r734932 | ningjiang | 2009-01-16 15:20:17 +0800 (Fri, 16 Jan 2009) | 1 line
CAMEL-1254 support to look for the serviceClass instance from registry
........
Modified:
activemq/camel/branches/camel-1.x/ (props changed)
activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapConsumer.java
activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapProducer.java
activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java
activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsTest.java
activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsWithSpringTest.java
activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfEndpointBeans.xml
activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/util/CxfEndpointBeans.xml
Propchange: activemq/camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 16 02:19:27 2009
@@ -1 +1 @@
-/activemq/camel/trunk:732943,733749,734053,734057-734058,734064,734130,734309,734340-734342,734348,734392,734422,734727,734903
+/activemq/camel/trunk:732943,733749,734053,734057-734058,734064,734130,734309,734340-734342,734348,734392,734422,734727,734903,734932
Propchange: activemq/camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java?rev=734961&r1=734960&r2=734961&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java (original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java Fri Jan 16 02:19:27 2009
@@ -55,28 +55,23 @@
// now we just use the default bus here
bus = BusFactory.getThreadDefaultBus();
}
- ServerFactoryBean svrBean = null;
-
+
+ Class serviceClass = CxfEndpointUtils.getServiceClass(endpoint);
+ ServerFactoryBean svrBean = CxfEndpointUtils.getServerFactoryBean(serviceClass);
+ isWebServiceProvider = CxfEndpointUtils.hasAnnotation(serviceClass,
+ WebServiceProvider.class);
+
if (endpoint.isSpringContextEndpoint()) {
- CxfEndpointBean endpointBean = endpoint.getCxfEndpointBean();
- CxfEndpointUtils.checkServiceClass(endpointBean.getServiceClass());
- svrBean = CxfEndpointUtils.getServerFactoryBean(endpointBean.getServiceClass());
- isWebServiceProvider = CxfEndpointUtils.hasAnnotation(endpointBean.getServiceClass(),
- WebServiceProvider.class);
endpoint.configure(svrBean);
-
} else { // setup the serverFactoryBean with the URI parameters
- CxfEndpointUtils.checkServiceClassName(endpoint.getServiceClass());
- Class serviceClass = ClassLoaderUtils.loadClass(endpoint.getServiceClass(), this.getClass());
- svrBean = CxfEndpointUtils.getServerFactoryBean(serviceClass);
- isWebServiceProvider = CxfEndpointUtils.hasAnnotation(serviceClass, WebServiceProvider.class);
- svrBean.setAddress(endpoint.getAddress());
- svrBean.setServiceClass(serviceClass);
+ svrBean.setAddress(endpoint.getAddress());
if (endpoint.getWsdlURL() != null) {
svrBean.setWsdlURL(endpoint.getWsdlURL());
}
}
+ svrBean.setServiceClass(serviceClass);
+
if (CxfEndpointUtils.getServiceName(endpoint) != null) {
svrBean.setServiceName(CxfEndpointUtils.getServiceName(endpoint));
}
Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java?rev=734961&r1=734960&r2=734961&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java (original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java Fri Jan 16 02:19:27 2009
@@ -43,6 +43,7 @@
private String serviceName;
private String dataFormat;
private String beanId;
+ private String serviceClassInstance;
private boolean isWrapped;
private boolean isSpringContextEndpoint;
private boolean inOut = true;
@@ -124,12 +125,19 @@
public String getServiceClass() {
return serviceClass;
-
}
- public void setServiceClass(String className) {
+ public void setServiceClass(String className) {
serviceClass = className;
}
+
+ public String getServiceClassInstance() {
+ return serviceClassInstance;
+ }
+
+ public void setServiceClassInstance(String classInstance) {
+ serviceClassInstance = classInstance;
+ }
public void setPortName(String port) {
portName = port;
Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java?rev=734961&r1=734960&r2=734961&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java (original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java Fri Jan 16 02:19:27 2009
@@ -62,7 +62,7 @@
private Client client;
private DataFormat dataFormat;
- public CxfProducer(CxfEndpoint endpoint) throws CamelException {
+ public CxfProducer(CxfEndpoint endpoint) throws Exception {
super(endpoint);
this.endpoint = endpoint;
dataFormat = CxfEndpointUtils.getDataFormat(endpoint);
@@ -74,21 +74,14 @@
}
}
- private Client createClientForStreamMessage() throws CamelException {
+ private Client createClientForStreamMessage() throws Exception {
CxfClientFactoryBean cfb = new CxfClientFactoryBean();
Class serviceClass = null;
- if (endpoint.isSpringContextEndpoint()) {
- CxfEndpointBean cxfEndpointBean = endpoint.getCxfEndpointBean();
- serviceClass = cxfEndpointBean.getServiceClass();
- CxfEndpointUtils.checkServiceClass(serviceClass);
- } else {
- CxfEndpointUtils.checkServiceClassName(endpoint.getServiceClass());
- try {
- serviceClass = ClassLoaderUtils.loadClass(endpoint.getServiceClass(), this.getClass());
- } catch (ClassNotFoundException e) {
- throw new CamelException(e);
- }
- }
+ try {
+ serviceClass = CxfEndpointUtils.getServiceClass(endpoint);
+ } catch (ClassNotFoundException e) {
+ throw new CamelException(e);
+ }
boolean jsr181Enabled = CxfEndpointUtils.hasWebServiceAnnotation(serviceClass);
cfb.setJSR181Enabled(jsr181Enabled);
@@ -98,7 +91,7 @@
}
// If cfb is null, we will try to find the right cfb to use.
- private Client createClientFromClientFactoryBean(ClientProxyFactoryBean cfb) throws CamelException {
+ private Client createClientFromClientFactoryBean(ClientProxyFactoryBean cfb) throws Exception {
Bus bus = null;
if (endpoint.getApplicationContext() != null) {
bus = endpoint.getCxfEndpointBean().getBus();
@@ -109,38 +102,29 @@
// now we just use the default bus here
bus = BusFactory.getThreadDefaultBus();
}
- if (endpoint.isSpringContextEndpoint()) {
- CxfEndpointBean cxfEndpointBean = endpoint.getCxfEndpointBean();
- CxfEndpointUtils.checkServiceClass(cxfEndpointBean.getServiceClass());
- if (cfb == null) {
- cfb = CxfEndpointUtils.getClientFactoryBean(cxfEndpointBean.getServiceClass());
- }
+
+ Class serviceClass = CxfEndpointUtils.getServiceClass(endpoint);
+ // We need to choose the right front end to create the clientFactoryBean
+ if (cfb == null) {
+ cfb = CxfEndpointUtils.getClientFactoryBean(serviceClass);
+ }
+
+ if (endpoint.isSpringContextEndpoint()) {
endpoint.configure(cfb);
-
} else { // set up the clientFactoryBean by using URI information
- CxfEndpointUtils.checkServiceClassName(endpoint.getServiceClass());
- try {
- // We need to choose the right front end to create the
- // clientFactoryBean
- Class serviceClass = ClassLoaderUtils.loadClass(endpoint.getServiceClass(), this.getClass());
- if (cfb == null) {
- cfb = CxfEndpointUtils.getClientFactoryBean(serviceClass);
- }
- cfb.setAddress(endpoint.getAddress());
- if (null != endpoint.getServiceClass()) {
- cfb.setServiceClass(ObjectHelper.loadClass(endpoint.getServiceClass()));
- }
- if (null != endpoint.getWsdlURL()) {
- cfb.setWsdlURL(endpoint.getWsdlURL());
- }
- } catch (ClassNotFoundException e) {
- throw new CamelException(e);
+ cfb.setAddress(endpoint.getAddress());
+ if (null != endpoint.getServiceClass()) {
+ cfb.setServiceClass(ObjectHelper.loadClass(endpoint.getServiceClass()));
}
-
+ if (null != endpoint.getWsdlURL()) {
+ cfb.setWsdlURL(endpoint.getWsdlURL());
+ }
+
if (endpoint.getWsdlURL() != null) {
cfb.setWsdlURL(endpoint.getWsdlURL());
}
}
+ cfb.setServiceClass(serviceClass);
if (CxfEndpointUtils.getServiceName(endpoint) != null) {
cfb.setServiceName(CxfEndpointUtils.getServiceName(endpoint));
Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapConsumer.java?rev=734961&r1=734960&r2=734961&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapConsumer.java (original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapConsumer.java Fri Jan 16 02:19:27 2009
@@ -26,9 +26,11 @@
import org.apache.camel.component.cxf.util.CxfEndpointUtils;
import org.apache.camel.component.cxf.util.NullConduit;
import org.apache.camel.component.cxf.util.NullDestinationFactory;
+import org.apache.camel.util.ObjectHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.cxf.Bus;
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.frontend.ServerFactoryBean;
import org.apache.cxf.interceptor.InterceptorChain;
@@ -64,7 +66,10 @@
}
});
this.consumer = endpoint.getInnerEndpoint().createConsumer(soapProcessor);
- Class sei = CxfEndpointUtils.getSEIClass(endpoint.getServiceClass());
+ Class sei = null;
+ if (ObjectHelper.isNotEmpty(endpoint.getServiceClass())) {
+ sei = ClassLoaderUtils.loadClass(endpoint.getServiceClass(), this.getClass());
+ }
ServerFactoryBean sfb = CxfEndpointUtils.getServerFactoryBean(sei);
sfb.setWsdlURL(endpoint.getWsdl().getURL().toString());
if (endpoint.getServiceName() != null) {
Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapProducer.java?rev=734961&r1=734960&r2=734961&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapProducer.java (original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSoapProducer.java Fri Jan 16 02:19:27 2009
@@ -32,9 +32,11 @@
import org.apache.camel.component.cxf.util.NullConduit;
import org.apache.camel.component.cxf.util.NullConduitSelector;
import org.apache.camel.util.AsyncProcessorHelper;
+import org.apache.camel.util.ObjectHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.cxf.Bus;
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
import org.apache.cxf.endpoint.ClientImpl;
import org.apache.cxf.frontend.ClientFactoryBean;
import org.apache.cxf.frontend.ClientProxy;
@@ -76,7 +78,10 @@
});
//create the endpoint and setup the interceptors
- Class sei = CxfEndpointUtils.getSEIClass(endpoint.getServiceClass());
+ Class sei = null;
+ if (ObjectHelper.isNotEmpty(endpoint.getServiceClass())) {
+ sei = ClassLoaderUtils.loadClass(endpoint.getServiceClass(), this.getClass());
+ }
ClientProxyFactoryBean cfb = CxfEndpointUtils.getClientFactoryBean(sei);
if (sei == null) {
cfb.setServiceClass(Dummy.class);
Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java?rev=734961&r1=734960&r2=734961&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java (original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java Fri Jan 16 02:19:27 2009
@@ -25,6 +25,7 @@
import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceProvider;
+import org.apache.camel.CamelContext;
import org.apache.camel.CamelException;
import org.apache.camel.component.cxf.CxfConstants;
import org.apache.camel.component.cxf.CxfEndpoint;
@@ -35,6 +36,7 @@
import org.apache.cxf.common.classloader.ClassLoaderUtils;
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.ClassHelper;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
import org.apache.cxf.frontend.ServerFactoryBean;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
@@ -72,6 +74,31 @@
}
return qName;
}
+
+ public static Class getServiceClass(CxfEndpoint cxfEndpoint) throws ClassNotFoundException {
+ Class<?> answer = null;
+ if (cxfEndpoint.isSpringContextEndpoint()) {
+ answer = cxfEndpoint.getCxfEndpointBean().getServiceClass();
+ if (answer != null) {
+ return answer;
+ }
+ }
+ if (cxfEndpoint.getServiceClassInstance() != null) {
+ Object bean = cxfEndpoint.getCamelContext().getRegistry().lookup(cxfEndpoint.getServiceClassInstance());
+ if (bean != null) {
+ answer = ClassHelper.getRealClass(bean);
+ } else {
+ throw new ClassNotFoundException("Can't find serviceClass instace with name" + cxfEndpoint.getServiceClassInstance() + " from CamelContext registry.");
+ }
+ } else {
+ if (ObjectHelper.isNotEmpty(cxfEndpoint.getServiceClass())) {
+ answer = ClassLoaderUtils.loadClass(cxfEndpoint.getServiceClass(), CxfEndpointUtils.class);
+ } else {
+ throw new ClassNotFoundException("Can't find serviceClass from uri, please check the cxf endpoint configuration");
+ }
+ }
+ return answer;
+ }
public static QName getPortName(final CxfEndpoint endpoint) {
if (endpoint.getPortName() != null) {
@@ -116,15 +143,7 @@
}
return endpointInfo;
- }
-
- public static Class getSEIClass(String className) throws ClassNotFoundException {
- if (className == null) {
- return null;
- } else {
- return ClassLoaderUtils.loadClass(className, CxfEndpointUtils.class);
- }
- }
+ }
public static boolean hasWebServiceAnnotation(Class<?> cls) {
return hasAnnotation(cls, WebService.class) || hasAnnotation(cls, WebServiceProvider.class);
@@ -255,19 +274,8 @@
} else { // return the default value false
return false;
}
- }
-
- public static void checkServiceClass(Class clazz) throws CamelException {
- if (clazz == null) {
- throw new CamelException("serviceClass is required for CXF endpoint configuration");
- }
- }
+ }
- public static void checkServiceClassName(String className) throws CamelException {
- if (ObjectHelper.isNullOrBlank(className)) {
- throw new CamelException("serviceClass is required for CXF endpoint configuration");
- }
- }
public static String getCxfEndpointPropertyValue(CxfEndpoint endpoint, String property) {
String result = null;
Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsTest.java?rev=734961&r1=734960&r2=734961&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsTest.java (original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsTest.java Fri Jan 16 02:19:27 2009
@@ -26,6 +26,7 @@
import org.apache.camel.component.cxf.CxfComponent;
import org.apache.camel.component.cxf.CxfEndpoint;
import org.apache.camel.component.cxf.DataFormat;
+import org.apache.camel.component.cxf.HelloServiceImpl;
import org.apache.camel.impl.DefaultCamelContext;
public class CxfEndpointUtilsTest extends TestCase {
@@ -60,7 +61,7 @@
protected CxfEndpoint createEndpoint(String uri) throws Exception {
CamelContext context = getCamelContext();
return (CxfEndpoint)new CxfComponent(context).createEndpoint(uri);
- }
+ }
public void testGetProperties() throws Exception {
CxfEndpoint endpoint = createEndpoint(getEndpointURI());
@@ -77,11 +78,11 @@
public void testCheckServiceClassWithTheEndpoint() throws Exception {
CxfEndpoint endpoint = createEndpoint(getNoServiceClassURI());
try {
- CxfEndpointUtils.checkServiceClassName(endpoint.getServiceClass());
+ CxfEndpointUtils.getServiceClass(endpoint);
fail("Should get a CamelException here");
- } catch (CamelException exception) {
- assertNotNull("Should get a CamelException here", exception);
- assertEquals("serviceClass is required for CXF endpoint configuration", exception.getMessage());
+ } catch (ClassNotFoundException exception) {
+ assertNotNull("Should get a ClassNotFoundExceptionException here", exception);
+ assertEquals("Can't find serviceClass from uri, please check the cxf endpoint configuration", exception.getMessage());
}
}
@@ -89,9 +90,9 @@
CxfEndpoint endpoint = createEndpoint(getNoServiceClassURI());
try {
endpoint.createProducer();
- } catch (CamelException exception) {
- assertNotNull("Should get a CamelException here", exception);
- assertEquals("serviceClass is required for CXF endpoint configuration", exception.getMessage());
+ } catch (ClassNotFoundException exception) {
+ assertNotNull("Should get a ClassNotFoundException here", exception);
+ assertEquals("Can't find serviceClass from uri, please check the cxf endpoint configuration", exception.getMessage());
}
}
@@ -99,9 +100,9 @@
CxfEndpoint endpoint = createEndpoint(getNoServiceClassURI());
try {
endpoint.createConsumer(new NullProcessor());
- } catch (CamelException exception) {
- assertNotNull("Should get a CamelException here", exception);
- assertEquals("serviceClass is required for CXF endpoint configuration", exception.getMessage());
+ } catch (ClassNotFoundException exception) {
+ assertNotNull("Should get a ClassNotFoundException here", exception);
+ assertEquals("Can't find serviceClass from uri, please check the cxf endpoint configuration", exception.getMessage());
}
}
Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsWithSpringTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsWithSpringTest.java?rev=734961&r1=734960&r2=734961&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsWithSpringTest.java (original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/util/CxfEndpointUtilsWithSpringTest.java Fri Jan 16 02:19:27 2009
@@ -21,6 +21,7 @@
import org.apache.camel.CamelContext;
import org.apache.camel.component.cxf.CxfEndpoint;
import org.apache.camel.component.cxf.DataFormat;
+import org.apache.camel.component.cxf.HelloServiceImpl;
import org.apache.camel.spring.SpringCamelContext;
import org.springframework.context.support.AbstractXmlApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -60,6 +61,13 @@
protected String getNoServiceClassURI() {
return "cxf:bean:noServiceClassEndpoint";
}
+
+ public void testGetServiceClass() throws Exception {
+ CxfEndpoint endpoint = createEndpoint("cxf:bean:helloServiceEndpoint?serviceClassInstance=helloServiceImpl");
+ Class clazz = CxfEndpointUtils.getServiceClass(endpoint);
+ assertNotNull("The service calss should not be null ", clazz);
+ assertTrue("The service class should be the instance of HelloServiceImpl", clazz.equals(HelloServiceImpl.class));
+ }
public void testGetDataFormat() throws Exception {
CxfEndpoint endpoint = createEndpoint(getEndpointURI() + "?dataFormat=MESSAGE");
Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfEndpointBeans.xml
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfEndpointBeans.xml?rev=734961&r1=734960&r2=734961&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfEndpointBeans.xml (original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfEndpointBeans.xml Fri Jan 16 02:19:27 2009
@@ -31,5 +31,4 @@
<cxf:cxfEndpoint id="serviceEndpoint" address="http://localhost:9002/helloworld"
serviceClass="org.apache.camel.component.cxf.HelloService"/>
-
</beans>
Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/util/CxfEndpointBeans.xml
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/util/CxfEndpointBeans.xml?rev=734961&r1=734960&r2=734961&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/util/CxfEndpointBeans.xml (original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/util/CxfEndpointBeans.xml Fri Jan 16 02:19:27 2009
@@ -51,6 +51,9 @@
<entry key="endpointNamespace" value="http://www.example.com/test"/>
</cxf:properties>
</cxf:cxfEndpoint>
-
-
+
+ <cxf:cxfEndpoint id="helloServiceEndpoint" address="http://localhost:9004/helloworld"
+ />
+
+ <bean id="helloServiceImpl" class="org.apache.camel.component.cxf.HelloServiceImpl" />
</beans>