Class AbstractEndpointMapping
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.core.Ordered,EndpointMapping
- Direct Known Subclasses:
AbstractMapBasedEndpointMapping,AbstractMethodEndpointMapping
public abstract class AbstractEndpointMapping
extends org.springframework.context.support.ApplicationObjectSupport
implements EndpointMapping, org.springframework.core.Ordered
Abstract base class for EndpointMapping implementations. Supports a default endpoint,
and endpoint interceptors.
- Since:
- 1.0.0
- See Also:
-
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 EndpointInvocationChaincreateEndpointInvocationChain(MessageContext messageContext, Object endpoint, EndpointInterceptor[] interceptors) Creates a newEndpointInvocationChainbased on the given message context, endpoint, and interceptors.protected final ObjectReturns the default endpoint for this endpoint mapping.final EndpointInvocationChaingetEndpoint(MessageContext messageContext) Look up an endpoint for the given message context, falling back to the default endpoint if no specific one is found.protected abstract ObjectgetEndpointInternal(MessageContext messageContext) Lookup an endpoint for the given request, returningnullif no specific one is found.Returns the endpoint interceptors to apply to all endpoints mapped by this endpoint mapping.final intgetOrder()protected voidInitializes the interceptors.protected voidInitialize the specified interceptors, adapting them where necessary.protected ObjectresolveStringEndpoint(String endpointName) Resolves an endpoint string.final voidsetDefaultEndpoint(Object defaultEndpoint) Sets the default endpoint for this endpoint mapping.final voidsetInterceptors(EndpointInterceptor[] interceptors) Sets the endpoint interceptors to apply to all endpoints mapped by this endpoint mapping.final voidsetOrder(int order) Specify the order value for this mapping.Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext
-
Constructor Details
-
AbstractEndpointMapping
public AbstractEndpointMapping()
-
-
Method Details
-
getInterceptors
Returns the endpoint interceptors to apply to all endpoints mapped by this endpoint mapping.- Returns:
- array of endpoint interceptors, or
nullif none
-
setInterceptors
Sets the endpoint interceptors to apply to all endpoints mapped by this endpoint mapping.- Parameters:
interceptors- array of endpoint interceptors, ornullif none
-
getOrder
public final int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
setOrder
public final void setOrder(int order) Specify the order value for this mapping.Default value is
Integer.MAX_VALUE, meaning that it's non-ordered.- See Also:
-
Ordered.getOrder()
-
initApplicationContext
protected void initApplicationContext() throws org.springframework.beans.BeansExceptionInitializes the interceptors.- Overrides:
initApplicationContextin classorg.springframework.context.support.ApplicationObjectSupport- Throws:
org.springframework.beans.BeansException- See Also:
-
initInterceptors
protected void initInterceptors()Initialize the specified interceptors, adapting them where necessary. -
getEndpoint
Look up an endpoint for the given message context, falling back to the default endpoint if no specific one is found.- Specified by:
getEndpointin interfaceEndpointMapping- Returns:
- the looked up endpoint instance, or the default endpoint
- Throws:
Exception- if there is an internal error- See Also:
-
createEndpointInvocationChain
protected EndpointInvocationChain createEndpointInvocationChain(MessageContext messageContext, Object endpoint, EndpointInterceptor[] interceptors) Creates a newEndpointInvocationChainbased on the given message context, endpoint, and interceptors. Default implementation creates a simpleEndpointInvocationChainbased on the set interceptors.- Parameters:
endpoint- the endpointinterceptors- the endpoint interceptors- Returns:
- the created invocation chain
- See Also:
-
getDefaultEndpoint
Returns the default endpoint for this endpoint mapping.- Returns:
- the default endpoint mapping, or null if none
-
setDefaultEndpoint
Sets the default endpoint for this endpoint mapping. This endpoint will be returned if no specific mapping was found.Default is
null, indicating no default endpoint.- Parameters:
defaultEndpoint- the default endpoint, or null if none
-
resolveStringEndpoint
Resolves an endpoint string. If the given string can is a bean name, it is resolved using the application context.- Parameters:
endpointName- the endpoint name- Returns:
- the resolved endpoint, or
nullif the name could not be resolved
-
getEndpointInternal
Lookup an endpoint for the given request, returningnullif no specific one is found. This template method is called by getEndpoint, anullreturn value will lead to the default handler, if one is set.The returned endpoint can be a string, in which case it is resolved as a bean name. Also, it can take the form
beanName#method, in which case the method is resolved.- Returns:
- the looked up endpoint instance, or null
- Throws:
Exception- if there is an error
-