ServiceRemotingDispatcher Class

public class ServiceRemotingDispatcher implements ServiceRemotingMessageHandler

Provides an implementation of ServiceRemotingMessageHandler that can dispatch messages to the service implementing Service interface.

Constructor Summary

Constructor Description
ServiceRemotingDispatcher(ServiceContext serviceContext, Service service)

Instantiates the ServiceRemotingDispatcher that uses the given service context and dispatches messages to the given service implementation.

Method Summary

Modifier and Type Method and Description
void handleOneWay(ServiceRemotingRequestContext requestContext, ServiceRemotingMessageHeaders messageHeaders, byte[] requestBody)

Handles a one way message from the client.

CompletableFuture<byte[]> requestResponseAsync(ServiceRemotingRequestContext requestContext, ServiceRemotingMessageHeaders messageHeaders, byte[] requestBody)

Handles a message from the client that requires a response from the service.

Constructor Details

ServiceRemotingDispatcher

public ServiceRemotingDispatcher(ServiceContext serviceContext, Service service)

Instantiates the ServiceRemotingDispatcher that uses the given service context and dispatches messages to the given service implementation.

Parameters:

serviceContext - Service context
service - Service implementation that implements interfaces of type

Method Details

handleOneWay

public void handleOneWay(ServiceRemotingRequestContext requestContext, ServiceRemotingMessageHeaders messageHeaders, byte[] requestBody)

Handles a one way message from the client.

Overrides:

ServiceRemotingDispatcher.handleOneWay(ServiceRemotingRequestContext requestContext, ServiceRemotingMessageHeaders messageHeaders, byte[] requestBody)

Parameters:

requestContext - contains additional information about the request
messageHeaders - Request message headers
requestBody - Request message body

requestResponseAsync

public CompletableFuture requestResponseAsync(ServiceRemotingRequestContext requestContext, ServiceRemotingMessageHeaders messageHeaders, byte[] requestBody)

Handles a message from the client that requires a response from the service.

Overrides:

ServiceRemotingDispatcher.requestResponseAsync(ServiceRemotingRequestContext requestContext, ServiceRemotingMessageHeaders messageHeaders, byte[] requestBody)

Parameters:

requestContext - contains additional information about the request
messageHeaders - Request message headers
requestBody - Request message body

Returns:

Response body

Applies to