|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 EndpointAdapter s to use by this MessageDispatcher . |
List<EndpointExceptionResolver> |
getEndpointExceptionResolvers()
Returns the EndpointExceptionResolver s to use by this MessageDispatcher . |
List<EndpointMapping> |
getEndpointMappings()
Returns the EndpointMapping s 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 EndpointAdapter s to use by this MessageDispatcher . |
void |
setEndpointExceptionResolvers(List<EndpointExceptionResolver> endpointExceptionResolvers)
Sets the EndpointExceptionResolver s to use by this MessageDispatcher . |
void |
setEndpointMappings(List<EndpointMapping> endpointMappings)
Sets the EndpointMapping s 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()
EndpointAdapter
s to use by this MessageDispatcher
.
public void setEndpointAdapters(List<EndpointAdapter> endpointAdapters)
EndpointAdapter
s to use by this MessageDispatcher
.
public List<EndpointExceptionResolver> getEndpointExceptionResolvers()
EndpointExceptionResolver
s to use by this MessageDispatcher
.
public void setEndpointExceptionResolvers(List<EndpointExceptionResolver> endpointExceptionResolvers)
EndpointExceptionResolver
s to use by this MessageDispatcher
.
public List<EndpointMapping> getEndpointMappings()
EndpointMapping
s to use by this MessageDispatcher
.
public void setEndpointMappings(List<EndpointMapping> endpointMappings)
EndpointMapping
s 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 ApplicationContextAware
BeansException
public void receive(MessageContext messageContext) throws Exception
WebServiceMessageReceiver
receive
in interface WebServiceMessageReceiver
messageContext
- 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.
Exception
protected 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 EndpointInvocationChain
messageContext
- the message context
true
if processing should continue; false
otherwiseprotected 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 |