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
- Author:
- Arjen Poutsma
- See Also:
-
Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected EndpointInvocationChain
createEndpointInvocationChain
(MessageContext messageContext, Object endpoint, EndpointInterceptor[] interceptors) Creates a newEndpointInvocationChain
based on the given message context, endpoint, and interceptors.protected final Object
Returns the default endpoint for this endpoint mapping.final EndpointInvocationChain
getEndpoint
(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 Object
getEndpointInternal
(MessageContext messageContext) Lookup an endpoint for the given request, returningnull
if no specific one is found.Returns the endpoint interceptors to apply to all endpoints mapped by this endpoint mapping.final int
getOrder()
protected void
Initializes the interceptors.protected void
Initialize the specified interceptors, adapting them where necessary.protected Object
resolveStringEndpoint
(String endpointName) Resolves an endpoint string.final void
setDefaultEndpoint
(Object defaultEndpoint) Sets the default endpoint for this endpoint mapping.final void
setInterceptors
(EndpointInterceptor[] interceptors) Sets the endpoint interceptors to apply to all endpoints mapped by this endpoint mapping.final void
setOrder
(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
null
if none
-
setInterceptors
Sets the endpoint interceptors to apply to all endpoints mapped by this endpoint mapping.- Parameters:
interceptors
- array of endpoint interceptors, ornull
if none
-
getOrder
public final int getOrder()- Specified by:
getOrder
in 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:
initApplicationContext
in 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:
getEndpoint
in 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 newEndpointInvocationChain
based on the given message context, endpoint, and interceptors. Default implementation creates a simpleEndpointInvocationChain
based 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
null
if the name could not be resolved
-
getEndpointInternal
Lookup an endpoint for the given request, returningnull
if no specific one is found. This template method is called by getEndpoint, anull
return 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
-