|Apache Tuscany > Home > SCA Overview > SCA Java > Java SCA Documentation Menu > SCA Java Event Processing > Java Implementation Model for Event Processing||User List | Dev List | Issue Tracker|
This page describes the Java Implementation for Event Processing.
The Java Implementation for Event Processing is an extension of the standard SCA Java Implementation model. All the standard SCA Java implementation features continue to be available to Java implementations. The following features are added:
Event types are defined through Java classes which are annotated with a @EventType annotation. The @EventType annotation has a single parameter which is the name of the event type.
The name may be:
Note that the Event Type name maps to an XSD QName using the Java-to-WSDL mapping as defined by JAX-WS.
The Event type(s) handled by a consumer method or a producer method is defined in one of two ways:
Each method of the implementation that is a consumer for events is annotated with a @Consumer annotation. Each method must have a void return type and a single parameter that is either a specific event type or a superclass of one or more event types, including java.lang.Object, which is treated as the supertype of all event types.
Event Producers are identified as a Field or a Setter method annotated with a @Producer annotation
It is required that the Field or Setter method is typed by a Java interface. The Java interface must have one or more methods, each of which has a void return type and a single parameter that is either a specific event type or a superclass of one or more event types, including java.lang.Object, which is treated as the supertype of all event types.