The product supports an API that you can use to find and invoke Service Component Architecture (SCA) services over the SCA default binding.
According to the SCA Version 1.0 specification, you can only obtain a reference to an SCA service from another component that is statically wired to the service. However, you can use a service proxy to invoke the target service. This function requires a WebSphere® Application Server base or network deployment topology with at least one server that supports SCA composites. Also, SCA service must be deployed, running, and accessible over the default binding, <binding.sca>. There is no support for a domain URI, so all requests go to the default domain at the cell level. Using this API enables code that is not an SCA component to use the SCA client programming model.
import com.ibm.websphere.sca.context.CurrentCompositeContext; import com.ibm.websphere.sca.context.CompositeContext; CompositeContext compositeContext = CurrentCompositeContext.getContext(); EchoService echoService = (EchoService) compositeContext .getService(EchoService.class, "SCASimpleEchoService");
To improve the component performance, make the caller of the compositeContext.getService() API cache the SCA default binding service proxy that is obtained from compositeContext.getContext(). Caching echoService in the example can avoid calls to the service registry for subsequent requests, resulting in better performance.
In this information ...Related tasks
Related reference
| IBM Redbooks, demos, education, and more(Index) |