Skip to main content
Skip table of contents

Dispatcher API

Object Interface

For historical reasons, the Dispatcher abstraction does not correspond to a Dispatcher interface in Java. We use instead the interface com.zeroc.Ice.Object as the base interface for dispatchers.

com.zeroc.Ice.Object is a interface that provides the default implementation for the pseudo Slice interface Object:

JAVA
package com.zeroc.Ice;

@SliceTypeId(value = "::Ice::Object")
public interface Object {
    default CompletionStage<OutgoingResponse> dispatch(
        IncomingRequest request) throws UserException {
        ...
    }
}

The implementation of dispatch on com.zeroc.Ice.Object dispatches an incoming request to the 4 operations defined on Object: ice_id, ice_ids, ice_isA, and ice_ping. It throws OperationNotExistException for any other operation.

This implementation is immaterial: in practice, a dispatcher is any Java class that implements com.zeroc.Ice.Objectand reimplements dispatch. This dispatcher may (but does not need to) implement the 4 operations defined on Object.

Servants

In Java, a servant is a concrete class that implements the Dispatcher abstraction by itself, without delegating to some other object. In other words, a servant is a “terminal dispatcher”. A servant should generally handle the 4 operations defined on the pseudo-Slice interface Object.

The most common type of Java servants are classes that implement skeleton classes generated by the Slice compiler. These generated skeleton classes reimplement dispatch by:

  • unmarshaling input parameters

  • calling the pure virtual member function whose name matches the operation name carried by the request (you implement this pure virtual function in the servant class)

  • creating a response from the return value and out parameters returned by this function

They also implement or reimplement the 4 operations defined on Object.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.