[AIX HP-UX Linux Solaris Windows][z/OS]

Using the SCA default binding to find and locate SCA services

The product supports an API that you can use to find and invoke Service Component Architecture (SCA) services over the SCA default binding.

About this task

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.

Procedure

Use the import method in your client code to locate an SCA service.
The following method is supported for client code to locate a service that is deployed onto a cell:
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");

What to do next

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


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic Task topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Feb 6, 2014 8:11:25 PM CST
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=matt&product=was-nd-mp&topic=tsca_locate_scaserv_api
File name: tsca_locate_scaserv_api.html