|
Spring Web Services Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.ws.server.MessageDispatcher
public class MessageDispatcher
Central dispatcher for use within Spring-WS, dispatching Web service messages to registered endpoints.
This dispatcher is quite similar to Spring MVCsDispatcherServlet. Just like its counterpart, this dispatcher
is very flexible. This class is SOAP agnostic; in typical SOAP Web Services, the SoapMessageDispatcher
subclass is used.
EndpointMapping implementation - whether standard, or provided as
part of an application - to control the routing of request messages to endpoint objects. Endpoint mappings can be
registered using the endpointMappings property.EndpointAdapter; this allows one to use any endpoint interface or form. Defaults to
the MessageEndpointAdapter and PayloadEndpointAdapter, for MessageEndpoint and
PayloadEndpoint, respectively, and the
MessageMethodEndpointAdapter and
PayloadMethodEndpointAdapter.
Additional endpoint adapters can be added through the endpointAdapters property.EndpointExceptionResolver, for example mapping certain exceptions to SOAP Faults. Default is none. Additional
exception resolvers can be added through the endpointExceptionResolvers
property.
EndpointMapping,
EndpointAdapter,
EndpointExceptionResolver,
DispatcherServlet| Field Summary | |
|---|---|
static String |
ENDPOINT_NOT_FOUND_LOG_CATEGORY
Log category to use when no mapped endpoint is found for a request. |
protected static Log |
endpointNotFoundLogger
Additional logger to use when no mapped endpoint is found for a request. |
protected Log |
logger
Logger available to subclasses. |
static String |
MESSAGE_TRACING_LOG_CATEGORY
Log category to use for message tracing. |
protected static Log |
receivedMessageTracingLogger
Additional logger to use for received message tracing. |
protected static Log |
sentMessageTracingLogger
Additional logger to use for sent message tracing. |
| Constructor Summary | |
|---|---|
MessageDispatcher()
Initializes a new instance of the MessageDispatcher. |
|
| Method Summary | |
|---|---|
protected void |
dispatch(MessageContext messageContext)
Dispatches the request in the given MessageContext according to the configuration. |
protected EndpointInvocationChain |
getEndpoint(MessageContext messageContext)
Returns the endpoint for this request. |
protected EndpointAdapter |
getEndpointAdapter(Object endpoint)
Returns the EndpointAdapter for the given endpoint. |
List<EndpointAdapter> |
getEndpointAdapters()
Returns the EndpointAdapters to use by this MessageDispatcher. |
List<EndpointExceptionResolver> |
getEndpointExceptionResolvers()
Returns the EndpointExceptionResolvers to use by this MessageDispatcher. |
List<EndpointMapping> |
getEndpointMappings()
Returns the EndpointMappings to use by this MessageDispatcher. |
protected boolean |
handleRequest(EndpointInvocationChain mappedEndpoint,
MessageContext messageContext)
Callback for pre-processing of given invocation chain and message context. |
protected void |
processEndpointException(MessageContext messageContext,
Object endpoint,
Exception ex)
Determine an error SOAPMessage response via the registered EndpointExceptionResolvers. |
void |
receive(MessageContext messageContext)
Receives the given message context. |
void |
setApplicationContext(ApplicationContext applicationContext)
|
void |
setBeanName(String beanName)
|
void |
setEndpointAdapters(List<EndpointAdapter> endpointAdapters)
Sets the EndpointAdapters to use by this MessageDispatcher. |
void |
setEndpointExceptionResolvers(List<EndpointExceptionResolver> endpointExceptionResolvers)
Sets the EndpointExceptionResolvers to use by this MessageDispatcher. |
void |
setEndpointMappings(List<EndpointMapping> endpointMappings)
Sets the EndpointMappings to use by this MessageDispatcher. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Log logger
public static final String ENDPOINT_NOT_FOUND_LOG_CATEGORY
protected static final Log endpointNotFoundLogger
public static final String MESSAGE_TRACING_LOG_CATEGORY
protected static final Log sentMessageTracingLogger
protected static final Log receivedMessageTracingLogger
| Constructor Detail |
|---|
public MessageDispatcher()
MessageDispatcher.
| Method Detail |
|---|
public List<EndpointAdapter> getEndpointAdapters()
EndpointAdapters to use by this MessageDispatcher.
public void setEndpointAdapters(List<EndpointAdapter> endpointAdapters)
EndpointAdapters to use by this MessageDispatcher.
public List<EndpointExceptionResolver> getEndpointExceptionResolvers()
EndpointExceptionResolvers to use by this MessageDispatcher.
public void setEndpointExceptionResolvers(List<EndpointExceptionResolver> endpointExceptionResolvers)
EndpointExceptionResolvers to use by this MessageDispatcher.
public List<EndpointMapping> getEndpointMappings()
EndpointMappings to use by this MessageDispatcher.
public void setEndpointMappings(List<EndpointMapping> endpointMappings)
EndpointMappings to use by this MessageDispatcher.
public final void setBeanName(String beanName)
setBeanName in interface BeanNameAware
public void setApplicationContext(ApplicationContext applicationContext)
throws BeansException
setApplicationContext in interface ApplicationContextAwareBeansException
public void receive(MessageContext messageContext)
throws Exception
WebServiceMessageReceiver
receive in interface WebServiceMessageReceivermessageContext - the message context to be received
Exception
protected final void dispatch(MessageContext messageContext)
throws Exception
messageContext - the message context
NoEndpointFoundException - thrown when an endpoint cannot be resolved for the incoming message
Exception
protected EndpointInvocationChain getEndpoint(MessageContext messageContext)
throws Exception
EndpointInvocationChain, or null if no endpoint could be found.
Exceptionprotected EndpointAdapter getEndpointAdapter(Object endpoint)
EndpointAdapter for the given endpoint.
endpoint - the endpoint to find an adapter for
protected boolean handleRequest(EndpointInvocationChain mappedEndpoint,
MessageContext messageContext)
handleRequest on the interceptors.
Default implementation does nothing, and returns true.
mappedEndpoint - the mapped EndpointInvocationChainmessageContext - the message context
true if processing should continue; false otherwise
protected void processEndpointException(MessageContext messageContext,
Object endpoint,
Exception ex)
throws Exception
SOAPMessage response via the registered EndpointExceptionResolvers.
Most likely, the response contains a SOAPFault. If no suitable resolver was found, the exception is
rethrown.
messageContext - current SOAPMessage requestendpoint - the executed endpoint, or null if none chosen at the time of the exceptionex - the exception that got thrown during handler execution
Exception - if no suitable resolver is found
|
Spring Web Services Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||