Metro Web Service Stack

Implementation Version: 1.4 FCS

Web Service endpoints may choose to work at the XML message level by implementing the Provider interface. The related information about  Provider endpoints is documented in  provider page. However  Provider endpoints are synchronous i.e. they receive XML requests and they return XML responses synchronously in invoke() method. If the endpoint wants to spawn a thread to process the request, it would block the jax-ws runtime thread and has to manage all the low details synchronizing the threads when the response is available. Also blocking a thread doesn't really scale well especially when the underlying transport is capable of handling asynchronous request and responses. RI provides an implemention specific solution to this problem by introducing  AsyncProvider. This is similar to Provider endpoints but the difference is that the endpoint implementations have to implement AsyncProvider interface.

AsyncProvider Example

The following example shows an AsyncProvider example that accesses the payload of the request.

For example:

public class AsyncProviderImpl implements AsyncProvider<Source> {     
    public void invoke(Source source, AsyncProviderCallback cbak, WebServiceContext ctxt) {...}

AsyncProvider sample

See a  sample that illustrates AsyncProvider endpoints.

Terms of Use; Privacy Policy; Copyright ©2013-2016 (revision 20160708.bf2ac18)
Please Confirm