public class SimpleMethodEndpointMapping extends AbstractMethodEndpointMapping<String> implements org.springframework.beans.factory.InitializingBean
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.setEndpoints(Object[])| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_METHOD_PREFIX
Default method prefix.
|
static String |
DEFAULT_METHOD_SUFFIX
Default method suffix.
|
| Constructor and Description |
|---|
SimpleMethodEndpointMapping() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
getEndpointClass, getEndpointInternal, getLookupKeysForMethod, lookupEndpoint, registerEndpoint, registerMethods, registerMethodscreateEndpointInvocationChain, getDefaultEndpoint, getEndpoint, getInterceptors, getOrder, initApplicationContext, initInterceptors, resolveStringEndpoint, setDefaultEndpoint, setInterceptors, setOrderpublic static final String DEFAULT_METHOD_PREFIX
public static final String DEFAULT_METHOD_SUFFIX
public Object[] getEndpoints()
public void setEndpoints(Object[] endpoints)
methodPrefix and end with
methodSuffix will be registered.public String getMethodPrefix()
public void setMethodPrefix(String methodPrefix)
handle".DEFAULT_METHOD_PREFIXpublic String getMethodSuffix()
public void setMethodSuffix(String methodSuffix)
DEFAULT_METHOD_SUFFIXpublic final void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionprotected String getLookupKeyForMethod(Method method)
getLookupKeyForMethod in class AbstractMethodEndpointMapping<String>method - the methodnull if the method is not to be registeredAbstractMethodEndpointMapping.getLookupKeysForMethod(Method)protected String getLookupKeyForMessage(MessageContext messageContext) throws TransformerException
getLookupKeyForMessage in class AbstractMethodEndpointMapping<String>TransformerExceptionCopyright © 2020 Pivotal Software. All rights reserved.