java.lang.Object
org.palladiosimulator.analyzer.slingshot.eventdriver.entity.SubscriberContract

public class SubscriberContract extends Object
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 Details

  • Method Details

    • getWhen

      public Class<?> getWhen()
    • getThen

      public List<Class<?>> getThen()
    • getCardinality

      public EventCardinality getCardinality()
    • fromAnnotation

      public static SubscriberContract fromAnnotation(OnEvent onEvent)
      Returns a new SubscriberContract from the OnEvent annotation.
      Parameters:
      onEvent - The instance of the OnEvent annotation to a class.
      Returns:
      A new SubscriberContract containing the specified information from the annotation.