Author: richard.opalka(a)jboss.com
Date: 2010-02-03 06:42:12 -0500 (Wed, 03 Feb 2010)
New Revision: 11533
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
Log:
[JBWS-2914] implementing EndpointReference checks + implementing not implemented methods
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2010-02-03
09:37:55 UTC (rev 11532)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2010-02-03
11:42:12 UTC (rev 11533)
@@ -35,10 +35,12 @@
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.soap.SOAPBinding;
+import javax.xml.ws.spi.Invoker;
import javax.xml.ws.spi.Provider;
import javax.xml.ws.spi.ServiceDelegate;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxws.wsaddressing.EndpointReferenceUtil;
import org.jboss.ws.core.jaxws.wsaddressing.NativeEndpointReference;
import org.jboss.wsf.common.DOMUtils;
@@ -54,17 +56,17 @@
public final class ProviderImpl extends Provider
{
+ private static final Logger log = Logger.getLogger(ProviderImpl.class);
+
public ProviderImpl()
{
}
- @Override
public Endpoint createAndPublishEndpoint(final String address, final Object
implementor)
{
return this.createAndPublishEndpoint(address, implementor,
(WebServiceFeature[])null);
}
- // @Override TODO: comment out override on switch to JAX-WS 2.2
public Endpoint createAndPublishEndpoint(final String address, final Object
implementor, final WebServiceFeature... features)
{
final String bindingId = getBindingFromAddress(address);
@@ -74,13 +76,11 @@
return endpoint;
}
- @Override
public Endpoint createEndpoint(final String bindingId, final Object implementor)
{
return this.createEndpoint(bindingId, implementor, (WebServiceFeature[])null);
}
- // @Override TODO: comment out override on switch to JAX-WS 2.2
public Endpoint createEndpoint(final String bindingId, final Object implementor, final
WebServiceFeature... features)
{
final String nonNullBindingId = this.getBindingId(bindingId,
implementor.getClass());
@@ -88,24 +88,24 @@
return new EndpointImpl(nonNullBindingId, implementor, features);
}
- /* TODO: comment out on switch to JAX-WS 2.2
- @SuppressWarnings("unchecked")
- @Override
- public Endpoint createEndpoint(final String bindingId, final Class implementorClass,
final Invoker invoker,
+ public Endpoint createEndpoint(final String bindingId, final Class<?>
implementorClass, final Invoker invoker,
final WebServiceFeature... features)
{
- throw new UnsupportedOperationException("This method is not portable across
JAX-WS implementations");
+ // JAX-WS Endpoint API is broken by design and reveals many implementation details
+ // of JAX-WS RI that are not portable cross different application servers :(
+ log.warn("createEndpoint(String,Class,Invoker,WebServiceFeature...) not
implemented"); // TODO implement?
+
+ return null;
}
- */
- @Override
- public ServiceDelegate createServiceDelegate(final URL wsdlLocation, final QName
serviceName, final Class serviceClass)
+ /*
+ public ServiceDelegate createServiceDelegate(final URL wsdlLocation, final QName
serviceName, final Class<? extends Service> serviceClass)
{
return this.createServiceDelegate(wsdlLocation, serviceName, serviceClass,
(WebServiceFeature[])null);
}
+ */
- // @Override TODO: comment out override on switch to JAX-WS 2.2
- // TODO - If this createServiceDelegate is removed from a future version the exception
wrapping should be retained.
+ @SuppressWarnings("unchecked")
public ServiceDelegate createServiceDelegate(final URL wsdlLocation, final QName
serviceName, final Class serviceClass,
final WebServiceFeature... features)
{
@@ -121,19 +121,22 @@
}
}
- // @Override TODO: comment out override on switch to JAX-WS 2.2
+ @SuppressWarnings("unchecked")
+ public ServiceDelegate createServiceDelegate(URL wsdlLocation, QName serviceName,
+ Class serviceClass)
+ {
+ return this.createServiceDelegate(wsdlLocation, serviceName, serviceClass,
(WebServiceFeature[])null);
+ }
+
public W3CEndpointReference createW3CEndpointReference(final String address, final
QName interfaceName,
final QName serviceName, final QName portName, final List<Element>
metadata, final String wsdlDocumentLocation,
final List<Element> referenceParameters, final List<Element>
elements, final Map<QName, String> attributes)
{
- throw new UnsupportedOperationException(); // TODO
- }
-
- @Override
- public W3CEndpointReference createW3CEndpointReference(final String address, final
QName serviceName,
- final QName portName, final List<Element> metadata, final String
wsdlDocumentLocation,
- final List<Element> referenceParameters)
- {
+ if ((serviceName == null) && (address == null) && (portName ==
null))
+ throw new IllegalStateException();
+ if ((portName != null) && (serviceName == null))
+ throw new IllegalStateException();
+
final NativeEndpointReference epr = new NativeEndpointReference();
epr.setAddress(address);
epr.setServiceName(serviceName);
@@ -145,7 +148,13 @@
return EndpointReferenceUtil.transform(W3CEndpointReference.class, epr);
}
- @Override
+ public W3CEndpointReference createW3CEndpointReference(final String address, final
QName serviceName,
+ final QName portName, final List<Element> metadata, final String
wsdlDocumentLocation,
+ final List<Element> referenceParameters)
+ {
+ return createW3CEndpointReference(address, null, serviceName, portName, metadata,
wsdlDocumentLocation, referenceParameters, null, null);
+ }
+
public <T> T getPort(final EndpointReference epr, final Class<T> sei,
final WebServiceFeature... features)
{
final NativeEndpointReference nepr =
EndpointReferenceUtil.transform(NativeEndpointReference.class, epr);
@@ -160,7 +169,6 @@
return delegate.getPort(epr, sei, features);
}
- @Override
public EndpointReference readEndpointReference(final Source eprInfoset)
{
if (eprInfoset == null)