Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java Sun Oct 22 21:44:24 2006 @@ -44,7 +44,8 @@ import org.apache.cxf.Bus; import org.apache.cxf.BusException; -import org.apache.cxf.binding.BindingInfoFactoryBeanManager; +import org.apache.cxf.binding.xml.XMLBindingInfoFactoryBean; +import org.apache.cxf.binding.xml.XMLConstants; import org.apache.cxf.common.logging.LogUtils; import org.apache.cxf.configuration.Configurer; import org.apache.cxf.endpoint.Client; @@ -52,18 +53,21 @@ import org.apache.cxf.endpoint.Endpoint; import org.apache.cxf.endpoint.EndpointException; import org.apache.cxf.jaxb.JAXBDataBinding; +import org.apache.cxf.jaxws.binding.soap.JaxWsSoapBindingInfoFactoryBean; import org.apache.cxf.jaxws.handler.HandlerResolverImpl; import org.apache.cxf.jaxws.support.DummyImpl; import org.apache.cxf.jaxws.support.JaxWsEndpointImpl; import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean; import org.apache.cxf.service.Service; -import org.apache.cxf.service.model.AbstractBindingInfoFactoryBean; +import org.apache.cxf.service.factory.AbstractBindingInfoFactoryBean; +import org.apache.cxf.service.factory.AbstractServiceFactoryBean; import org.apache.cxf.service.model.BindingInfo; import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.service.model.ServiceInfo; +import org.apache.cxf.transport.DestinationFactory; +import org.apache.cxf.transport.DestinationFactoryManager; import org.apache.cxf.wsdl11.WSDLServiceFactory; - public class ServiceImpl extends ServiceDelegate { private static final Logger LOG = LogUtils.getL7dLogger(ServiceImpl.class); @@ -76,7 +80,7 @@ private final Collection<QName> ports = new HashSet<QName>(); private Map<QName, PortInfo> portInfos = new HashMap<QName, PortInfo>(); private Executor executor; - private QName serviceName; + private QName serviceName; private Class<?> clazz; public ServiceImpl(Bus b, URL url, QName name, Class<?> cls) { @@ -88,41 +92,28 @@ handlerResolver = new HandlerResolverImpl(bus, name); } - public void addPort(QName portName, String bindingId, String address) { PortInfo portInfo = new PortInfo(bindingId, address); portInfos.put(portName, portInfo); } - // public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Mode - // mode) { - // DispatchServiceFactory sf = new DispatchServiceFactory(); - // sf.setPayloadClass(type); - // sf.setPayloadMode(mode); - // - // Service service = sf.create(); - // EndpointImpl ep = new EndpointImpl(bus, service, portName); - // ClientImpl client = new ClientImpl(bus, ep); - // - // return new ClientProxyFactory(bus).create(service, portName, type); - // } - - private Endpoint getJaxwsEndpoint(QName portName, Service service) { + private Endpoint getJaxwsEndpoint(QName portName, AbstractServiceFactoryBean sf) { + Service service = sf.getService(); ServiceInfo si = service.getServiceInfo(); EndpointInfo ei = null; if (portName == null) { ei = si.getEndpoints().iterator().next(); } else { - PortInfo portInfo = getPortInfor(portName); + PortInfo portInfo = getPortInfo(portName); if (null != portInfo) { try { - ei = createEndpointInfo(service, portName, portInfo); + ei = createEndpointInfo(sf, portName, portInfo); } catch (BusException e) { throw new WebServiceException(e); } } else { ei = si.getEndpoint(portName); - } + } } try { @@ -131,9 +122,10 @@ throw new WebServiceException(e); } } - - - private Service createDispatchService(Class<?> type) { + + private AbstractServiceFactoryBean createDispatchService(Class<?> type) { + AbstractServiceFactoryBean serviceFactory; + Service dispatchService = null; if (null != wsdlURL) { @@ -143,42 +135,41 @@ dispatchService.setDataBinding(new JAXBDataBinding(clazz)); } catch (JAXBException e) { new WebServiceException(e); - } + } + serviceFactory = sf; } else { - JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean(); - serviceFactory.setBus(bus); - serviceFactory.setServiceName(serviceName); + JaxWsServiceFactoryBean sf = new JaxWsServiceFactoryBean(); + sf.setBus(bus); + sf.setServiceName(serviceName); // maybe we can find another way to create service which have no SEI - serviceFactory.setServiceClass(DummyImpl.class); + sf.setServiceClass(DummyImpl.class); try { - serviceFactory.setDataBinding(new JAXBDataBinding(type)); + sf.setDataBinding(new JAXBDataBinding(type)); } catch (JAXBException e) { new WebServiceException(e); } - dispatchService = serviceFactory.create(); + dispatchService = sf.create(); + serviceFactory = sf; } - configureObject(dispatchService); - return dispatchService; + return serviceFactory; } public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode) { - - Service dispatchService = createDispatchService(type); - Endpoint endpoint = getJaxwsEndpoint(portName, dispatchService); - + AbstractServiceFactoryBean sf = createDispatchService(type); + Endpoint endpoint = getJaxwsEndpoint(portName, sf); + Dispatch<T> disp = new DispatchImpl<T>(bus, mode, type, getExecutor(), endpoint); configureObject(disp); return disp; } - - + public Dispatch<Object> createDispatch(QName portName, JAXBContext context, Mode mode) { - - Service dispatchService = createDispatchService(null); - Endpoint endpoint = getJaxwsEndpoint(portName, dispatchService); + + AbstractServiceFactoryBean sf = createDispatchService(null); + Endpoint endpoint = getJaxwsEndpoint(portName, sf); Dispatch<Object> disp = new DispatchImpl<Object>(bus, mode, context, Object.class, getExecutor(), endpoint); @@ -232,7 +223,7 @@ protected <T> T createPort(QName portName, Class<T> serviceEndpointInterface) { LOG.log(Level.FINE, "creating port for portName", portName); - LOG.log(Level.FINE, "endpoint interface:", serviceEndpointInterface); + LOG.log(Level.FINE, "endpoint interface:", serviceEndpointInterface); JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean(); serviceFactory.setBus(bus); @@ -247,9 +238,9 @@ configureObject(service); QName pn = portName; - ServiceInfo si = service.getServiceInfo(); - - EndpointInfo ei = null; + ServiceInfo si = service.getServiceInfo(); + + EndpointInfo ei = null; if (portName == null) { if (1 == si.getEndpoints().size()) { ei = si.getEndpoints().iterator().next(); @@ -258,15 +249,15 @@ } else { // first chech the endpointInfo from portInfos PortInfo portInfo = portInfos.get(portName); - if (null != portInfo) { + if (null != portInfo) { try { - ei = createEndpointInfo(service, portName, portInfo); + ei = createEndpointInfo(serviceFactory, portName, portInfo); } catch (BusException e) { throw new WebServiceException(e); - } + } } else { ei = si.getEndpoint(portName); - } + } } if (null == pn) { throw new WebServiceException(BUNDLE.getString("COULD_NOT_DETERMINE_PORT")); @@ -298,45 +289,57 @@ return serviceEndpointInterface.cast(obj); } - private EndpointInfo createEndpointInfo(Service service, QName portName, PortInfo portInfo) - throws BusException { - + private EndpointInfo createEndpointInfo(AbstractServiceFactoryBean serviceFactory, + QName portName, + PortInfo portInfo) throws BusException { EndpointInfo ei = null; - String address = portInfo.getAddress(); - //create bindingInfo from the bindingId - BindingInfoFactoryBeanManager bfm = bus.getExtension(BindingInfoFactoryBeanManager.class); - - AbstractBindingInfoFactoryBean bindingFactory = - bfm.getBindingInfoFactoryBean(portInfo.getBindingUri()); - bindingFactory.setService(service); - + String address = portInfo.getAddress(); + + DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class); + DestinationFactory df = dfm.getDestinationFactoryForUri(portInfo.getAddress()); + + String transportId = df.getTransportIds().get(0); + String bindingUri = portInfo.getBindingUri(); + + // TODO: Replace with discovery mechanism!! + AbstractBindingInfoFactoryBean bindingFactory = null; + if (bindingUri.equals(XMLConstants.NS_XML_FORMAT)) { + bindingFactory = new XMLBindingInfoFactoryBean(); + } else if ("http://schemas.xmlsoap.org/soap/".equals(bindingUri)) { + JaxWsSoapBindingInfoFactoryBean soapBindingFactory = new JaxWsSoapBindingInfoFactoryBean(); + soapBindingFactory.setTransportURI(transportId); + bindingFactory = soapBindingFactory; + } else { + bindingFactory = new XMLBindingInfoFactoryBean(); + } + + bindingFactory.setServiceFactory(serviceFactory); + BindingInfo bindingInfo = bindingFactory.create(); + Service service = serviceFactory.getService(); service.getServiceInfo().addBinding(bindingInfo); - //TODO we may need to get the transportURI from Address - ei = new EndpointInfo(service.getServiceInfo(), bindingFactory.getTransportURI()); + + // TODO we may need to get the transportURI from Address + ei = new EndpointInfo(service.getServiceInfo(), transportId); ei.setName(portName); ei.setAddress(address); ei.setBinding(bindingInfo); - + service.getServiceInfo().addEndpoint(ei); return ei; } - private void configureObject(Object instance) { Configurer configurer = bus.getExtension(Configurer.class); if (null != configurer) { configurer.configureBean(instance); } } - - private PortInfo getPortInfor(QName portName) { - //TODO if the portName null ? + + private PortInfo getPortInfo(QName portName) { + // TODO if the portName null ? return portInfos.get(portName); } - - - static class PortInfo { private String bindingUri;
Added: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/JaxWsSoapBindingInfoFactoryBean.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/JaxWsSoapBindingInfoFactoryBean.java?view=auto&rev=466932 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/JaxWsSoapBindingInfoFactoryBean.java (added) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/JaxWsSoapBindingInfoFactoryBean.java Sun Oct 22 21:44:24 2006 @@ -0,0 +1,65 @@ +/** + * 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.cxf.jaxws.binding.soap; + +import javax.jws.soap.SOAPBinding; +import javax.jws.soap.SOAPBinding.Style; +import javax.jws.soap.SOAPBinding.Use; + +import org.apache.cxf.binding.soap.SoapBindingInfoFactoryBean; +import org.apache.cxf.jaxws.support.AbstractJaxWsServiceFactoryBean; + +/** + * Introspects the SOAPBinding annotation to provide to construct + * a [EMAIL PROTECTED] org.apache.cxf.service.model.BindingInfo}. + */ +public class JaxWsSoapBindingInfoFactoryBean extends SoapBindingInfoFactoryBean { + + @Override + protected String getStyle() { + SOAPBinding sb = getServiceClass().getAnnotation(SOAPBinding.class); + if (sb != null) { + if (sb.style().equals(Style.DOCUMENT)) { + return "document"; + } else if (sb.style().equals(Style.RPC)) { + return "rpc"; + } + } + return super.getStyle(); + } + + Class<?> getServiceClass() { + return ((AbstractJaxWsServiceFactoryBean)getServiceFactory()).getJaxWsImplementorInfo() + .getEndpointClass(); + } + + @Override + public String getUse() { + SOAPBinding sb = getServiceClass().getAnnotation(SOAPBinding.class); + if (sb != null) { + if (sb.use().equals(Use.LITERAL)) { + return "literal"; + } else if (sb.use().equals(Use.ENCODED)) { + return "encoded"; + } + } + return super.getStyle(); + } + +} Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/JaxWsSoapBindingInfoFactoryBean.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/JaxWsSoapBindingInfoFactoryBean.java ------------------------------------------------------------------------------ svn:executable = * Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/JaxWsSoapBindingInfoFactoryBean.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletTransportFactory.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletTransportFactory.java?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletTransportFactory.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletTransportFactory.java Sun Oct 22 21:44:24 2006 @@ -21,29 +21,24 @@ package org.apache.cxf.jaxws.servlet; import java.io.IOException; -import java.util.Collection; -import javax.annotation.PostConstruct; import javax.annotation.Resource; import org.apache.cxf.Bus; import org.apache.cxf.service.model.EndpointInfo; +import org.apache.cxf.transport.AbstractTransportFactory; import org.apache.cxf.transport.Conduit; import org.apache.cxf.transport.ConduitInitiator; -import org.apache.cxf.transport.ConduitInitiatorManager; import org.apache.cxf.transport.Destination; import org.apache.cxf.transport.DestinationFactory; -import org.apache.cxf.transport.DestinationFactoryManager; import org.apache.cxf.ws.addressing.EndpointReferenceType; -public class ServletTransportFactory implements ConduitInitiator, DestinationFactory { +public class ServletTransportFactory extends AbstractTransportFactory + implements ConduitInitiator, DestinationFactory { EndpointReferenceType reference; private Bus bus; - private Collection<String> activationNamespaces; - - public ServletTransportFactory(Bus b, EndpointReferenceType ref) { bus = b; @@ -60,30 +55,6 @@ @Resource public void setBus(Bus bus) { this.bus = bus; - } - - @Resource - public void setActivationNamespaces(Collection<String> ans) { - activationNamespaces = ans; - } - - @PostConstruct - void register() { - if (null == bus) { - return; - } - ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class); - if (null != cim) { - for (String ns : activationNamespaces) { - cim.registerConduitInitiator(ns, this); - } - } - DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class); - if (null != dfm) { - for (String ns : activationNamespaces) { - dfm.registerDestinationFactory(ns, this); - } - } } public Conduit getConduit(EndpointInfo endpointInfo) Added: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/AbstractJaxWsServiceFactoryBean.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/AbstractJaxWsServiceFactoryBean.java?view=auto&rev=466932 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/AbstractJaxWsServiceFactoryBean.java (added) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/AbstractJaxWsServiceFactoryBean.java Sun Oct 22 21:44:24 2006 @@ -0,0 +1,34 @@ +/** + * 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.cxf.jaxws.support; + +import org.apache.cxf.service.factory.ReflectionServiceFactoryBean; + +public class AbstractJaxWsServiceFactoryBean extends ReflectionServiceFactoryBean { + + private JaxWsImplementorInfo jaxWsImplementorInfo; + + public JaxWsImplementorInfo getJaxWsImplementorInfo() { + return jaxWsImplementorInfo; + } + + public void setJaxWsImplementorInfo(JaxWsImplementorInfo jaxWsImplementorInfo) { + this.jaxWsImplementorInfo = jaxWsImplementorInfo; + } +} Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/AbstractJaxWsServiceFactoryBean.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/AbstractJaxWsServiceFactoryBean.java ------------------------------------------------------------------------------ svn:executable = * Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/AbstractJaxWsServiceFactoryBean.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsImplementorInfo.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsImplementorInfo.java?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsImplementorInfo.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsImplementorInfo.java Sun Oct 22 21:44:24 2006 @@ -62,6 +62,14 @@ public Class<?> getImplementorClass() { return implementorClass; } + + public Class<?> getEndpointClass() { + Class endpointInterface = getSEIClass(); + if (null == endpointInterface) { + endpointInterface = getImplementorClass(); + } + return endpointInterface; + } public String getWsdlLocation() { if (null != seiAnnotation) { Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java Sun Oct 22 21:44:24 2006 @@ -58,7 +58,7 @@ } WebService getPortTypeWebServiceAttribute() { - Class<?> epi = getEndpointClass(); + Class<?> epi = implInfo.getEndpointClass(); WebService ws = null; if (epi != null) { ws = epi.getAnnotation(WebService.class); @@ -69,14 +69,6 @@ return ws; } - Class getEndpointClass() { - Class endpointInterface = implInfo.getSEIClass(); - if (null == endpointInterface) { - endpointInterface = implInfo.getImplementorClass(); - } - return endpointInterface; - } - @Override public String getServiceName() { WebService ws = getConcreteWebServiceAttribute(); @@ -159,7 +151,7 @@ } Method getDeclaredMethod(Method method) { - Class endpointClass = getEndpointClass(); + Class endpointClass = implInfo.getEndpointClass(); if (!method.getDeclaringClass().equals(endpointClass)) { try { Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java Sun Oct 22 21:44:24 2006 @@ -32,6 +32,7 @@ import javax.xml.namespace.QName; import javax.xml.ws.AsyncHandler; import javax.xml.ws.Holder; +import javax.xml.ws.Service; import org.apache.cxf.endpoint.Endpoint; import org.apache.cxf.endpoint.EndpointException; @@ -39,7 +40,6 @@ import org.apache.cxf.jaxb.JAXBDataBinding; import org.apache.cxf.jaxws.interceptors.WebFaultOutInterceptor; import org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor; -import org.apache.cxf.service.factory.ReflectionServiceFactoryBean; import org.apache.cxf.service.factory.ServiceConstructionException; import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.service.model.FaultInfo; @@ -48,7 +48,7 @@ import org.apache.cxf.service.model.OperationInfo; import org.apache.cxf.wsdl11.WSDLServiceBuilder; -public class JaxWsServiceFactoryBean extends ReflectionServiceFactoryBean { +public class JaxWsServiceFactoryBean extends AbstractJaxWsServiceFactoryBean { public static final String MODE_OUT = "messagepart.mode.out"; @@ -60,23 +60,22 @@ private JaxWsServiceConfiguration jaxWsConfiguration; - private JaxWsImplementorInfo jaxWsImplementorInfo; - public JaxWsServiceFactoryBean() { jaxWsConfiguration = new JaxWsServiceConfiguration(); getServiceConfigurations().add(0, jaxWsConfiguration); + getIgnoredClasses().add(Service.class.getName()); } public JaxWsServiceFactoryBean(JaxWsImplementorInfo implInfo) { this(); - this.jaxWsImplementorInfo = implInfo; + setJaxWsImplementorInfo(implInfo); this.serviceClass = implInfo.getImplementorClass(); } @Override public void setServiceClass(Class<?> serviceClass) { - if (jaxWsImplementorInfo == null) { - jaxWsImplementorInfo = new JaxWsImplementorInfo(serviceClass); + if (getJaxWsImplementorInfo() == null) { + setJaxWsImplementorInfo(new JaxWsImplementorInfo(serviceClass)); } super.setServiceClass(serviceClass); @@ -145,7 +144,7 @@ @Override protected void initializeDataBindings() { try { - dataBinding = new JAXBDataBinding(jaxWsConfiguration.getEndpointClass()); + dataBinding = new JAXBDataBinding(getJaxWsImplementorInfo().getEndpointClass()); } catch (JAXBException e) { throw new ServiceConstructionException(e); } @@ -293,14 +292,6 @@ throw new RuntimeException("Expected Holder at " + idx + " parametor of input message"); } - } - - public JaxWsImplementorInfo getJaxWsImplementorInfo() { - return jaxWsImplementorInfo; - } - - public void setJaxWsImplementorInfo(JaxWsImplementorInfo jaxWsImplementorInfo) { - this.jaxWsImplementorInfo = jaxWsImplementorInfo; } public void setJaxWsConfiguration(JaxWsServiceConfiguration jaxWsConfiguration) { Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ProviderServiceFactoryBean.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ProviderServiceFactoryBean.java?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ProviderServiceFactoryBean.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ProviderServiceFactoryBean.java Sun Oct 22 21:44:24 2006 @@ -31,7 +31,6 @@ import org.apache.cxf.endpoint.EndpointException; import org.apache.cxf.jaxb.JAXBDataBinding; import org.apache.cxf.service.Service; -import org.apache.cxf.service.factory.ReflectionServiceFactoryBean; import org.apache.cxf.service.factory.ServiceConstructionException; import org.apache.cxf.service.model.BindingInfo; import org.apache.cxf.service.model.BindingOperationInfo; @@ -41,13 +40,12 @@ import org.apache.cxf.service.model.OperationInfo; import org.apache.cxf.service.model.ServiceInfo; -public class ProviderServiceFactoryBean extends ReflectionServiceFactoryBean { +public class ProviderServiceFactoryBean extends AbstractJaxWsServiceFactoryBean { - private JaxWsImplementorInfo jaxWsImplmentorInfo; private String bindingURI; public ProviderServiceFactoryBean(JaxWsImplementorInfo implInfo) { - this.jaxWsImplmentorInfo = implInfo; + setJaxWsImplementorInfo(implInfo); this.bindingURI = implInfo.getBindingType(); getServiceConfigurations().add(0, new WebServiceProviderConfiguration()); setServiceClass(implInfo.getImplementorClass()); @@ -113,7 +111,7 @@ public Service create() { Service s = super.create(); - if (jaxWsImplmentorInfo.getWsdlLocation().length() == 0) { + if (getJaxWsImplementorInfo().getWsdlLocation().length() == 0) { initializeBindings(); } @@ -159,9 +157,5 @@ public void setBindingURI(String bindingURI) { this.bindingURI = bindingURI; - } - - public JaxWsImplementorInfo getJaxWsImplmentorInfo() { - return jaxWsImplmentorInfo; } } Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/WebServiceProviderConfiguration.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/WebServiceProviderConfiguration.java?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/WebServiceProviderConfiguration.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/WebServiceProviderConfiguration.java Sun Oct 22 21:44:24 2006 @@ -43,7 +43,7 @@ @Override public void setServiceFactory(ReflectionServiceFactoryBean serviceFactory) { super.setServiceFactory(serviceFactory); - implInfo = ((ProviderServiceFactoryBean) serviceFactory).getJaxWsImplmentorInfo(); + implInfo = ((ProviderServiceFactoryBean) serviceFactory).getJaxWsImplementorInfo(); wsProvider = implInfo.getWsProvider(); } Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/META-INF/cxf/cxf-extension.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/META-INF/cxf/cxf-extension.xml?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/META-INF/cxf/cxf-extension.xml (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/META-INF/cxf/cxf-extension.xml Sun Oct 22 21:44:24 2006 @@ -25,7 +25,7 @@ <bean class="org.apache.cxf.jaxws.servlet.ServletTransportFactory" lazy-init="true"> <property name="bus" ref="cxf"/> - <property name="activationNamespaces"> + <property name="transportIds"> <set> <value>http://schemas.xmlsoap.org/wsdl/servlet</value> </set> Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original) +++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Sun Oct 22 21:44:24 2006 @@ -40,7 +40,6 @@ import org.apache.cxf.endpoint.Endpoint; import org.apache.cxf.endpoint.EndpointException; import org.apache.cxf.endpoint.EndpointImpl; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.helpers.MethodComparator; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.service.Service; @@ -60,6 +59,14 @@ import org.apache.cxf.service.model.TypeInfo; import org.apache.cxf.service.model.UnwrappedOperationInfo; import org.apache.cxf.wsdl11.WSDLServiceFactory; +import org.apache.ws.commons.schema.XmlSchema; +import org.apache.ws.commons.schema.XmlSchemaCollection; +import org.apache.ws.commons.schema.XmlSchemaComplexType; +import org.apache.ws.commons.schema.XmlSchemaElement; +import org.apache.ws.commons.schema.XmlSchemaSequence; +import org.apache.ws.commons.schema.XmlSchemaSerializer; +import org.apache.ws.commons.schema.XmlSchemaSerializer.XmlSchemaSerializerException; +import org.apache.ws.commons.schema.utils.NamespaceMap; /** * Introspects a class and builds a [EMAIL PROTECTED] Service} from it. If a WSDL URL is specified, @@ -71,7 +78,6 @@ private static final Logger LOG = Logger.getLogger(ReflectionServiceFactoryBean.class.getName()); private static final ResourceBundle BUNDLE = BundleUtils.getBundle(ReflectionServiceFactoryBean.class); - private static final String XSD_NS = "http://www.w3.org/2001/XMLSchema"; protected URL wsdlURL; @@ -311,18 +317,19 @@ } protected void initializeWrappedSchema(ServiceInfo serviceInfo) { - Document d = DOMUtils.createDocument(); + XmlSchemaCollection col = new XmlSchemaCollection(); + XmlSchema schema = new XmlSchema(getServiceNamespace(), col); - Element schema = d.createElementNS(XSD_NS, "xsd:schema"); - d.appendChild(schema); - schema.setAttribute("targetNamespace", getServiceNamespace()); + NamespaceMap nsMap = new NamespaceMap(); + nsMap.add("xsd", "http://www.w3.org/2001/XMLSchema"); + schema.setNamespaceContext(nsMap); for (OperationInfo op : serviceInfo.getInterface().getOperations()) { if (op.hasInput()) { - createWrappedMessage(op.getInput(), op.getUnwrappedOperation().getInput(), d, schema); + createWrappedMessage(op.getInput(), op.getUnwrappedOperation().getInput(), schema); } if (op.hasOutput()) { - createWrappedMessage(op.getOutput(), op.getUnwrappedOperation().getOutput(), d, schema); + createWrappedMessage(op.getOutput(), op.getUnwrappedOperation().getOutput(), schema); } } @@ -332,48 +339,47 @@ serviceInfo.setTypeInfo(typeInfo); } + Document[] docs; + try { + docs = XmlSchemaSerializer.serializeSchema(schema, false); + } catch (XmlSchemaSerializerException e1) { + throw new ServiceConstructionException(e1); + } + Element e = docs[0].getDocumentElement(); SchemaInfo schemaInfo = new SchemaInfo(typeInfo, getServiceNamespace()); - schemaInfo.setElement(schema); + schemaInfo.setElement(e); typeInfo.addSchema(schemaInfo); } private void createWrappedMessage(MessageInfo wrappedMessage, MessageInfo unwrappedMessage, - Document d, - Element schema) { - Element el = d.createElementNS(XSD_NS, "xsd:element"); - el.setAttribute("name", wrappedMessage.getName().getLocalPart()); - schema.appendChild(el); + XmlSchema schema) { + XmlSchemaElement el = new XmlSchemaElement(); + el.setQName(wrappedMessage.getName()); + el.setName(wrappedMessage.getName().getLocalPart()); + schema.getItems().add(el); - Element ct = d.createElementNS(XSD_NS, "xsd:complexType"); - el.appendChild(ct); + wrappedMessage.getMessageParts().get(0).setXmlSchema(el); - Element seq = d.createElementNS(XSD_NS, "xsd:sequence"); - ct.appendChild(seq); + XmlSchemaComplexType ct = new XmlSchemaComplexType(schema); + el.setSchemaType(ct); + XmlSchemaSequence seq = new XmlSchemaSequence(); + ct.setParticle(seq); for (MessagePartInfo mpi : unwrappedMessage.getMessageParts()) { - el = d.createElementNS(XSD_NS, "xsd:element"); - el.setAttribute("name", mpi.getName().getLocalPart()); - el.setAttribute("minOccurs", "1"); - el.setAttribute("maxOccurs", "1"); + el = new XmlSchemaElement(); + el.setName(mpi.getName().getLocalPart()); + el.setQName(mpi.getName()); + el.setMinOccurs(1); + el.setMaxOccurs(1); if (mpi.isElement()) { - String ns = mpi.getElementQName().getNamespaceURI(); - String prefix = DOMUtils.getPrefixRecursive(el, ns); - if (prefix == null) { - prefix = DOMUtils.createNamespace(schema, ns); - } - el.setAttribute("ref", prefix + ":" + mpi.getElementQName().getLocalPart()); + el.setRefName(mpi.getElementQName()); } else { - String ns = mpi.getTypeQName().getNamespaceURI(); - String prefix = DOMUtils.getPrefixRecursive(el, ns); - if (prefix == null) { - prefix = DOMUtils.createNamespace(schema, ns); - } - el.setAttribute("type", prefix + ":" + mpi.getTypeQName().getLocalPart()); + el.setSchemaTypeName(mpi.getTypeQName()); } - seq.appendChild(el); + seq.getItems().add(el); } } Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ServerFactoryBean.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ServerFactoryBean.java?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ServerFactoryBean.java (original) +++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ServerFactoryBean.java Sun Oct 22 21:44:24 2006 @@ -30,7 +30,6 @@ import org.apache.cxf.endpoint.Server; import org.apache.cxf.endpoint.ServerImpl; import org.apache.cxf.service.Service; -import org.apache.cxf.service.model.AbstractBindingInfoFactoryBean; import org.apache.cxf.service.model.BindingInfo; import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.transport.ChainInitiationObserver; @@ -101,7 +100,7 @@ destinationFactory = dfm.getDestinationFactory(transportId); // Get the Service from the ServiceFactory if specified - bindingFactory.setService(serviceFactory.getService()); + bindingFactory.setServiceFactory(serviceFactory); BindingInfo bindingInfo = bindingFactory.create(); service.getServiceInfo().addBinding(bindingInfo); Modified: incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java (original) +++ incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java Sun Oct 22 21:44:24 2006 @@ -122,6 +122,7 @@ List<MessagePartInfo> messageParts = sayHelloOp.getInput().getMessageParts(); assertEquals(1, messageParts.size()); + assertNotNull(messageParts.get(0).getXmlSchema()); // test unwrapping assertTrue(sayHelloOp.isUnwrappedCapable()); Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java (original) +++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java Sun Oct 22 21:44:24 2006 @@ -21,8 +21,10 @@ import java.io.IOException; import java.util.Collection; +import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Set; import javax.annotation.PostConstruct; import javax.annotation.Resource; @@ -35,6 +37,7 @@ import org.apache.cxf.service.model.BindingInfo; import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.service.model.ServiceInfo; +import org.apache.cxf.transport.AbstractTransportFactory; import org.apache.cxf.transport.Conduit; import org.apache.cxf.transport.ConduitInitiator; import org.apache.cxf.transport.ConduitInitiatorManager; @@ -45,26 +48,32 @@ import org.apache.cxf.wsdl11.WSDLEndpointFactory; import org.xmlsoap.schemas.wsdl.http.AddressType; +public class HTTPTransportFactory extends AbstractTransportFactory implements ConduitInitiator, + DestinationFactory, WSDLEndpointFactory { + + private static final Set<String> URI_PREFIXES = new HashSet<String>(); + static { + URI_PREFIXES.add("http://"); + URI_PREFIXES.add("https://"); + } -public class HTTPTransportFactory implements ConduitInitiator, DestinationFactory, WSDLEndpointFactory { - private Bus bus; private Collection<String> activationNamespaces; - + @Resource public void setBus(Bus b) { bus = b; } - + public Bus getBus() { return bus; } - + @Resource public void setActivationNamespaces(Collection<String> ans) { activationNamespaces = ans; } - + @PostConstruct void registerWithBindingManager() { if (null == bus) { @@ -84,30 +93,27 @@ } } - public Conduit getConduit(EndpointInfo endpointInfo) - throws IOException { + public Conduit getConduit(EndpointInfo endpointInfo) throws IOException { return getConduit(endpointInfo, null); } - public Conduit getConduit(EndpointInfo endpointInfo, EndpointReferenceType target) - throws IOException { - HTTPConduit conduit = - target == null ? new HTTPConduit(bus, endpointInfo) : new HTTPConduit(bus, endpointInfo, target); + public Conduit getConduit(EndpointInfo endpointInfo, EndpointReferenceType target) throws IOException { + HTTPConduit conduit = target == null + ? new HTTPConduit(bus, endpointInfo) : new HTTPConduit(bus, endpointInfo, target); Configurer configurer = bus.getExtension(Configurer.class); if (null != configurer) { configurer.configureBean(conduit); } - return conduit; + return conduit; } - public Destination getDestination(EndpointInfo endpointInfo) - throws IOException { + public Destination getDestination(EndpointInfo endpointInfo) throws IOException { JettyHTTPDestination destination = new JettyHTTPDestination(bus, this, endpointInfo); Configurer configurer = bus.getExtension(Configurer.class); if (null != configurer) { configurer.configureBean(destination); } - return destination; + return destination; } public EndpointInfo createEndpointInfo(ServiceInfo serviceInfo, BindingInfo b, Port port) { @@ -135,5 +141,9 @@ public void createPortExtensors(EndpointInfo ei, Service service) { // TODO + } + + public Set<String> getUriPrefixes() { + return URI_PREFIXES; } } Modified: incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension.xml?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension.xml (original) +++ incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension.xml Sun Oct 22 21:44:24 2006 @@ -25,15 +25,15 @@ <bean class="org.apache.cxf.transport.http.HTTPTransportFactory" lazy-init="true"> <property name="bus" ref="cxf"/> - <property name="activationNamespaces"> - <set> + <property name="transportIds"> + <list> + <value>http://schemas.xmlsoap.org/wsdl/http/</value> <value>http://schemas.xmlsoap.org/soap/http</value> <value>http://schemas.xmlsoap.org/wsdl/soap/http</value> <value>http://www.w3.org/2003/05/soap/bindings/HTTP/</value> - <value>http://schemas.xmlsoap.org/wsdl/http/</value> <value>http://cxf.apache.org/transports/http/configuration</value> <value>http://cxf.apache.org/bindings/xformat</value> - </set> + </list> </property> </bean> </beans> Propchange: incubator/cxf/trunk/rt/transports/jms/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Sun Oct 22 21:44:24 2006 @@ -0,0 +1,2 @@ + +target Modified: incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportFactory.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportFactory.java?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportFactory.java (original) +++ incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportFactory.java Sun Oct 22 21:44:24 2006 @@ -20,26 +20,30 @@ package org.apache.cxf.transport.jms; import java.io.IOException; -import java.util.Collection; +import java.util.HashSet; +import java.util.Set; -import javax.annotation.PostConstruct; import javax.annotation.Resource; import org.apache.cxf.Bus; import org.apache.cxf.configuration.Configurer; import org.apache.cxf.service.model.EndpointInfo; +import org.apache.cxf.transport.AbstractTransportFactory; import org.apache.cxf.transport.Conduit; import org.apache.cxf.transport.ConduitInitiator; -import org.apache.cxf.transport.ConduitInitiatorManager; import org.apache.cxf.transport.Destination; import org.apache.cxf.transport.DestinationFactory; -import org.apache.cxf.transport.DestinationFactoryManager; import org.apache.cxf.ws.addressing.EndpointReferenceType; -public class JMSTransportFactory implements ConduitInitiator, DestinationFactory { +public class JMSTransportFactory extends AbstractTransportFactory + implements ConduitInitiator, DestinationFactory { + private static final Set<String> URI_PREFIXES = new HashSet<String>(); + static { + URI_PREFIXES.add("jms://"); + } + private Bus bus; - private Collection<String> activationNamespaces; @Resource public void setBus(Bus b) { @@ -49,24 +53,7 @@ public Bus getBus() { return bus; } - - @Resource - public void setActivationNamespaces(Collection<String> ans) { - activationNamespaces = ans; - } - @PostConstruct - void register() { - ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class); - for (String ns : activationNamespaces) { - cim.registerConduitInitiator(ns, this); - } - DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class); - for (String ns : activationNamespaces) { - dfm.registerDestinationFactory(ns, this); - } - } - public Conduit getConduit(EndpointInfo targetInfo) throws IOException { return getConduit(targetInfo, null); } @@ -89,5 +76,8 @@ } return destination; } - + + public Set<String> getUriPrefixes() { + return URI_PREFIXES; + } } Modified: incubator/cxf/trunk/rt/transports/jms/src/main/resources/META-INF/cxf/cxf-extension.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jms/src/main/resources/META-INF/cxf/cxf-extension.xml?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/transports/jms/src/main/resources/META-INF/cxf/cxf-extension.xml (original) +++ incubator/cxf/trunk/rt/transports/jms/src/main/resources/META-INF/cxf/cxf-extension.xml Sun Oct 22 21:44:24 2006 @@ -25,11 +25,11 @@ <bean class="org.apache.cxf.transport.jms.JMSTransportFactory" lazy-init="true"> <property name="bus" ref="cxf"/> - <property name="activationNamespaces"> - <set> + <property name="transportIds"> + <list> <value>http://cxf.apache.org/transports/jms</value> <value>http://cxf.apache.org/transports/jms/configuration</value> - </set> + </list> </property> </bean> </beans> Modified: incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalTransportFactory.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalTransportFactory.java?view=diff&rev=466932&r1=466931&r2=466932 ============================================================================== --- incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalTransportFactory.java (original) +++ incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalTransportFactory.java Sun Oct 22 21:44:24 2006 @@ -20,11 +20,16 @@ package org.apache.cxf.transport.local; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; +import java.util.List; import java.util.Map; +import java.util.Set; import java.util.logging.Logger; import org.apache.cxf.service.model.EndpointInfo; +import org.apache.cxf.transport.AbstractTransportFactory; import org.apache.cxf.transport.Conduit; import org.apache.cxf.transport.ConduitInitiator; import org.apache.cxf.transport.Destination; @@ -32,15 +37,27 @@ import org.apache.cxf.ws.addressing.AttributedURIType; import org.apache.cxf.ws.addressing.EndpointReferenceType; -public class LocalTransportFactory implements DestinationFactory, ConduitInitiator { +public class LocalTransportFactory extends AbstractTransportFactory + implements DestinationFactory, ConduitInitiator { public static final String TRANSPORT_ID = "http://cxf.apache.org/local-transport"; private static final Logger LOG = Logger.getLogger(LocalTransportFactory.class.getName()); + private static final Set<String> URI_PREFIXES = new HashSet<String>(); + static { + URI_PREFIXES.add("local://"); + } private Map<String, Destination> destinations = new HashMap<String, Destination>(); + public LocalTransportFactory() { + super(); + List<String> ids = new ArrayList<String>(); + ids.add(TRANSPORT_ID); + setTransportIds(ids); + } + public Destination getDestination(EndpointInfo ei) throws IOException { return getDestination(createReference(ei)); } @@ -77,6 +94,10 @@ address.setValue(ei.getAddress()); epr.setAddress(address); return epr; + } + + public Set<String> getUriPrefixes() { + return URI_PREFIXES; } }
