Interface ConstraintEnforcer

    • Method Detail

      • enforce

        void enforce​(Object constraint)
        Sends the given constraint to all interested subscribers.
        Parameters:
        constraint - the constraint to be enforced
      • respondTo

        <T> SubscriptionId respondTo​(Class<T> aClass,
                                     Consumer<T> responder)
        Adds the given Consumer as Subscriber for the given class.
        Type Parameters:
        T - the type of the constraint
        Parameters:
        aClass - the class of constraint
        responder - the Consumer to be called for a matching constraint
        Returns:
        a SubscriptionId identifying the Consumer
      • unsubscribe

        void unsubscribe​(SubscriptionId subscriptionId)
        Removes all Subscribers matching the given SubscriptionId.
        Parameters:
        subscriptionId - the SubscriptionId to remove