Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EIG:Install TimeService Tutorial into Apache Karaf"

(Introduction)
Line 1: Line 1:
 
==Introduction==
 
==Introduction==
  
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 [[Tutorial:_Building_your_first_OSGi_Remote_Service | Building your first OSGi Remote Services Tutorial]].
+
See the [[Tutorial:_Building_your_first_OSGi_Remote_Service | Building your first OSGi Remote Services Tutorial]] to understand how to design and build this example TimeService.
  
The tutorial explains how to first [[Tutorial:_Building_your_first_OSGi_Remote_Service#Service_Host:_Implement_the_Service | Implement the Remote Service]] and then [[Tutorial:_Building_your_first_OSGi_Remote_Service#Service_Host:_Register_the_Service | Register the Remote Service]].
+
To run the remote time service host example on Apache Karaf with ECF Remote Services, first install [[EIG:Install_into_Apache_Karaf | Install the ECF Remote Service SDK into Apache Karaf]].   Then use the command shell to set a debug system property
  
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 [[EIG:Install_into_Apache_Karaf | 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()> '''system:property verboseRemoteServiceAdmin true'''
  
karaf@root()> '''feature:install -v ecf.rs.examples.timeservice'''
+
Then install the timeservice host example
 +
 
 +
karaf@root()> '''feature:install -v ecf.rs.examples.timeservice.host'''
  
 
Once complete, the install process should look like this
 
Once complete, the install process should look like this
Line 14: Line 16:
  
 
Optionally, before starting the TimeService host you can turn on some extra output by issuing this command into the Apache command shell
 
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'''
 
karaf@root()> '''system:property service.exported.configs ecf.generic.server'''

Revision as of 15:42, 6 July 2015

Introduction

See the Building your first OSGi Remote Services Tutorial to understand how to design and build this example TimeService.

To run the remote time service host example on Apache Karaf with ECF Remote Services, first install Install the ECF Remote Service SDK into Apache Karaf. Then use the command shell to set a debug system property

karaf@root()> system:property verboseRemoteServiceAdmin true

Then install the timeservice host example

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

Once complete, the install process should look like this

Karafinst4.png

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

Back to the top