Class SubscriberContract
java.lang.Object
org.palladiosimulator.analyzer.slingshot.eventdriver.entity.SubscriberContract
Holds all the necessary contract for subscribers of a particular event of the
type returned by
getWhen()
.
It tells that only the events listed by getThen()
are allowed to be returned
in the result set. Furthermore, the number of events returned is specified by
getCardinality()
.
This contract only makes sense if the result of an event handler contains events that should be published afterwards.
If an annotation OnEvent
was used to specify the contract, then the information
can be transformed using fromAnnotation(OnEvent)
.
-
Constructor Summary
ConstructorsConstructorDescriptionSubscriberContract
(Class<?> when, List<Class<?>> then, EventCardinality cardinality) -
Method Summary
Modifier and TypeMethodDescriptionstatic SubscriberContract
fromAnnotation
(OnEvent onEvent) Returns a new SubscriberContract from theOnEvent
annotation.getThen()
Class<?>
getWhen()
-
Constructor Details
-
SubscriberContract
-
-
Method Details
-
getWhen
-
getThen
-
getCardinality
-
fromAnnotation
Returns a new SubscriberContract from theOnEvent
annotation.- Parameters:
onEvent
- The instance of the OnEvent annotation to a class.- Returns:
- A new SubscriberContract containing the specified information from the annotation.
-