Class ConstraintEnforcerImpl

    • Constructor Detail

      • ConstraintEnforcerImpl

        public ConstraintEnforcerImpl()
    • Method Detail

      • respondTo

        public <T> SubscriptionId respondTo​(Class<T> aClass,
                                            Consumer<T> responder)
        Description copied from interface: ConstraintEnforcer
        Adds the given Consumer as Subscriber for the given class.
        Specified by:
        respondTo in interface ConstraintEnforcer
        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
      • enforce

        public void enforce​(Object constraint)
        Description copied from interface: ConstraintEnforcer
        Sends the given constraint to all interested subscribers.
        Specified by:
        enforce in interface ConstraintEnforcer
        Parameters:
        constraint - the constraint to be enforced
      • unsubscribe

        public void unsubscribe​(SubscriptionId subscriptionId)
        Description copied from interface: ConstraintEnforcer
        Removes all Subscribers matching the given SubscriptionId.
        Specified by:
        unsubscribe in interface ConstraintEnforcer
        Parameters:
        subscriptionId - the SubscriptionId to remove