public abstract class AbstractMethodEndpointMapping<T> extends AbstractEndpointMapping
MethodEndpoint
mappings.
Subclasses typically implement BeanPostProcessor
to look for beans
that qualify as endpoint. The methods of this bean are then registered under a specific key with registerEndpoint(Object, MethodEndpoint)
.
Constructor and Description |
---|
AbstractMethodEndpointMapping() |
Modifier and Type | Method and Description |
---|---|
protected Class<?> |
getEndpointClass(Object endpoint)
Return the class or interface to use for method reflection.
|
protected Object |
getEndpointInternal(MessageContext messageContext)
Lookup an endpoint for the given message.
|
protected abstract T |
getLookupKeyForMessage(MessageContext messageContext)
Returns the the endpoint keys for the given message context.
|
protected T |
getLookupKeyForMethod(Method method)
Returns the the endpoint key for the given method.
|
protected List<T> |
getLookupKeysForMethod(Method method)
Returns the the endpoint keys for the given method.
|
protected MethodEndpoint |
lookupEndpoint(T key)
Looks up an endpoint instance for the given keys.
|
protected void |
registerEndpoint(T key,
MethodEndpoint endpoint)
Register the given endpoint instance under the key.
|
protected void |
registerMethods(Object endpoint)
Helper method that registers the methods of the given bean.
|
protected void |
registerMethods(String beanName)
Helper method that registers the methods of the given class.
|
createEndpointInvocationChain, getDefaultEndpoint, getEndpoint, getInterceptors, getOrder, initApplicationContext, initInterceptors, resolveStringEndpoint, setDefaultEndpoint, setInterceptors, setOrder
protected Object getEndpointInternal(MessageContext messageContext) throws Exception
getEndpointInternal
in class AbstractEndpointMapping
null
Exception
- if there is an errorgetLookupKeyForMessage(MessageContext)
protected abstract T getLookupKeyForMessage(MessageContext messageContext) throws Exception
Exception
protected MethodEndpoint lookupEndpoint(T key)
key
- key the beans are mapped tonull
if not foundprotected void registerEndpoint(T key, MethodEndpoint endpoint) throws org.springframework.beans.BeansException
key
- the lookup keyendpoint
- the method endpoint instanceorg.springframework.beans.BeansException
- if the endpoint could not be registeredprotected void registerMethods(Object endpoint)
getLookupKeyForMethod(Method)
for each. If this returns a string, the method is registered
using registerEndpoint(Object, MethodEndpoint)
.getLookupKeyForMethod(Method)
protected void registerMethods(String beanName)
getLookupKeyForMethod(Method)
for each. If this returns a string, the method is registered
using registerEndpoint(Object, MethodEndpoint)
.protected T getLookupKeyForMethod(Method method)
null
if the method is not to be
registered, which is the default.method
- the methodnull
if the method is not to be registeredgetLookupKeysForMethod(Method)
protected List<T> getLookupKeysForMethod(Method method)
getLookupKeysForMethod(Method)
.method
- the method