Interface Describable<D,​R>

    • Method Detail

      • api

        D api​(ApiProducer<D> producer)
        Provide the API description for the component. This method should perform the heavy-lifting of computing the API descriptor, and should be expected to be called rarely. Upstream handlers should call this method in order to compose all of their downstream API Descriptors into a single descriptor.
        Parameters:
        producer - The API producer that provides general information to be built into the descriptor.
        Returns:
        The description object.
      • handleApiRequest

        D handleApiRequest​(Context context,
                           R request)
        Handle a request for the API Descriptor. This method should not do any computation, but should return the already computed descriptor.
        Parameters:
        context - The request context.
        request - The request.
        Returns:
        The descriptor.
        Throws:
        IllegalStateException - When the request cannot be routed to an acceptable handler.
        UnsupportedOperationException - When there is no API Descriptor available for the request.
      • addDescriptorListener

        default void addDescriptorListener​(Describable.Listener listener)
        Add a listener for API Descriptor changes. The described object should call all the listeners.
        Parameters:
        listener - The listener.
      • removeDescriptorListener

        default void removeDescriptorListener​(Describable.Listener listener)
        Remove a listener from API Descriptor changes.
        Parameters:
        listener - The listener.