SCA annotations

By using Java annotations that apply to Service Component Architecture (SCA), you can enable an existing Java Platform, Enterprise Edition (Java EE) component to be recognized as an SCA component and participate in an SCA composite.

The SCA programming model supports Java EE integration. As a result, you can take advantage of SCA annotations to enable the Java EE components, such as session beans, message driven beans, or Web components to consume SCA services.

The target for annotations applies for these Java objects:

Annotations supported by SCA are listed in the following table:

Table 1. SCA annotations. The annotations enable Java EE components.
Annotation class Annotation Properties
org.osoa.sca.
annotations.
ComponentName.class
The @ComponentName annotation specifies the injection of a component name.
  • Annotation target: Method or field
  • There are no properties on the @ComponentName annotation.
org.osoa.sca.
annotations.
Context.class 
The @Context annotation specifies to inject SCA context into a service component instance.

When you inject a composite context for the component, the type of context is defined by the type of the Java class field or type of the setter method input argument. Specify the type as either ComponentContext or RequestContext.

  • Annotation target: Method or field
  • There are no properties on the @Context annotation.
org.osoa.sca.
annotations.
Property.class 
The @Property annotation specifies to inject configuration properties from service component configuration.

You can inject a simple Java type or a complex Java type. The type of the property injected is defined by the type of the Java class field or type of the setter method input argument.

You can use this annotation on protected or public fields, on setter methods, or on a constructor method.

  • Annotation target: Method or field
  • Properties:
    - name
    The name of the property. The default is the name of the field of the Java class. This property is optional. (String)
    - required
    Specifies whether injection is required. The default value is false. This property is optional. (Boolean)
org.osoa.sca.
annotations.
Reference.class 
The @Reference annotation specifies the injection of a service reference.

The interface of the service injected is defined by the type of the Java class field or the type of the setter method input parameter.

  • Annotation target: Method or field
  • Properties:
    - name
    The name of the property. The default is the name of the field of the Java class. This property is optional. (String)
    - required
    Specifies whether injection is required. The default value is false. This property is optional. (Boolean)



Reference topic Reference topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Jun 12, 2013 3:32:32 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v700osgijpa&product=was-nd-mp&topic=rsca_scaannotations
File name: rsca_scaannotations.html