Class AbstractMethodEndpointMapping<T>
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping
org.springframework.ws.server.endpoint.mapping.AbstractMethodEndpointMapping<T>
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.core.Ordered,EndpointMapping
- Direct Known Subclasses:
AbstractAnnotationMethodEndpointMapping,SimpleMethodEndpointMapping
Abstract base class for
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).
- Since:
- 1.0.0
- Author:
- Arjen Poutsma
-
Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
loggerFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<?>getEndpointClass(Object endpoint) Return the class or interface to use for method reflection.protected ObjectgetEndpointInternal(MessageContext messageContext) Lookup an endpoint for the given message.protected abstract TgetLookupKeyForMessage(MessageContext messageContext) Returns the endpoint keys for the given message context.protected TgetLookupKeyForMethod(Method method) Returns the endpoint key for the given method.getLookupKeysForMethod(Method method) Returns the endpoint keys for the given method.protected MethodEndpointlookupEndpoint(T key) Looks up an endpoint instance for the given keys.protected voidregisterEndpoint(T key, MethodEndpoint endpoint) Register the given endpoint instance under the key.protected voidregisterMethods(Object endpoint) Helper method that registers the methods of the given bean.protected voidregisterMethods(String beanName) Helper method that registers the methods of the given class.Methods inherited from class org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping
createEndpointInvocationChain, getDefaultEndpoint, getEndpoint, getInterceptors, getOrder, initApplicationContext, initInterceptors, resolveStringEndpoint, setDefaultEndpoint, setInterceptors, setOrderMethods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext
-
Constructor Details
-
AbstractMethodEndpointMapping
public AbstractMethodEndpointMapping()
-
-
Method Details
-
getEndpointInternal
Lookup an endpoint for the given message. The extraction of the endpoint key is delegated to the concrete subclass.- Specified by:
getEndpointInternalin classAbstractEndpointMapping- Returns:
- the looked up endpoint, or
null - Throws:
Exception- if there is an error- See Also:
-
getLookupKeyForMessage
Returns the endpoint keys for the given message context.- Returns:
- the registration keys
- Throws:
Exception
-
lookupEndpoint
Looks up an endpoint instance for the given keys. All keys are tried in order.- Parameters:
key- key the beans are mapped to- Returns:
- the associated endpoint instance, or
nullif not found
-
registerEndpoint
protected void registerEndpoint(T key, MethodEndpoint endpoint) throws org.springframework.beans.BeansException Register the given endpoint instance under the key.- Parameters:
key- the lookup keyendpoint- the method endpoint instance- Throws:
org.springframework.beans.BeansException- if the endpoint could not be registered
-
registerMethods
Helper method that registers the methods of the given bean. This method iterates over the methods of the bean, and callsgetLookupKeyForMethod(Method)for each. If this returns a string, the method is registered usingregisterEndpoint(Object, MethodEndpoint).- See Also:
-
registerMethods
Helper method that registers the methods of the given class. This method iterates over the methods of the class, and callsgetLookupKeyForMethod(Method)for each. If this returns a string, the method is registered usingregisterEndpoint(Object, MethodEndpoint). -
getLookupKeyForMethod
Returns the endpoint key for the given method. Returnsnullif the method is not to be registered, which is the default.- Parameters:
method- the method- Returns:
- a registration key, or
nullif the method is not to be registered - See Also:
-
getLookupKeysForMethod
Returns the endpoint keys for the given method. Should return an empty array if the method is not to be registered. The default delegates togetLookupKeysForMethod(Method).- Parameters:
method- the method- Returns:
- a list of registration keys
- Since:
- 2.2
-
getEndpointClass
Return the class or interface to use for method reflection.Default implementation delegates to
AopUtils.getTargetClass(Object).- Parameters:
endpoint- the bean instance (might be an AOP proxy)- Returns:
- the bean class to expose
-