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:
  • Constructor Details

    • AbstractEndpointMapping

      public AbstractEndpointMapping()
  • Method Details

    • getInterceptors

      public EndpointInterceptor[] 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

      public final void setInterceptors(EndpointInterceptor[] interceptors)
      Sets the endpoint interceptors to apply to all endpoints mapped by this endpoint mapping.
      Parameters:
      interceptors - array of endpoint interceptors, or null if none
    • getOrder

      public final int getOrder()
      Specified by:
      getOrder in interface org.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.BeansException
      Initializes the interceptors.
      Overrides:
      initApplicationContext in class org.springframework.context.support.ApplicationObjectSupport
      Throws:
      org.springframework.beans.BeansException
      See Also:
    • initInterceptors

      protected void initInterceptors()
      Initialize the specified interceptors, adapting them where necessary.
      See Also:
    • getEndpoint

      public final EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception
      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 interface EndpointMapping
      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 new EndpointInvocationChain based on the given message context, endpoint, and interceptors. Default implementation creates a simple EndpointInvocationChain based on the set interceptors.
      Parameters:
      endpoint - the endpoint
      interceptors - the endpoint interceptors
      Returns:
      the created invocation chain
      See Also:
    • getDefaultEndpoint

      protected final Object getDefaultEndpoint()
      Returns the default endpoint for this endpoint mapping.
      Returns:
      the default endpoint mapping, or null if none
    • setDefaultEndpoint

      public final void setDefaultEndpoint(Object defaultEndpoint)
      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

      protected Object resolveStringEndpoint(String endpointName)
      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

      protected abstract Object getEndpointInternal(MessageContext messageContext) throws Exception
      Lookup an endpoint for the given request, returning null if no specific one is found. This template method is called by getEndpoint, a null 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