Spring Web Services Framework

org.springframework.ws.server.endpoint.adapter
Class GenericMarshallingMethodEndpointAdapter

java.lang.Object
  extended by org.springframework.xml.transform.TransformerObjectSupport
      extended by org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter
          extended by org.springframework.ws.server.endpoint.adapter.MarshallingMethodEndpointAdapter
              extended by org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter
All Implemented Interfaces:
InitializingBean, EndpointAdapter

public class GenericMarshallingMethodEndpointAdapter
extends MarshallingMethodEndpointAdapter

Subclass of MarshallingMethodEndpointAdapter that supports GenericMarshaller and GenericUnmarshaller. More specifically, this adapter is aware of the Method.getGenericParameterTypes() and Method.getGenericReturnType().

Prefer to use this adapter rather than the plain MarshallingMethodEndpointAdapter in combination with Java 5 marshallers, such as the Jaxb2Marshaller.

Since:
1.0.2
Author:
Arjen Poutsma

Field Summary
 
Fields inherited from class org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter
logger
 
Constructor Summary
GenericMarshallingMethodEndpointAdapter()
          Creates a new GenericMarshallingMethodEndpointAdapter.
GenericMarshallingMethodEndpointAdapter(Marshaller marshaller)
          Creates a new GenericMarshallingMethodEndpointAdapter with the given marshaller.
GenericMarshallingMethodEndpointAdapter(Marshaller marshaller, Unmarshaller unmarshaller)
          Creates a new GenericMarshallingMethodEndpointAdapter with the given marshaller and unmarshaller.
 
Method Summary
protected  boolean supportsInternal(MethodEndpoint methodEndpoint)
          Supports a method with a single, unmarshallable parameter, and that return void or a marshallable type.
 
Methods inherited from class org.springframework.ws.server.endpoint.adapter.MarshallingMethodEndpointAdapter
afterPropertiesSet, getMarshaller, getUnmarshaller, invokeInternal, setMarshaller, setUnmarshaller
 
Methods inherited from class org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter
invoke, supports
 
Methods inherited from class org.springframework.xml.transform.TransformerObjectSupport
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericMarshallingMethodEndpointAdapter

public GenericMarshallingMethodEndpointAdapter()
Creates a new GenericMarshallingMethodEndpointAdapter. The Marshaller and Unmarshaller must be injected using properties.

See Also:
MarshallingMethodEndpointAdapter.setMarshaller(org.springframework.oxm.Marshaller), MarshallingMethodEndpointAdapter.setUnmarshaller(org.springframework.oxm.Unmarshaller)

GenericMarshallingMethodEndpointAdapter

public GenericMarshallingMethodEndpointAdapter(Marshaller marshaller)
Creates a new GenericMarshallingMethodEndpointAdapter with the given marshaller. If the given Marshaller also implements the Unmarshaller interface, it is used for both marshalling and unmarshalling. Otherwise, an exception is thrown.

Note that all Marshaller implementations in Spring-WS also implement the Unmarshaller interface, so that you can safely use this constructor.

Parameters:
marshaller - object used as marshaller and unmarshaller
Throws:
IllegalArgumentException - when marshaller does not implement the Unmarshaller interface

GenericMarshallingMethodEndpointAdapter

public GenericMarshallingMethodEndpointAdapter(Marshaller marshaller,
                                               Unmarshaller unmarshaller)
Creates a new GenericMarshallingMethodEndpointAdapter with the given marshaller and unmarshaller.

Parameters:
marshaller - the marshaller to use
unmarshaller - the unmarshaller to use
Method Detail

supportsInternal

protected boolean supportsInternal(MethodEndpoint methodEndpoint)
Description copied from class: MarshallingMethodEndpointAdapter
Supports a method with a single, unmarshallable parameter, and that return void or a marshallable type.

Overrides:
supportsInternal in class MarshallingMethodEndpointAdapter
Parameters:
methodEndpoint - method endpoint to check
Returns:
whether or not this adapter can adapt the given method
See Also:
Marshaller.supports(Class), Unmarshaller.supports(Class)

Spring Web Services Framework

Copyright © 2005-2010 The Spring Web Services Framework. All Rights Reserved.