Spring Web Services Framework

org.springframework.ws.server.endpoint.mapping
Class SimpleMethodEndpointMapping

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping
          extended by org.springframework.ws.server.endpoint.mapping.AbstractMethodEndpointMapping<String>
              extended by org.springframework.ws.server.endpoint.mapping.SimpleMethodEndpointMapping
All Implemented Interfaces:
Aware, InitializingBean, ApplicationContextAware, Ordered, EndpointMapping

public class SimpleMethodEndpointMapping
extends AbstractMethodEndpointMapping<String>
implements InitializingBean

Simple subclass of AbstractMethodEndpointMapping that maps from the local name of the request payload to methods. Endpoint beans are registered using the endpoints property; the endpoint methods that start with methodPrefix and end with methodSuffix will be registered.

Endpoints typically have the following form:

 public class MyEndpoint{
 

public Source handleMyMessage(Source source) { ... } }

This method will handle any message that has the MyMessage as a payload root local name.

Since:
1.0.0
Author:
Arjen Poutsma
See Also:
setEndpoints(Object[])

Field Summary
static String DEFAULT_METHOD_PREFIX
          Default method prefix.
static String DEFAULT_METHOD_SUFFIX
          Default method suffix.
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
SimpleMethodEndpointMapping()
           
 
Method Summary
 void afterPropertiesSet()
           
 Object[] getEndpoints()
           
protected  String getLookupKeyForMessage(MessageContext messageContext)
          Returns the local part of the payload root element of the request.
protected  String getLookupKeyForMethod(Method method)
          Returns the name of the given method, with the prefix and suffix stripped off.
 String getMethodPrefix()
          Returns the method prefix.
 String getMethodSuffix()
          Returns the method suffix.
 void setEndpoints(Object[] endpoints)
          Sets the endpoints.
 void setMethodPrefix(String methodPrefix)
          Sets the method prefix.
 void setMethodSuffix(String methodSuffix)
          Sets the method suffix.
 
Methods inherited from class org.springframework.ws.server.endpoint.mapping.AbstractMethodEndpointMapping
getEndpointClass, getEndpointInternal, lookupEndpoint, registerEndpoint, registerMethods, registerMethods
 
Methods inherited from class org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping
createEndpointInvocationChain, getDefaultEndpoint, getEndpoint, getInterceptors, getOrder, initApplicationContext, initInterceptors, resolveStringEndpoint, setDefaultEndpoint, setInterceptors, setOrder
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_METHOD_PREFIX

public static final String DEFAULT_METHOD_PREFIX
Default method prefix.

See Also:
Constant Field Values

DEFAULT_METHOD_SUFFIX

public static final String DEFAULT_METHOD_SUFFIX
Default method suffix.

See Also:
Constant Field Values
Constructor Detail

SimpleMethodEndpointMapping

public SimpleMethodEndpointMapping()
Method Detail

getEndpoints

public Object[] getEndpoints()

setEndpoints

public void setEndpoints(Object[] endpoints)
Sets the endpoints. The endpoint methods that start with methodPrefix and end with methodSuffix will be registered.


getMethodPrefix

public String getMethodPrefix()
Returns the method prefix.


setMethodPrefix

public void setMethodPrefix(String methodPrefix)
Sets the method prefix. All methods with names starting with this string will be registered. Default is "handle".

See Also:
DEFAULT_METHOD_PREFIX

getMethodSuffix

public String getMethodSuffix()
Returns the method suffix.


setMethodSuffix

public void setMethodSuffix(String methodSuffix)
Sets the method suffix. All methods with names ending with this string will be registered. Default is "" (i.e. no suffix).

See Also:
DEFAULT_METHOD_SUFFIX

afterPropertiesSet

public final void afterPropertiesSet()
                              throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

getLookupKeyForMethod

protected String getLookupKeyForMethod(Method method)
Returns the name of the given method, with the prefix and suffix stripped off.

Overrides:
getLookupKeyForMethod in class AbstractMethodEndpointMapping<String>
Parameters:
method - the method
Returns:
a registration key, or null if the method is not to be registered

getLookupKeyForMessage

protected String getLookupKeyForMessage(MessageContext messageContext)
                                 throws TransformerException
Returns the local part of the payload root element of the request.

Specified by:
getLookupKeyForMessage in class AbstractMethodEndpointMapping<String>
Returns:
the registration keys
Throws:
TransformerException

Spring Web Services Framework

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