Class ConstraintEnforcerImpl
- java.lang.Object
-
- de.quantummaid.eventmaid.qcec.constraintenforcing.ConstraintEnforcerImpl
-
- All Implemented Interfaces:
ConstraintEnforcer
public class ConstraintEnforcerImpl extends Object implements ConstraintEnforcer
-
-
Constructor Summary
Constructors Constructor Description ConstraintEnforcerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenforce(Object constraint)Sends the given constraint to all interested subscribers.<T> SubscriptionIdrespondTo(Class<T> aClass, Consumer<T> responder)Adds the givenConsumerasSubscriberfor the given class.voidunsubscribe(SubscriptionId subscriptionId)Removes allSubscribersmatching the givenSubscriptionId.
-
-
-
Method Detail
-
respondTo
public <T> SubscriptionId respondTo(Class<T> aClass, Consumer<T> responder)
Description copied from interface:ConstraintEnforcerAdds the givenConsumerasSubscriberfor the given class.- Specified by:
respondToin interfaceConstraintEnforcer- Type Parameters:
T- the type of the constraint- Parameters:
aClass- the class of constraintresponder- theConsumerto be called for a matching constraint- Returns:
- a
SubscriptionIdidentifying theConsumer
-
enforce
public void enforce(Object constraint)
Description copied from interface:ConstraintEnforcerSends the given constraint to all interested subscribers.- Specified by:
enforcein interfaceConstraintEnforcer- Parameters:
constraint- the constraint to be enforced
-
unsubscribe
public void unsubscribe(SubscriptionId subscriptionId)
Description copied from interface:ConstraintEnforcerRemoves allSubscribersmatching the givenSubscriptionId.- Specified by:
unsubscribein interfaceConstraintEnforcer- Parameters:
subscriptionId- theSubscriptionIdto remove
-
-