Java Reference
In-Depth Information
In addition to exposing existing OSG i services to SCA applications, the OSG i SCA com-
ponent type also allows SCA endpoints to be advertised and consumed as services in
the OSG i Service Registry. The properties and interface with which the SCA service is
registered are also defined in the SCA descriptor, but OSG i bundles can then consume
the SCA service as if it were any other OSG i service.
USING TUSCANY AND ARIES TOGETHER
Much like CXF , you can integrate Tuscany into your little Aries runtime by download-
ing a Tuscany distribution and copying all the bundles into the load directory.
Alternatively, you can merge the config.ini configuration files for the Aries and
Tuscany runtimes. Tuscany can be downloaded from http://tuscany.apache.org/
sca-java-releases.html .
WARNING: GETTING TUSCANY WORKING WITH ARIES You may find that com-
bining Tuscany and Aries isn't as straightforward as it was for CXF and Aries.
When we tried it, we hit several issues and we needed to do some tweaking
to get everything working together. At a minimum, you'll need a Tuscany
release more recent than 2.0-Beta3, because some OSGi bundles didn't
resolve in that release. Some of Tuscany's dependencies required Declara-
tive Services, but no implementation was included in the Tuscany distribu-
tion we tried. You'll need to make sure a Declarative Services
implementation like Felix SCR is present in your runtime. Finally, Tuscany
includes a bundle for the JPA API that's incorrectly labeled version 3.0, and
this needs to be removed.
If getting a combined Tuscany-Aries runtime up and running is sounding like too
much hard work, you might consider one of the prebuilt server stacks that have
already done the integration for you. Remember that Apache Aries isn't intended to
be an application server—it's a set of components that can be included in a server.
IBM 's WebSphere Application Server includes both an SCA runtime, based on Apache
Tuscany, and an enterprise OSG i runtime, based on Apache Aries. We'll discuss other
options for an enterprise OSG i stack more in chapter 13.
10.6.2
Importing a remote service
After you've got your Tuscany runtime up and running, you'll find that remote ser-
vices with Tuscany looks a lot like remote services with CXF . Because you started off
exporting a service with CXF , this time you'll go in the opposite order and start by
importing a service using Tuscany. As with CXF , you'll need a remote services configu-
ration file, as shown in the following listing.
Listing 10.7
The remote services endpoint configuration file for SCA
<?xml version="1.0" encoding="UTF-8"?>
<endpoint-descriptions
xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0"
xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
 
 
Search WWH ::




Custom Search