+

Search Tips   |   Advanced Search

SCA annotations

By using Java annotations that apply to Service Component Architecture (SCA), we can enable an existing 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, we 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:

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.

We 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.

We 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

    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

    Whether injection is required. The default value is false. This property is optional. (Boolean)

  • Service Component Architecture specifications and APIs