Jump to: navigation, search

EIG:Install TimeService Tutorial into Apache Karaf


In ECF 3.8+ it's possible to use Apache Karaf runtime to install the ECF SDK and run remote service applications. Once such example application is the Building your first OSGi Remote Services Tutorial.

The tutorial explains how to first Implement the Remote Service and then Register the Remote Service.

To run the remote service host on Apache Karaf, it's first necessary to install the relevant bundles into the Karaf runtime. To do this, first Install the ECF Remote Service SDK into Apache Karaf. Once the ECF SDK is installed you may install the Timeline Example bundles with the following feature install (may be done from the Karaf command shell or from the webconsole):

karaf@root()> feature:install -v ecf.rs.examples.timeservice

Once complete, the install process should look like this


Optionally, before starting the TimeService host you can turn on some extra output by issuing this command into the Apache command shell

karaf@root()> system:property verboseRemoteServiceAdmin true

karaf@root()> system:property service.exported.configs ecf.generic.server

Then using the webconsole (or the command shell) start the bundle

ECF RS Example Timeservice Host (bundle symbolic id: com.mycorp.examples.timeservice.host)

This will produce output in the command shell (System.out) similar to the following, indicating that the service has been exported by RemoteServiceAdmin and the MyTimeService registered.

karaf@root()> Service Exported by RemoteServiceAdmin.  EndpointDescription Properties=ecf.endpoint.id=
ecftcp://localhost:3288/server, ecf.endpoint.id.ns=org.eclipse.ecf.core.identity.StringID, 
ecf.endpoint.ts=1394381999769, ecf.generic.server.hostname=localhost, ecf.generic.server.port=3288, 
ecf.rsvc.id=1, endpoint.framework.uuid=0a22aaf0-e110-4a89-ac62-edd97e44b2c1, 
endpoint.id=a7d3c846-5304-4e34-bf43-03224a4a138f, endpoint.package.version.com.mycorp.examples.timeservice=1.0.0,
endpoint.service.id=485, objectClass=Ljava.lang.String;@78d2df8c, remote.configs.supported=
[Ljava.lang.String;@6faf2576, remote.intents.supported=[Ljava.lang.String;@53c49f42, service.id=485,
service.imported=true, service.imported.configs=[Ljava.lang.String;@6faf2576}
MyTimeService host registered with registration=org.apache.felix.framework.ServiceRegistrationImpl@7a627ff2

For reference, this output is produced by the TimeService Examples Host activator class com.mycorp.examples.timeservice.host.Activator

The output above indicates that the TimeService has been exported and is ready for remote consumer access.