A Service Component Architecture (SCA) application can access a Service Data Objects (SDO) 2.1.1 HelperContext object. This object either uses DefaultHelperContext annotation or implements a application programming interface (API) that uses the commonj.sdo.helper.SDO class.
Read SDO data binding for SCA applications to better understand how to work with SDO in SCA Java clients and implementations.
Develop one or more SCA composites that use SDO following a top-down or bottom-up approach.
The steps describe how to create and access SDO HelperContext in SCA applications. For information about accessing SDO HelperContext in non-SCA applications, see Creating and accessing SDO HelperContext objects.
You can create and access SDO HelperContext in both OSOA and OASIS SCA applications.
Because the SCA run time manages the HelperContext objects and identifiers when using SDO in SCA applications, the method used to create and access SDO HelperContext in SCA applications is different from that used in non-SCA applications. An SCA application can access SDO HelperContext using a DefaultHelperContext annotation, @DefaultHelperContext.
Alternatively, an SCA application can implement an API that uses the commonj.sdo.helper.SDO class, to obtain the same SCA-managed HelperContext instance. This approach is an alternative to the annotation. To use this approach, pass the String ID of the SCA-managed HelperContext, which is sca-default, into the SDO.getHelperContext method.
You can access the default HelperContext programmatically in a Java or Java Platform, Enterprise Edition (Java EE) component implementation type using either annotation injection or an API. You cannot access the default HelperContext programmatically in a Spring component implementation type. When you use an OSGI application as an implementation of an SCA component, you can access the default HelpContext instance using the API mechanism. However, you cannot access the instance using the annotation injection mechanism.
You have written code that accesses the default HelperContext.
Develop one or more SCA composites that use SDO following a bottom-up or top-down approach.