You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2007/04/24 23:57:50 UTC
svn commit: r532104 - in
/incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se:
./ src/ src/main/ src/main/java/ src/main/java/org/
src/main/java/org/apache/ src/main/java/org/apache/servicemix/
src/main/java/org/apache/servicemix/cx...
Author: gnodet
Date: Tue Apr 24 14:57:48 2007
New Revision: 532104
URL: http://svn.apache.org/viewvc?view=rev&rev=532104
Log:
CXF based service engine
Added:
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/ (with props)
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/pom.xml (with props)
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeComponent.java (with props)
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java (with props)
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/support/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/support/ReflectionUtils.java (with props)
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/resources/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeSpringTest.java (with props)
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j-tests.properties (with props)
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j.properties (with props)
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/
incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/spring.xml (with props)
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 24 14:57:48 2007
@@ -0,0 +1,2 @@
+.classpath
+.project
Added: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/pom.xml?view=auto&rev=532104
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/pom.xml (added)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/pom.xml Tue Apr 24 14:57:48 2007
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>serviceengines</artifactId>
+ <version>3.2-incubating-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-cxf-se</artifactId>
+ <packaging>jbi-component</packaging>
+
+ <name>ServiceMix :: CXF Service Engine</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-shared</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxws</artifactId>
+ <version>2.0-incubator-RC-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-support</artifactId>
+ <version>${spring-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ <version>${spring-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring-version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${spring-version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring-version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-jbi</artifactId>
+ <version>2.0-incubator-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-bindings-jbi</artifactId>
+ <version>2.0-incubator-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-testutils</artifactId>
+ <version>2.0-incubator-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.servicemix.tooling</groupId>
+ <artifactId>jbi-maven-plugin</artifactId>
+ <version>${servicemix-version}</version>
+ <extensions>true</extensions>
+ <configuration>
+ <type>service-engine</type>
+ <component>org.apache.servicemix.cxfse.CxfSeComponent</component>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>maven-xbean-plugin</artifactId>
+ <version>${xbean-version}</version>
+ <executions>
+ <execution>
+ <configuration>
+ <namespace>
+ http://servicemix.apache.org/cxfse/1.0
+ </namespace>
+ </configuration>
+ <goals>
+ <goal>mapping</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeComponent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeComponent.java?view=auto&rev=532104
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeComponent.java (added)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeComponent.java Tue Apr 24 14:57:48 2007
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.cxfse;
+
+import java.util.List;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.servicemix.common.DefaultComponent;
+
+/**
+ *
+ * @author gnodet
+ * @org.apache.xbean.XBean element="component"
+ */
+public class CxfSeComponent extends DefaultComponent {
+
+ private CxfSeEndpoint[] endpoints;
+ private Bus bus;
+
+ /**
+ * @return the endpoints
+ */
+ public CxfSeEndpoint[] getEndpoints() {
+ return endpoints;
+ }
+
+ /**
+ * @param endpoints the endpoints to set
+ */
+ public void setEndpoints(CxfSeEndpoint[] endpoints) {
+ this.endpoints = endpoints;
+ }
+
+ @Override
+ protected List getConfiguredEndpoints() {
+ return asList(endpoints);
+ }
+
+ @Override
+ protected Class[] getEndpointClasses() {
+ return new Class[] {CxfSeEndpoint.class };
+ }
+
+ @Override
+ protected void doInit() throws Exception {
+ bus = BusFactory.getDefaultBus();
+ super.doInit();
+ }
+
+ public Bus getBus() {
+ return bus;
+ }
+
+}
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeComponent.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeComponent.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java?view=auto&rev=532104
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java (added)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java Tue Apr 24 14:57:48 2007
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.cxfse;
+
+import java.lang.reflect.Field;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.jbi.management.DeploymentException;
+import javax.jbi.messaging.DeliveryChannel;
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.MessageExchange;
+import javax.wsdl.WSDLException;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceRef;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.jaxws.EndpointImpl;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.jaxws.ServiceImpl;
+import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
+import org.apache.cxf.transport.jbi.JBIDestination;
+import org.apache.cxf.transport.jbi.JBITransportFactory;
+import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
+import org.apache.servicemix.common.endpoints.ProviderEndpoint;
+import org.apache.servicemix.cxfse.support.ReflectionUtils;
+import org.apache.servicemix.id.IdGenerator;
+import org.springframework.util.ReflectionUtils.FieldCallback;
+
+/**
+ *
+ * @author gnodet
+ * @org.apache.xbean.XBean element="endpoint"
+ */
+public class CxfSeEndpoint extends ProviderEndpoint {
+
+ private static final IdGenerator ID_GENERATOR = new IdGenerator();
+
+ private Object pojo;
+ private EndpointImpl endpoint;
+ private String address;
+
+ /**
+ * @return the pojo
+ */
+ public Object getPojo() {
+ return pojo;
+ }
+
+ /**
+ * @param pojo the pojo to set
+ */
+ public void setPojo(Object pojo) {
+ this.pojo = pojo;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.servicemix.common.Endpoint#validate()
+ */
+ @Override
+ public void validate() throws DeploymentException {
+ if (getPojo() == null) {
+ throw new DeploymentException("pojo must be set");
+ }
+ JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
+ serviceFactory.setPopulateFromClass(true);
+ endpoint = new EndpointImpl(getBus(), getPojo(), new JaxWsServerFactoryBean(serviceFactory));
+ endpoint.setBindingUri(org.apache.cxf.binding.jbi.JBIConstants.NS_JBI_BINDING);
+ address = "jbi://" + ID_GENERATOR.generateSanitizedId();
+ endpoint.publish(address);
+ setService(endpoint.getServer().getEndpoint().getService().getName());
+ setEndpoint(endpoint.getServer().getEndpoint().getEndpointInfo().getName().getLocalPart());
+ try {
+ definition = new ServiceWSDLBuilder(endpoint.getServer().getEndpoint().getService()
+ .getServiceInfos().iterator().next()).build();
+ } catch (WSDLException e) {
+ throw new DeploymentException(e);
+ }
+ super.validate();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.servicemix.common.endpoints.ProviderEndpoint#process(javax.jbi.messaging.MessageExchange)
+ */
+ @Override
+ public void process(MessageExchange exchange) throws Exception {
+ DeliveryChannel oldDc = JBITransportFactory.getDeliveryChannel();
+ try {
+ JBITransportFactory.setDeliveryChannel(getContext().getDeliveryChannel());
+ if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
+ ((JBIDestination) endpoint.getServer().getDestination()).dispatch(exchange);
+ }
+ } finally {
+ JBITransportFactory.setDeliveryChannel(oldDc);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.servicemix.common.endpoints.ProviderEndpoint#start()
+ */
+ @Override
+ public void start() throws Exception {
+ super.start();
+ ReflectionUtils.doWithFields(getPojo().getClass(), new FieldCallback() {
+ public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
+ if (field.getAnnotation(WebServiceRef.class) != null) {
+ ServiceImpl s = new ServiceImpl(getBus(), null, null, field.getType());
+ s.addPort(new QName("port"), JBITransportFactory.TRANSPORT_ID,
+ "jbi://" + ID_GENERATOR.generateSanitizedId());
+ Object o = s.getPort(new QName("port"), field.getType());
+ field.setAccessible(true);
+ field.set(getPojo(), o);
+ }
+ }
+ });
+ ReflectionUtils.callLifecycleMethod(getPojo(), PostConstruct.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.servicemix.common.endpoints.ProviderEndpoint#stop()
+ */
+ @Override
+ public void stop() throws Exception {
+ ReflectionUtils.callLifecycleMethod(getPojo(), PreDestroy.class);
+ super.stop();
+ }
+
+ protected Bus getBus() {
+ return ((CxfSeComponent) getServiceUnit().getComponent()).getBus();
+ }
+
+}
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/support/ReflectionUtils.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/support/ReflectionUtils.java?view=auto&rev=532104
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/support/ReflectionUtils.java (added)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/support/ReflectionUtils.java Tue Apr 24 14:57:48 2007
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.cxfse.support;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+public class ReflectionUtils extends org.springframework.util.ReflectionUtils {
+
+ public static <T extends Annotation> void callLifecycleMethod(final Object bean, final Class<T> annotation) {
+ ReflectionUtils.doWithMethods(bean.getClass(), new ReflectionUtils.MethodCallback() {
+ public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
+ if (method.getAnnotation(annotation) != null) {
+ try {
+ method.invoke(bean, (Object[]) null);
+ } catch (IllegalArgumentException ex) {
+ throw new IllegalStateException(
+ "Failure to invoke " + method + " on " + bean.getClass() + ": args=[]", ex);
+ } catch (IllegalAccessException ex) {
+ throw new UnsupportedOperationException(ex.toString());
+ } catch (InvocationTargetException ex) {
+ throw new UnsupportedOperationException(
+ "PostConstruct method on bean threw exception", ex.getTargetException());
+ }
+ }
+ }
+ });
+ }
+
+ public static void setField(Field f, Object instance, Object value) {
+ try {
+ boolean oldAccessible = f.isAccessible();
+ boolean shouldSetAccessible = !Modifier.isPublic(f.getModifiers()) && !oldAccessible;
+ if (shouldSetAccessible) {
+ f.setAccessible(true);
+ }
+ f.set(instance, value);
+ if (shouldSetAccessible) {
+ f.setAccessible(oldAccessible);
+ }
+ } catch (IllegalArgumentException ex) {
+ throw new UnsupportedOperationException(
+ "Cannot inject value of class '" + value.getClass() + "' into " + f);
+ } catch (IllegalAccessException ex) {
+ ReflectionUtils.handleReflectionException(ex);
+ }
+ }
+
+}
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/support/ReflectionUtils.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/support/ReflectionUtils.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/support/ReflectionUtils.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeSpringTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeSpringTest.java?view=auto&rev=532104
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeSpringTest.java (added)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeSpringTest.java Tue Apr 24 14:57:48 2007
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.cxfse;
+
+import javax.jbi.messaging.InOut;
+import javax.xml.namespace.QName;
+
+import org.apache.servicemix.client.DefaultServiceMixClient;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.tck.SpringTestSupport;
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+
+public class CxfSeSpringTest extends SpringTestSupport {
+
+ public void testCalculator() throws Exception {
+ DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
+ InOut io = client.createInOutExchange();
+ io.setService(new QName("http://apache.org/cxf/calculator", "CalculatorService"));
+ io.setOperation(new QName("http://apache.org/cxf/calculator", "add"));
+ io.getInMessage().setContent(new StringSource(
+ "<message xmlns='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
+ + " <part>"
+ + " <add xmlns='http://apache.org/cxf/calculator/types'>"
+ + " <arg0>1</arg0>"
+ + " <arg1>2</arg1>"
+ + " </add>"
+ + " </part>"
+ + "</message>"));
+ client.sendSync(io);
+ System.err.println(new SourceTransformer().contentToString(io.getOutMessage()));
+ }
+
+ public void testCalculatorWithFault() throws Exception {
+ DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
+ InOut io = client.createInOutExchange();
+ io.setService(new QName("http://apache.org/cxf/calculator", "CalculatorService"));
+ io.setOperation(new QName("http://apache.org/cxf/calculator", "add"));
+ io.getInMessage().setContent(new StringSource(
+ "<message xmlns='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
+ + " <part>"
+ + " <add xmlns='http://apache.org/cxf/calculator/types'>"
+ + " <arg0>-1</arg0>"
+ + " <arg1>2</arg1>"
+ + " </add>"
+ + " </part>"
+ + "</message>"));
+ client.sendSync(io);
+ System.err.println(new SourceTransformer().contentToString(io.getFault()));
+ }
+
+ @Override
+ protected AbstractXmlApplicationContext createBeanFactory() {
+ return new ClassPathXmlApplicationContext("org/apache/servicemix/cxfse/spring.xml");
+ }
+
+}
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeSpringTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeSpringTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeSpringTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j-tests.properties
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j-tests.properties?view=auto&rev=532104
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j-tests.properties (added)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j-tests.properties Tue Apr 24 14:57:48 2007
@@ -0,0 +1,42 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+
+#
+# The logging properties used during tests..
+#
+log4j.rootLogger=DEBUG, out
+
+log4j.logger.org.springframework=INFO
+log4j.logger.org.apache.activemq=INFO
+log4j.logger.org.apache.activemq.spring=WARN
+log4j.logger.org.apache.activemq.store.journal=INFO
+log4j.logger.org.activeio.journal=INFO
+
+# CONSOLE appender not used by default
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.out.file=target/servicemix-test.log
+log4j.appender.out.append=true
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j-tests.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j-tests.properties
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j-tests.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j.properties?view=auto&rev=532104
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j.properties (added)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j.properties Tue Apr 24 14:57:48 2007
@@ -0,0 +1,43 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+
+#
+# The logging properties used during tests..
+#
+log4j.rootLogger=DEBUG, stdout
+
+log4j.logger.org.springframework=INFO
+log4j.logger.org.apache.activemq=INFO
+log4j.logger.org.apache.activemq.spring=WARN
+
+
+#log4j.logger.org.apache.servicemix=DEBUG
+
+# CONSOLE appender
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.out.file=target/servicemix-test.log
+log4j.appender.out.append=true
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j.properties
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/log4j.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/spring.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/spring.xml?view=auto&rev=532104
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/spring.xml (added)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/spring.xml Tue Apr 24 14:57:48 2007
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
+ xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
+ xmlns:test="urn:test">
+
+ <sm:container id="jbi" embedded="true">
+
+ <sm:endpoints>
+ <cxfse:endpoint>
+ <cxfse:pojo>
+ <bean class="org.apache.cxf.calculator.CalculatorImpl" />
+ </cxfse:pojo>
+ </cxfse:endpoint>
+ </sm:endpoints>
+
+ </sm:container>
+
+</beans>
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/spring.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/spring.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/servicemix/trunk/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/spring.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml