Author: gnodet
Date: Sun Oct 15 11:24:04 2006
New Revision: 464244
URL: http://svn.apache.org/viewvc?view=rev&rev=464244
Log:
Refactor jsr181 to use the new DefaultComponent
Added:
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/EndpointComponentContext.java
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/EndpointDeliveryChannel.java
Removed:
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Bootstrap.java
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Configuration.java
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181ConfigurationMBean.java
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181LifeCycle.java
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181SpringComponent.java
Modified:
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Component.java
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181XBeanDeployer.java
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/packaging/Jsr181ServiceUnitAnalyzer.java
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiFaultSerializer.java
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiProxy.java
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiProxyFactoryBean.java
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181ComplexPojoTest.java
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181MTOMTest.java
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181OverrideTest.java
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringProxyTest.java
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/xfire/JbiProxyTest.java
Added:
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/EndpointComponentContext.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/EndpointComponentContext.java?view=auto&rev=464244
==============================================================================
---
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/EndpointComponentContext.java
(added)
+++
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/EndpointComponentContext.java
Sun Oct 15 11:24:04 2006
@@ -0,0 +1,127 @@
+/*
+ * 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.jsr181;
+
+import java.util.MissingResourceException;
+import java.util.logging.Logger;
+
+import javax.jbi.JBIException;
+import javax.jbi.component.ComponentContext;
+import javax.jbi.management.MBeanNames;
+import javax.jbi.messaging.DeliveryChannel;
+import javax.jbi.messaging.MessagingException;
+import javax.jbi.servicedesc.ServiceEndpoint;
+import javax.management.MBeanServer;
+import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+
+public class EndpointComponentContext implements ComponentContext {
+
+ private ComponentContext context;
+ private DeliveryChannel channel;
+
+ public EndpointComponentContext(ComponentContext context) {
+ this.context = context;
+ }
+
+ public ServiceEndpoint activateEndpoint(QName serviceName, String
endpointName) throws JBIException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void deactivateEndpoint(ServiceEndpoint endpoint) throws
JBIException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void deregisterExternalEndpoint(ServiceEndpoint externalEndpoint)
throws JBIException {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getComponentName() {
+ return context.getComponentName();
+ }
+
+ public DeliveryChannel getDeliveryChannel() throws MessagingException {
+ if (this.channel == null) {
+ this.channel = new
EndpointDeliveryChannel(context.getDeliveryChannel());
+ }
+ return this.channel;
+ }
+
+ public ServiceEndpoint getEndpoint(QName service, String name) {
+ return context.getEndpoint(service, name);
+ }
+
+ public Document getEndpointDescriptor(ServiceEndpoint endpoint) throws
JBIException {
+ return context.getEndpointDescriptor(endpoint);
+ }
+
+ public ServiceEndpoint[] getEndpoints(QName interfaceName) {
+ return context.getEndpoints(interfaceName);
+ }
+
+ public ServiceEndpoint[] getEndpointsForService(QName serviceName) {
+ return context.getEndpointsForService(serviceName);
+ }
+
+ public ServiceEndpoint[] getExternalEndpoints(QName interfaceName) {
+ return context.getExternalEndpoints(interfaceName);
+ }
+
+ public ServiceEndpoint[] getExternalEndpointsForService(QName serviceName)
{
+ return context.getExternalEndpointsForService(serviceName);
+ }
+
+ public String getInstallRoot() {
+ return context.getInstallRoot();
+ }
+
+ public Logger getLogger(String suffix, String resourceBundleName) throws
MissingResourceException, JBIException {
+ return context.getLogger(suffix, resourceBundleName);
+ }
+
+ public MBeanNames getMBeanNames() {
+ return context.getMBeanNames();
+ }
+
+ public MBeanServer getMBeanServer() {
+ return context.getMBeanServer();
+ }
+
+ public InitialContext getNamingContext() {
+ return context.getNamingContext();
+ }
+
+ public Object getTransactionManager() {
+ return context.getTransactionManager();
+ }
+
+ public String getWorkspaceRoot() {
+ return context.getWorkspaceRoot();
+ }
+
+ public void registerExternalEndpoint(ServiceEndpoint externalEndpoint)
throws JBIException {
+ throw new UnsupportedOperationException();
+ }
+
+ public ServiceEndpoint resolveEndpointReference(DocumentFragment epr) {
+ return context.resolveEndpointReference(epr);
+ }
+
+}
Added:
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/EndpointDeliveryChannel.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/EndpointDeliveryChannel.java?view=auto&rev=464244
==============================================================================
---
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/EndpointDeliveryChannel.java
(added)
+++
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/EndpointDeliveryChannel.java
Sun Oct 15 11:24:04 2006
@@ -0,0 +1,85 @@
+/*
+ * 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.jsr181;
+
+import javax.jbi.messaging.DeliveryChannel;
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.MessageExchangeFactory;
+import javax.jbi.messaging.MessagingException;
+import javax.jbi.servicedesc.ServiceEndpoint;
+import javax.xml.namespace.QName;
+
+/**
+ * This class is a wrapper around an existing DeliveryChannel
+ * that will be given to service engine endpoints so that
+ * they are able to send messages and to interact with the
+ * JBI container.
+ *
+ * @author gnodet
+ */
+public class EndpointDeliveryChannel implements DeliveryChannel {
+
+ private final DeliveryChannel channel;
+
+ public EndpointDeliveryChannel(DeliveryChannel channel) {
+ this.channel = channel;
+ }
+
+ public MessageExchange accept() throws MessagingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public MessageExchange accept(long timeout) throws MessagingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void close() throws MessagingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public MessageExchangeFactory createExchangeFactory() {
+ return channel.createExchangeFactory();
+ }
+
+ public MessageExchangeFactory createExchangeFactory(QName interfaceName) {
+ return channel.createExchangeFactory(interfaceName);
+ }
+
+ public MessageExchangeFactory createExchangeFactory(ServiceEndpoint
endpoint) {
+ return channel.createExchangeFactory(endpoint);
+ }
+
+ public MessageExchangeFactory createExchangeFactoryForService(QName
serviceName) {
+ return channel.createExchangeFactoryForService(serviceName);
+ }
+
+ public void send(MessageExchange exchange) throws MessagingException {
+ if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
+ throw new UnsupportedOperationException("Asynchronous send of
active exchanges are not supported");
+ }
+ channel.send(exchange);
+ }
+
+ public boolean sendSync(MessageExchange exchange, long timeout) throws
MessagingException {
+ return channel.sendSync(exchange, timeout);
+ }
+
+ public boolean sendSync(MessageExchange exchange) throws
MessagingException {
+ return channel.sendSync(exchange);
+ }
+}
Modified:
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Component.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Component.java?view=diff&rev=464244&r1=464243&r2=464244
==============================================================================
---
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Component.java
(original)
+++
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Component.java
Sun Oct 15 11:24:04 2006
@@ -16,30 +16,81 @@
*/
package org.apache.servicemix.jsr181;
-import org.apache.servicemix.common.BaseComponent;
-import org.apache.servicemix.common.BaseLifeCycle;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import javax.jbi.component.ComponentContext;
+
import org.apache.servicemix.common.BaseServiceUnitManager;
+import org.apache.servicemix.common.DefaultComponent;
import org.apache.servicemix.common.Deployer;
+import org.apache.servicemix.jsr181.xfire.JbiTransport;
+import org.codehaus.xfire.DefaultXFire;
+import org.codehaus.xfire.XFire;
+import org.codehaus.xfire.transport.Transport;
/**
+ * @org.apache.xbean.XBean element="component"
+ * description="A jsr181 component"
* @author gnodet
*
*/
-public class Jsr181Component extends BaseComponent {
+public class Jsr181Component extends DefaultComponent {
- /* (non-Javadoc)
- * @see org.servicemix.common.BaseComponent#createLifeCycle()
- */
- protected BaseLifeCycle createLifeCycle() {
- return new Jsr181LifeCycle(this);
+ private Jsr181Endpoint[] endpoints;
+ private XFire xfire;
+
+ public Jsr181Component() {
+ }
+
+ public Jsr181Endpoint[] getEndpoints() {
+ return endpoints;
}
+ public void setEndpoints(Jsr181Endpoint[] endpoints) {
+ this.endpoints = endpoints;
+ }
+
+ public List getConfiguredEndpoints() {
+ return endpoints != null ? Arrays.asList(endpoints) :
Collections.EMPTY_LIST;
+ }
+
+ protected Class[] getEndpointClasses() {
+ return new Class[] { Jsr181Endpoint.class };
+ }
+
/* (non-Javadoc)
* @see org.servicemix.common.BaseComponent#createServiceUnitManager()
*/
public BaseServiceUnitManager createServiceUnitManager() {
Deployer[] deployers = new Deployer[] { new Jsr181XBeanDeployer(this)
};
return new BaseServiceUnitManager(this, deployers);
+ }
+
+ /**
+ * @return Returns the xfire.
+ */
+ public XFire getXFire() {
+ return xfire;
+ }
+
+ /* (non-Javadoc)
+ * @see org.servicemix.common.BaseLifeCycle#doInit()
+ */
+ protected void doInit() throws Exception {
+ xfire = createXFire(this.context);
+ super.doInit();
+ }
+
+ public static XFire createXFire(ComponentContext context) {
+ XFire xfire = new DefaultXFire();
+ Object[] transports =
xfire.getTransportManager().getTransports().toArray();
+ for (int i = 0; i < transports.length; i++) {
+ xfire.getTransportManager().unregister((Transport) transports[i]);
+ }
+ xfire.getTransportManager().register(new JbiTransport(context));
+ return xfire;
}
}
Modified:
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java?view=diff&rev=464244&r1=464243&r2=464244
==============================================================================
---
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java
(original)
+++
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java
Sun Oct 15 11:24:04 2006
@@ -26,6 +26,7 @@
import java.util.Map;
import javax.jbi.component.ComponentContext;
+import javax.jbi.management.DeploymentException;
import javax.jbi.messaging.MessageExchange.Role;
import javax.jbi.servicedesc.ServiceEndpoint;
import javax.wsdl.Binding;
@@ -45,6 +46,7 @@
import org.apache.servicemix.jsr181.xfire.JbiFaultSerializer;
import org.apache.servicemix.jsr181.xfire.ServiceFactoryHelper;
import org.codehaus.xfire.XFire;
+import org.codehaus.xfire.annotations.AnnotationServiceFactory;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.service.binding.ObjectServiceFactory;
import org.codehaus.xfire.service.invoker.BeanInvoker;
@@ -163,7 +165,7 @@
logger = this.serviceUnit.getComponent().getLogger();
ComponentContext ctx =
this.serviceUnit.getComponent().getComponentContext();
activated = ctx.activateEndpoint(service, endpoint);
- injectContext(new EndpointComponentContext(ctx));
+ injectContext(new EndpointComponentContext(this));
processor.start();
}
@@ -188,6 +190,19 @@
}
}
+ /**
+ * Validate the endpoint at either deployment time for statically defined
endpoints or at runtime for dynamic endpoints
+ *
+ * @throws DeploymentException
+ */
+ public void validate() throws DeploymentException {
+ try {
+ registerService();
+ } catch (Exception e) {
+ throw new DeploymentException(e);
+ }
+ }
+
public void registerService() throws Exception {
if (pojo == null) {
Class cl = Class.forName(pojoClass, true,
getServiceUnit().getConfigurationClassLoader());
@@ -254,11 +269,11 @@
}
props.put(ObjectServiceFactory.USE, SoapConstants.USE_LITERAL);
if (serviceInterface != null) {
- props.put("annotations.allow.interface", "true");
+ props.put(AnnotationServiceFactory.ALLOW_INTERFACE, Boolean.TRUE);
}
xfireService = factory.create(serviceClass, svcLocalName,
svcNamespace, props);
xfireService.setInvoker(new BeanInvoker(getPojo()));
- xfireService.setFaultSerializer(new
JbiFaultSerializer(getConfiguration()));
+ xfireService.setFaultSerializer(new JbiFaultSerializer());
xfireService.setProperty(SoapConstants.MTOM_ENABLED,
Boolean.toString(mtomEnabled));
xfire.getServiceRegistry().register(xfireService);
@@ -356,15 +371,9 @@
}
public XFire getXFire() {
- Jsr181LifeCycle jsr181LifeCycle = (Jsr181LifeCycle)
this.serviceUnit.getComponent().getLifeCycle();
- XFire xfire = jsr181LifeCycle.getXFire();
+ Jsr181Component component = (Jsr181Component)
this.serviceUnit.getComponent();
+ XFire xfire = component.getXFire();
return xfire;
- }
-
- public Jsr181ConfigurationMBean getConfiguration() {
- Jsr181LifeCycle jsr181LifeCycle = (Jsr181LifeCycle)
this.serviceUnit.getComponent().getLifeCycle();
- Jsr181ConfigurationMBean configuration =
jsr181LifeCycle.getConfiguration();
- return configuration;
}
public String getPojoClass() {
Modified:
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181XBeanDeployer.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181XBeanDeployer.java?view=diff&rev=464244&r1=464243&r2=464244
==============================================================================
---
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181XBeanDeployer.java
(original)
+++
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181XBeanDeployer.java
Sun Oct 15 11:24:04 2006
@@ -23,12 +23,9 @@
import javax.jbi.management.DeploymentException;
-import org.apache.servicemix.common.BaseComponent;
import org.apache.servicemix.common.BaseLifeCycle;
import org.apache.servicemix.common.Endpoint;
-import org.apache.servicemix.common.EndpointComponentContext;
import org.apache.servicemix.common.xbean.AbstractXBeanDeployer;
-import org.apache.servicemix.common.xbean.XBeanServiceUnit;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanNotOfRequiredTypeException;
@@ -38,7 +35,7 @@
public class Jsr181XBeanDeployer extends AbstractXBeanDeployer {
- public Jsr181XBeanDeployer(BaseComponent component) {
+ public Jsr181XBeanDeployer(Jsr181Component component) {
super(component);
}
Modified:
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/packaging/Jsr181ServiceUnitAnalyzer.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/packaging/Jsr181ServiceUnitAnalyzer.java?view=diff&rev=464244&r1=464243&r2=464244
==============================================================================
---
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/packaging/Jsr181ServiceUnitAnalyzer.java
(original)
+++
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/packaging/Jsr181ServiceUnitAnalyzer.java
Sun Oct 15 11:24:04 2006
@@ -33,8 +33,8 @@
import org.apache.servicemix.common.Endpoint;
import org.apache.servicemix.common.xbean.AbstractXBeanServiceUnitAnalyzer;
+import org.apache.servicemix.jsr181.Jsr181Component;
import org.apache.servicemix.jsr181.Jsr181Endpoint;
-import org.apache.servicemix.jsr181.Jsr181SpringComponent;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
@@ -49,7 +49,7 @@
// We need to generate the dummy component to register the
services
Jsr181Endpoint jsr181Endpoint = (Jsr181Endpoint) endpoint;
try {
- Jsr181SpringComponent componentDummy = new
Jsr181SpringComponent();
+ Jsr181Component componentDummy = new Jsr181Component();
componentDummy
.setEndpoints(new Jsr181Endpoint[] {
jsr181Endpoint });
componentDummy.getLifeCycle().init(new
DummyComponentContext());
Modified:
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiFaultSerializer.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiFaultSerializer.java?view=diff&rev=464244&r1=464243&r2=464244
==============================================================================
---
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiFaultSerializer.java
(original)
+++
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiFaultSerializer.java
Sun Oct 15 11:24:04 2006
@@ -23,7 +23,6 @@
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
-import org.apache.servicemix.jsr181.Jsr181ConfigurationMBean;
import org.codehaus.xfire.MessageContext;
import org.codehaus.xfire.XFireRuntimeException;
import org.codehaus.xfire.exchange.InMessage;
@@ -35,10 +34,7 @@
public class JbiFaultSerializer implements MessageSerializer {
- private Jsr181ConfigurationMBean configuration;
-
- public JbiFaultSerializer(Jsr181ConfigurationMBean configuration) {
- this.configuration = configuration;
+ public JbiFaultSerializer() {
}
public void readMessage(InMessage message, MessageContext context) throws
XFireFault {
Modified:
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiProxy.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiProxy.java?view=diff&rev=464244&r1=464243&r2=464244
==============================================================================
---
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiProxy.java
(original)
+++
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiProxy.java
Sun Oct 15 11:24:04 2006
@@ -16,6 +16,9 @@
*/
package org.apache.servicemix.jsr181.xfire;
+import java.util.HashMap;
+import java.util.Map;
+
import javax.jbi.JBIException;
import javax.jbi.component.ComponentContext;
import javax.jbi.servicedesc.ServiceEndpoint;
@@ -25,6 +28,7 @@
import javax.xml.namespace.QName;
import org.codehaus.xfire.XFire;
+import org.codehaus.xfire.annotations.AnnotationServiceFactory;
import org.codehaus.xfire.client.Client;
import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.service.Service;
@@ -81,8 +85,10 @@
public Object getProxy() throws Exception {
if (proxy == null) {
+ Map props = new HashMap();
+ props.put(AnnotationServiceFactory.ALLOW_INTERFACE, Boolean.TRUE);
ServiceFactory factory =
ServiceFactoryHelper.findServiceFactory(xfire, serviceClass, null, null);
- Service service = factory.create(serviceClass, null,
getDescription(), null);
+ Service service = factory.create(serviceClass, null,
getDescription(), props);
JBIClient client = new JBIClient(xfire, service);
if (interfaceName != null) {
client.getService().setProperty(JbiChannel.JBI_INTERFACE_NAME,
interfaceName);
Modified:
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiProxyFactoryBean.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiProxyFactoryBean.java?view=diff&rev=464244&r1=464243&r2=464244
==============================================================================
---
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiProxyFactoryBean.java
(original)
+++
incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/xfire/JbiProxyFactoryBean.java
Sun Oct 15 11:24:04 2006
@@ -30,7 +30,7 @@
import org.apache.servicemix.client.ServiceMixClient;
import org.apache.servicemix.client.ServiceMixClientFacade;
import org.apache.servicemix.jbi.container.JBIContainer;
-import org.apache.servicemix.jsr181.Jsr181LifeCycle;
+import org.apache.servicemix.jsr181.Jsr181Component;
import org.codehaus.xfire.XFire;
import org.springframework.beans.factory.FactoryBean;
@@ -76,7 +76,7 @@
synchronized private InvocationHandler getJBIInvocationHandler() throws
Exception {
if( jbiInvocationHandler == null ) {
- XFire xfire = Jsr181LifeCycle.createXFire(getInternalContext());
+ XFire xfire = Jsr181Component.createXFire(getInternalContext());
Object o = JbiProxy.create(xfire, context, interfaceName, service,
endpoint, type);
jbiInvocationHandler = Proxy.getInvocationHandler(o);
}
Modified:
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181ComplexPojoTest.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181ComplexPojoTest.java?view=diff&rev=464244&r1=464243&r2=464244
==============================================================================
---
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181ComplexPojoTest.java
(original)
+++
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181ComplexPojoTest.java
Sun Oct 15 11:24:04 2006
@@ -103,7 +103,7 @@
}
public void testComplexOneWay() throws Exception {
- Jsr181SpringComponent component = new Jsr181SpringComponent();
+ Jsr181Component component = new Jsr181Component();
Jsr181Endpoint endpoint = new Jsr181Endpoint();
endpoint.setPojo(new ComplexPojoImpl());
endpoint.setServiceInterface(ComplexPojo.class.getName());
@@ -126,7 +126,7 @@
}
public void testComplexTwoWay() throws Exception {
- Jsr181SpringComponent component = new Jsr181SpringComponent();
+ Jsr181Component component = new Jsr181Component();
Jsr181Endpoint endpoint = new Jsr181Endpoint();
endpoint.setPojo(new ComplexPojoImpl());
endpoint.setServiceInterface(ComplexPojo.class.getName());
@@ -154,7 +154,7 @@
}
public void testFault() throws Exception {
- Jsr181SpringComponent component = new Jsr181SpringComponent();
+ Jsr181Component component = new Jsr181Component();
Jsr181Endpoint endpoint = new Jsr181Endpoint();
endpoint.setPojo(new ComplexPojoImpl());
endpoint.setServiceInterface(ComplexPojo.class.getName());
Modified:
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181MTOMTest.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181MTOMTest.java?view=diff&rev=464244&r1=464243&r2=464244
==============================================================================
---
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181MTOMTest.java
(original)
+++
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181MTOMTest.java
Sun Oct 15 11:24:04 2006
@@ -56,7 +56,7 @@
}
public void testMtom() throws Exception {
- Jsr181SpringComponent jsr181 = new Jsr181SpringComponent();
+ Jsr181Component jsr181 = new Jsr181Component();
Jsr181Endpoint ep = new Jsr181Endpoint();
ep.setPojo(new EchoWithAttachment());
ep.setMtomEnabled(true);
Modified:
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181OverrideTest.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181OverrideTest.java?view=diff&rev=464244&r1=464243&r2=464244
==============================================================================
---
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181OverrideTest.java
(original)
+++
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181OverrideTest.java
Sun Oct 15 11:24:04 2006
@@ -22,8 +22,6 @@
import junit.framework.TestCase;
import org.apache.servicemix.jbi.container.JBIContainer;
-import org.apache.servicemix.jsr181.Jsr181Endpoint;
-import org.apache.servicemix.jsr181.Jsr181SpringComponent;
import test.EchoService;
import test.EchoService2;
@@ -53,7 +51,7 @@
QName svcName = new QName("svcUri", "service");
QName itfName = new QName("itfUri", "interface");
String epName = "endpoint";
- Jsr181SpringComponent component = new Jsr181SpringComponent();
+ Jsr181Component component = new Jsr181Component();
Jsr181Endpoint endpoint = new Jsr181Endpoint();
endpoint.setService(svcName);
endpoint.setInterfaceName(itfName);
@@ -67,7 +65,7 @@
QName svcName = new QName("svcUri", "service");
QName itfName = new QName("itfUri", "interface");
String epName = "endpoint";
- Jsr181SpringComponent component = new Jsr181SpringComponent();
+ Jsr181Component component = new Jsr181Component();
Jsr181Endpoint endpoint = new Jsr181Endpoint();
endpoint.setService(svcName);
endpoint.setInterfaceName(itfName);
Modified:
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringProxyTest.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringProxyTest.java?view=diff&rev=464244&r1=464243&r2=464244
==============================================================================
---
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringProxyTest.java
(original)
+++
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181SpringProxyTest.java
Sun Oct 15 11:24:04 2006
@@ -26,10 +26,8 @@
import org.apache.servicemix.jbi.jaxp.SourceTransformer;
import org.apache.servicemix.jbi.jaxp.StringSource;
import org.apache.servicemix.tck.SpringTestSupport;
-import org.springframework.context.support.AbstractXmlApplicationContext;
import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
-
-import test.Echo;
+import org.springframework.context.support.AbstractXmlApplicationContext;
public class Jsr181SpringProxyTest extends SpringTestSupport {
Modified:
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/xfire/JbiProxyTest.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/xfire/JbiProxyTest.java?view=diff&rev=464244&r1=464243&r2=464244
==============================================================================
---
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/xfire/JbiProxyTest.java
(original)
+++
incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/xfire/JbiProxyTest.java
Sun Oct 15 11:24:04 2006
@@ -27,9 +27,8 @@
import org.apache.servicemix.client.DefaultServiceMixClient;
import org.apache.servicemix.jbi.container.JBIContainer;
import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.jsr181.Jsr181Component;
import org.apache.servicemix.jsr181.Jsr181Endpoint;
-import org.apache.servicemix.jsr181.Jsr181LifeCycle;
-import org.apache.servicemix.jsr181.Jsr181SpringComponent;
import org.codehaus.xfire.XFire;
public class JbiProxyTest extends TestCase {
@@ -56,13 +55,13 @@
public void testProxy() throws Exception {
container.start();
- Jsr181SpringComponent component1 = new Jsr181SpringComponent();
+ Jsr181Component component1 = new Jsr181Component();
Jsr181Endpoint endpoint1 = new Jsr181Endpoint();
endpoint1.setPojo(new EchoService());
component1.setEndpoints(new Jsr181Endpoint[] { endpoint1 });
container.activateComponent(component1, "JSR181Component-1");
- Jsr181SpringComponent component2 = new Jsr181SpringComponent();
+ Jsr181Component component2 = new Jsr181Component();
Jsr181Endpoint endpoint2 = new Jsr181Endpoint();
endpoint2.setPojo(new ProxyPojoService());
endpoint2.setServiceInterface(ProxyPojo.class.getName());
@@ -107,7 +106,7 @@
this.context = context;
if (context != null) {
try {
- XFire xfire = Jsr181LifeCycle.createXFire(context);
+ XFire xfire = Jsr181Component.createXFire(context);
QName service = new
QName("http://xfire.jsr181.servicemix.apache.org", "EchoService");
proxy = (Echo) JbiProxy.create(xfire, context, null,
service, null, Echo.class);
} catch (Exception e) {