This page describes the SCA Assembly model for event processing.
The SCA Assembly model for Event Processing is an extension of the standard SCA Assembly model. All the standard SCA Assembly model features continue to be available. The Event Processing model adds the following extensions:
- Component Type is extended so that the Component Type can have zero or more <producer/> elements and zero or more <consumer/> elements, alongside <service/> and <reference/> elements
- Component elements are extended so that a Component can have zero or more <consumer/> elements and zero or more <producer/> elements, which can be used to configure the consumer and producer elements of the implementation used by the Component
- Component producers can be linked to component consumers in the assembly through @target attribute in the component producer elements or @source attribute in the component consumer elements
Component Type - Event Processing Extensions
The component type of an implementation is extended to include zero or more consumer elements and zero or more producer elements:
<componentType> <implementation ... />? <service ... />* <reference ... />* <property ... />* <consumer name="xs:NCName" eventTypes="list of xs:QName"?/>* <producer name="xs:NCName" eventTypes="list of xs:QName"?/>* </componentType>
Each consumer and each producer has a Name. The Name must be unique amongst the names of consumers, producers, services, references of the componentType.
Each consumer and each producer has an optional list of event types. For a producer, the list of event types indicates which event types can be produced by the producer. If no event types are listed, the producer may produce events of any type. For a consumer, the list of event types indicates which event types can be consumed by the consumer - and this list is used to filter messages received by the consumer - only events with event types that are in the list will be sent to the consumer. If no event types are listed, then all event types are consumed by the consumer.
Component - Event Processing Extensions
The component element within an SCA composite is extended to include zero or more consumer elements and zero or more producer elements.
<component ... >* <implementation/> <service ... />* <reference ... />* <property ... />* <consumer name="xs:NCName" source="list of xs:anyURI"? eventTypes="list of xs:QName"?> <filters/>* </consumer> <producer name="xs:NCName" target="list of xs:anyURI"? eventTypes="list of xs:QName"?> </producer> </component>
The component consumer and producer elements configure the consumer and producer elements of the implementation as described by its component type.
Component producer elements declare where events from the producer are sent, through the @target attribute. The target attribute lists one or more target consumers, in the form of a space separated list of the form "ComponentName/ConsumerName", where "ComponentName" is the name of a component within the same composite and "ConsumerName" is the name of a consumer on that component.
Component consumer elements can declare from where the events are received by the consumer, through the @source attribute. The source attribute lists one or more source producers, in the form of a space separated list of the form "ComponentName/ProducerName", where "ComponentName" is the name of a component within the same composite and "ProducerName" is the name of a producer on that component.
Both consumer and producer elements can declare a list of event types, using the @eventTypes attribute. For a producer, the list of event types indicates which event types can be produced by the producer. If no event types are listed, the producer may produce events of any type. For a consumer, the list of event types indicates which event types can be consumed by the consumer - and this list is used to filter messages received by the consumer - only events with event types that are in the list will be sent to the consumer. If no event types are listed, then all event types are consumed by the consumer.
Component Diagram including Producer and Consumer
The following is a diagram for a component which has services, references, producers and consumers:
Composite with Producer linked to a Consumer
The following diagram shows a composite with a component producer linked to a component consumer:
The composite corresponding to this is:
<composite name="Composite_X"> <component name="Component1"> <producer name="Producer1" target="Component1/Consumer1"/> </component> <component name="Component2"> <consumer name="Consumer1"/> </component> </composite>