Author: richard.opalka(a)jboss.com
Date: 2012-11-13 03:08:00 -0500 (Tue, 13 Nov 2012)
New Revision: 16967
Added:
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/AbstractServiceObjectFactoryJAXWS.java
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryFactoryImpl.java
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryImpl.java
Removed:
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderFactoryImpl.java
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXWS.java
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceReferenceableJAXWS.java
stack/cxf/branches/ropalka/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory
Modified:
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java
stack/cxf/branches/ropalka/pom.xml
Log:
[JBWS-3565] WS Ref SPI clean up
Added:
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/AbstractServiceObjectFactoryJAXWS.java
===================================================================
---
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/AbstractServiceObjectFactoryJAXWS.java
(rev 0)
+++
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/AbstractServiceObjectFactoryJAXWS.java 2012-11-13
08:08:00 UTC (rev 16967)
@@ -0,0 +1,454 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf.client.serviceref;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.RespectBindingFeature;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.soap.MTOMFeature;
+
+import org.jboss.ws.common.Messages;
+import org.jboss.wsf.spi.WSFException;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+
+/**
+ * This ServiceObjectFactory reconstructs a javax.xml.ws.Service
+ * for a given WSDL when the webservice client does a JNDI lookup.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public abstract class AbstractServiceObjectFactoryJAXWS
+{
+ public final Object getObjectInstance(UnifiedServiceRefMetaData serviceRef)
+ {
+ try
+ {
+ // class names
+ final String serviceImplClass = this.getServiceClassName(serviceRef);
+ final String targetClassName = this.getTargetClassName(serviceRef);
+ // class instances
+ final Class<?> serviceClass = this.getClass(serviceImplClass);
+ final Class<?> targetClass = this.getClass(targetClassName);
+ final Service serviceInstance;
+
+ this.init(serviceRef);
+ try
+ {
+ serviceInstance = this.instantiateService(serviceRef, serviceClass);
+ this.configure(serviceRef, serviceInstance);
+
+ // construct port
+ final boolean instantiatePort = targetClassName != null &&
!Service.class.isAssignableFrom(targetClass);
+ if (instantiatePort)
+ {
+ final QName portQName = this.getPortQName(targetClassName,
serviceImplClass, serviceRef);
+ final WebServiceFeature[] portFeatures = this.getFeatures(targetClassName,
serviceImplClass, serviceRef);
+
+ return instantiatePort(serviceClass, targetClass, serviceInstance,
portQName, portFeatures);
+ }
+ }
+ finally
+ {
+ this.destroy(serviceRef);
+ }
+
+ return serviceInstance;
+ }
+ catch (Exception ex)
+ {
+ WSFException.rethrow("Cannot create service", ex);
+ }
+
+ return null;
+ }
+
+ /**
+ * Lifecycle template method called before javax.xml.ws.Service object instantiation.
+ *
+ * @param serviceRefUMDM service reference meta data
+ */
+ protected abstract void init(final UnifiedServiceRefMetaData serviceRefUMDM);
+
+ /**
+ * Lifecycle template method called after javax.xml.ws.Service object was created
+ * and before port is instantiated. It allows stack to configure service before
+ * creating ports.
+ *
+ * @param serviceRefUMDM service reference meta data
+ * @param service service instance
+ */
+ protected abstract void configure(final UnifiedServiceRefMetaData serviceRefUMDM,
final Service service);
+
+ /**
+ * Lifecycle template method called after javax.xml.ws.Service object and after port
instantiation.
+ *
+ * @param serviceRefUMDM
+ */
+ protected abstract void destroy(final UnifiedServiceRefMetaData serviceRefUMDM);
+
+ private Class<?> getClass(final String className) throws ClassNotFoundException
+ {
+ if (className != null)
+ {
+ return Thread.currentThread().getContextClassLoader().loadClass(className);
+ }
+
+ return null;
+ }
+
+ private String getServiceClassName(final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ final String serviceImplClassName = serviceRefMD.getServiceImplClass();
+ if (serviceImplClassName != null)
+ return serviceImplClassName;
+
+ final String serviceInterfaceName = serviceRefMD.getServiceInterface();
+ if (serviceInterfaceName != null)
+ return serviceInterfaceName;
+
+ return Service.class.getName(); // fallback
+ }
+
+ private String getTargetClassName(final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ return serviceRefMD.getServiceRefType();
+ }
+
+ private Object instantiatePort(final Class<?> serviceClass, final Class<?>
targetClass, final Service target,
+ final QName portQName, final WebServiceFeature[] features) throws
NoSuchMethodException,
+ InstantiationException, IllegalAccessException, InvocationTargetException
+ {
+ Object retVal = null;
+
+ Object port = null;
+ if (serviceClass != Service.class)
+ {
+ for (Method method : serviceClass.getDeclaredMethods())
+ {
+ String methodName = method.getName();
+ Class<?> retType = method.getReturnType();
+ if (methodName.startsWith("get") &&
targetClass.isAssignableFrom(retType))
+ {
+ final Method targetMethod = getMethodFor(methodName, features,
serviceClass);
+ final Object[] args = getArgumentsFor(features);
+ port = targetMethod.invoke(target, args);
+ retVal = port;
+ break;
+ }
+ }
+ }
+
+ if (port == null)
+ {
+ Method method = getMethodFor("getPort", portQName, features,
serviceClass);
+ Object[] args = getArgumentsFor(portQName, features, targetClass);
+ port = method.invoke(target, args);
+ retVal = port;
+ }
+
+ return retVal;
+ }
+
+ private Service instantiateService(final UnifiedServiceRefMetaData serviceRefMD, final
Class<?> serviceClass)
+ throws NoSuchMethodException, InstantiationException, IllegalAccessException,
InvocationTargetException
+ {
+ final WebServiceFeature[] features = getFeatures(serviceRefMD);
+ final URL wsdlURL = this.getWsdlURL(serviceRefMD, serviceClass);
+ final QName serviceQName = this.getServiceQName(serviceRefMD, serviceClass);
+
+ Service target = null;
+ if (serviceClass == Service.class)
+ {
+ // Generic javax.xml.ws.Service
+ if (wsdlURL != null)
+ {
+ if (features != null)
+ {
+ target = Service.create(wsdlURL, serviceQName, features);
+ }
+ else
+ {
+ target = Service.create(wsdlURL, serviceQName);
+ }
+ }
+ else
+ {
+ throw
Messages.MESSAGES.cannotCreateServiceWithoutWsdlLocation(serviceRefMD);
+ }
+ }
+ else
+ {
+ // Generated javax.xml.ws.Service subclass
+ if (wsdlURL != null)
+ {
+ if (features != null)
+ {
+ Constructor<?> ctor = serviceClass.getConstructor(new Class[]
+ {URL.class, QName.class, WebServiceFeature[].class});
+ target = (Service) ctor.newInstance(new Object[]
+ {wsdlURL, serviceQName, features});
+ }
+ else
+ {
+ Constructor<?> ctor = serviceClass.getConstructor(new Class[]
+ {URL.class, QName.class});
+ target = (Service) ctor.newInstance(new Object[]
+ {wsdlURL, serviceQName});
+ }
+ }
+ else
+ {
+ if (features != null)
+ {
+ Constructor<?> ctor = serviceClass.getConstructor(new Class[]
+ {WebServiceFeature[].class});
+ target = (Service) ctor.newInstance(new Object[]
+ {features});
+ }
+ else
+ {
+ target = (Service) serviceClass.newInstance();
+ }
+ }
+ }
+
+ return target;
+ }
+
+ private URL getWsdlURL(final UnifiedServiceRefMetaData serviceRefMD, final
Class<?> serviceClass)
+ {
+ if (serviceRefMD.getWsdlLocation() == null)
+ {
+ final WebServiceClient webServiceClientAnnotation =
serviceClass.getAnnotation(WebServiceClient.class);
+ if (webServiceClientAnnotation != null)
+ {
+ // use the @WebServiceClien(wsdlLocation=...) if the service ref wsdl
location returned at this time would be null
+ if (webServiceClientAnnotation.wsdlLocation().length() > 0)
+ {
+ serviceRefMD.setWsdlOverride(webServiceClientAnnotation.wsdlLocation());
+ }
+ }
+ }
+
+ return serviceRefMD.getWsdlLocation();
+ }
+
+ private QName getServiceQName(final UnifiedServiceRefMetaData serviceRefMD, final
Class<?> serviceClass)
+ {
+ QName retVal = serviceRefMD.getServiceQName();
+
+ if (retVal == null)
+ {
+ final WebServiceClient webServiceClientAnnotation =
serviceClass.getAnnotation(WebServiceClient.class);
+ if (webServiceClientAnnotation != null)
+ {
+ retVal = new QName(webServiceClientAnnotation.targetNamespace(),
webServiceClientAnnotation.name());
+ }
+ }
+
+ return retVal;
+ }
+
+ private WebServiceFeature[] getFeatures(final String targetClassName, final String
serviceClassName,
+ final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ if (targetClassName != null && !targetClassName.equals(serviceClassName))
+ {
+ final Collection<UnifiedPortComponentRefMetaData> portComponentRefs =
serviceRefMD.getPortComponentRefs();
+ for (final UnifiedPortComponentRefMetaData portComponentRefMD :
portComponentRefs)
+ {
+ if
(targetClassName.equals(portComponentRefMD.getServiceEndpointInterface()))
+ {
+ return getFeatures(portComponentRefMD);
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private QName getPortQName(final String targetClassName, final String
serviceClassName,
+ final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ if (targetClassName != null && !targetClassName.equals(serviceClassName))
+ {
+ final Collection<UnifiedPortComponentRefMetaData> portComponentRefs =
serviceRefMD.getPortComponentRefs();
+ for (final UnifiedPortComponentRefMetaData portComponentRefMD :
portComponentRefs)
+ {
+ if
(targetClassName.equals(portComponentRefMD.getServiceEndpointInterface()))
+ {
+ return portComponentRefMD.getPortQName();
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private Method getMethodFor(final String methodName, final QName portQName, final
WebServiceFeature[] features, final Class<?> serviceClass)
+ throws NoSuchMethodException
+ {
+ if ((portQName == null) && (features == null))
+ return serviceClass.getMethod(methodName, new Class[]
+ {Class.class});
+ if ((portQName != null) && (features == null))
+ return serviceClass.getMethod(methodName, new Class[]
+ {QName.class, Class.class});
+ if ((portQName == null) && (features != null))
+ return serviceClass.getMethod(methodName, new Class[]
+ {Class.class, WebServiceFeature[].class});
+ if ((portQName != null) && (features != null))
+ return serviceClass.getMethod(methodName, new Class[]
+ {QName.class, Class.class, WebServiceFeature[].class});
+
+ throw new IllegalStateException();
+ }
+
+ private Method getMethodFor(final String methodName, final WebServiceFeature[]
features, final Class<?> serviceClass)
+ throws NoSuchMethodException
+ {
+ if (features == null)
+ {
+ return serviceClass.getMethod(methodName, new Class[] {});
+ }
+ else
+ {
+ return serviceClass.getMethod(methodName, new Class[] {
WebServiceFeature[].class } );
+ }
+ }
+
+ private Object[] getArgumentsFor(final QName portQName, final WebServiceFeature[]
features,
+ final Class<?> targetClass) throws NoSuchMethodException
+ {
+ if ((portQName == null) && (features == null))
+ return new Object[]
+ {targetClass};
+ if ((portQName != null) && (features == null))
+ return new Object[]
+ {portQName, targetClass};
+ if ((portQName == null) && (features != null))
+ return new Object[]
+ {targetClass, features};
+ if ((portQName != null) && (features != null))
+ return new Object[]
+ {portQName, targetClass, features};
+
+ throw new IllegalStateException();
+ }
+
+ private Object[] getArgumentsFor(final WebServiceFeature[] features) throws
NoSuchMethodException
+ {
+ if (features == null)
+ {
+ return new Object[] {};
+ }
+ else
+ {
+ return new Object[] {features};
+ }
+ }
+
+ private WebServiceFeature[] getFeatures(final UnifiedServiceRefMetaData serviceRef)
+ {
+ List<WebServiceFeature> features = new
LinkedList<WebServiceFeature>();
+
+ // configure @Addressing feature
+ if (serviceRef.isAddressingAnnotationSpecified())
+ {
+ final boolean enabled = serviceRef.isAddressingEnabled();
+ final boolean required = serviceRef.isAddressingRequired();
+ final String refResponses = serviceRef.getAddressingResponses();
+ AddressingFeature.Responses responses = AddressingFeature.Responses.ALL;
+ if ("ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.ANONYMOUS;
+ if ("NON_ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.NON_ANONYMOUS;
+
+ features.add(new AddressingFeature(enabled, required, responses));
+ }
+
+ // configure @MTOM feature
+ if (serviceRef.isMtomAnnotationSpecified())
+ {
+ final boolean enabled = serviceRef.isMtomEnabled();
+ final int threshold = serviceRef.getMtomThreshold();
+ features.add(new MTOMFeature(enabled, threshold));
+ }
+
+ // configure @RespectBinding feature
+ if (serviceRef.isRespectBindingAnnotationSpecified())
+ {
+ final boolean enabled = serviceRef.isRespectBindingEnabled();
+ features.add(new RespectBindingFeature(enabled));
+ }
+
+ return features.size() == 0 ? null : features.toArray(new WebServiceFeature[]
+ {});
+ }
+
+ private WebServiceFeature[] getFeatures(final UnifiedPortComponentRefMetaData
portComponentRefMD)
+ {
+ List<WebServiceFeature> features = new
LinkedList<WebServiceFeature>();
+ // configure @Addressing feature
+ if (portComponentRefMD.isAddressingAnnotationSpecified())
+ {
+ final boolean enabled = portComponentRefMD.isAddressingEnabled();
+ final boolean required = portComponentRefMD.isAddressingRequired();
+ final String refResponses = portComponentRefMD.getAddressingResponses();
+ AddressingFeature.Responses responses = AddressingFeature.Responses.ALL;
+ if ("ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.ANONYMOUS;
+ if ("NON_ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.NON_ANONYMOUS;
+
+ features.add(new AddressingFeature(enabled, required, responses));
+ }
+
+ // configure @MTOM feature
+ if (portComponentRefMD.isMtomEnabled())
+ {
+ features.add(new MTOMFeature(true, portComponentRefMD.getMtomThreshold()));
+ }
+
+ // configure @RespectBinding feature
+ if (portComponentRefMD.isRespectBindingAnnotationSpecified())
+ {
+ final boolean enabled = portComponentRefMD.isRespectBindingEnabled();
+ features.add(new RespectBindingFeature(enabled));
+ }
+
+ return features.size() == 0 ? null : features.toArray(new WebServiceFeature[]
+ {});
+ }
+}
Modified:
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java
===================================================================
---
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java 2012-11-13
07:57:12 UTC (rev 16966)
+++
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java 2012-11-13
08:08:00 UTC (rev 16967)
@@ -29,7 +29,6 @@
import org.apache.cxf.BusFactory;
import org.apache.cxf.bus.spring.SpringBusFactory;
import org.apache.cxf.configuration.Configurer;
-import org.jboss.ws.common.serviceref.AbstractServiceObjectFactoryJAXWS;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.wsf.stack.cxf.client.Constants;
Deleted:
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderFactoryImpl.java
===================================================================
---
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderFactoryImpl.java 2012-11-13
07:57:12 UTC (rev 16966)
+++
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderFactoryImpl.java 2012-11-13
08:08:00 UTC (rev 16967)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.wsf.stack.cxf.client.serviceref;
-
-import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
-import org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandler.Type;
-
-/**
- * Binds either JAXRPC or JAXWS Service object in the client's ENC.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class CXFServiceRefBinderFactoryImpl implements ServiceRefBinderFactory
-{
- private static final ServiceRefBinder JAXRPC_BINDER = new
CXFServiceRefBinderJAXRPC();
-
- private static final ServiceRefBinder JAXWS_BINDER = new CXFServiceRefBinderJAXWS();
-
- public ServiceRefBinder newServiceRefBinder(final Type type)
- {
- return type == Type.JAXRPC ? JAXRPC_BINDER : JAXWS_BINDER;
- }
-}
Deleted:
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java
===================================================================
---
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java 2012-11-13
07:57:12 UTC (rev 16966)
+++
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java 2012-11-13
08:08:00 UTC (rev 16967)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.wsf.stack.cxf.client.serviceref;
-
-import javax.naming.Referenceable;
-
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
-import org.jboss.wsf.stack.cxf.Messages;
-
-/**
- * Binds a JAXRPC Service object to the client's ENC.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-final class CXFServiceRefBinderJAXRPC implements ServiceRefBinder
-{
- @Override
- public Referenceable createReferenceable(final UnifiedServiceRefMetaData
serviceRefUMDM)
- {
- throw Messages.MESSAGES.jaxrpcServiceRefNotSupported();
- }
-}
Deleted:
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXWS.java
===================================================================
---
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXWS.java 2012-11-13
07:57:12 UTC (rev 16966)
+++
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXWS.java 2012-11-13
08:08:00 UTC (rev 16967)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.wsf.stack.cxf.client.serviceref;
-
-import javax.naming.Referenceable;
-
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
-
-/**
- * Binds a JAXWS Service object to the client's ENC.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-final class CXFServiceRefBinderJAXWS implements ServiceRefBinder
-{
- @Override
- public Referenceable createReferenceable(final UnifiedServiceRefMetaData
serviceRefUMDM)
- {
- return new CXFServiceReferenceableJAXWS(serviceRefUMDM);
- }
-}
Added:
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryFactoryImpl.java
===================================================================
---
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryFactoryImpl.java
(rev 0)
+++
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryFactoryImpl.java 2012-11-13
08:08:00 UTC (rev 16967)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf.client.serviceref;
+
+import org.jboss.wsf.spi.serviceref.ServiceRefFactory;
+import org.jboss.wsf.spi.serviceref.ServiceRefFactoryFactory;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class CXFServiceRefFactoryFactoryImpl implements ServiceRefFactoryFactory
+{
+ public ServiceRefFactory newServiceRefFactory()
+ {
+ return new CXFServiceRefFactoryImpl();
+ }
+}
Added:
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryImpl.java
===================================================================
---
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryImpl.java
(rev 0)
+++
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryImpl.java 2012-11-13
08:08:00 UTC (rev 16967)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf.client.serviceref;
+
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.wsf.spi.serviceref.ServiceRefFactory;
+import org.jboss.wsf.spi.serviceref.ServiceRefType;
+import org.jboss.wsf.stack.cxf.Messages;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+final class CXFServiceRefFactoryImpl implements ServiceRefFactory
+{
+ @Override
+ public Object newServiceRef(final UnifiedServiceRefMetaData serviceRefUMDM)
+ {
+ if (serviceRefUMDM.getType() == ServiceRefType.JAXWS) {
+ return new CXFServiceObjectFactoryJAXWS().getObjectInstance(serviceRefUMDM);
+ } else {
+ throw Messages.MESSAGES.jaxrpcServiceRefNotSupported();
+ }
+ }
+}
Deleted:
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceReferenceableJAXWS.java
===================================================================
---
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceReferenceableJAXWS.java 2012-11-13
07:57:12 UTC (rev 16966)
+++
stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceReferenceableJAXWS.java 2012-11-13
08:08:00 UTC (rev 16967)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.wsf.stack.cxf.client.serviceref;
-
-import org.jboss.ws.common.serviceref.AbstractServiceReferenceableJAXWS;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-
-/**
- * {@inheritDoc}
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-final class CXFServiceReferenceableJAXWS extends
AbstractServiceReferenceableJAXWS<CXFServiceObjectFactoryJAXWS>
-{
- public CXFServiceReferenceableJAXWS(final UnifiedServiceRefMetaData serviceRefMD)
- {
- super(serviceRefMD);
- }
-
- @Override
- protected Class<CXFServiceObjectFactoryJAXWS> getObjectFactory()
- {
- return CXFServiceObjectFactoryJAXWS.class;
- }
-}
Deleted:
stack/cxf/branches/ropalka/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory
===================================================================
---
stack/cxf/branches/ropalka/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory 2012-11-13
07:57:12 UTC (rev 16966)
+++
stack/cxf/branches/ropalka/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory 2012-11-13
08:08:00 UTC (rev 16967)
@@ -1 +0,0 @@
-org.jboss.wsf.stack.cxf.client.serviceref.CXFServiceRefBinderFactoryImpl
\ No newline at end of file
Modified: stack/cxf/branches/ropalka/pom.xml
===================================================================
--- stack/cxf/branches/ropalka/pom.xml 2012-11-13 07:57:12 UTC (rev 16966)
+++ stack/cxf/branches/ropalka/pom.xml 2012-11-13 08:08:00 UTC (rev 16967)
@@ -60,14 +60,14 @@
<!-- Properties -->
<properties>
<jbossws.api.version>1.0.1.Final</jbossws.api.version>
- <jbossws.spi.version>2.1.0.Final</jbossws.spi.version>
- <jbossws.common.version>2.1.0.Final</jbossws.common.version>
+ <jbossws.spi.version>2.1.1-SNAPSHOT</jbossws.spi.version>
+ <jbossws.common.version>2.1.1-SNAPSHOT</jbossws.common.version>
<jbossws.common.tools.version>1.1.0.Final</jbossws.common.tools.version>
<jbossws.shared.testsuite.version>4.1.1-SNAPSHOT</jbossws.shared.testsuite.version>
<jbossws.jboss711.version>4.1.1-SNAPSHOT</jbossws.jboss711.version>
<jbossws.jboss712.version>4.1.1-SNAPSHOT</jbossws.jboss712.version>
<jbossws.jboss713.version>4.1.1-SNAPSHOT</jbossws.jboss713.version>
- <jbossws.native.version>4.1.0.Final</jbossws.native.version>
+ <jbossws.native.version>4.1.1-SNAPSHOT</jbossws.native.version>
<jboss711.version>7.1.1.Final</jboss711.version>
<jboss712.version>7.1.2.Final</jboss712.version>
<jboss713.version>7.1.3.Final</jboss713.version>