Jump to: navigation, search

Difference between revisions of "ECF/Getting Started with Remote Services API"

< ECF
(New page: ==Introduction== The ECF remote services API is an abstract API for looking up remote services, and using/calling remote services via either normal synchronous remote procedure call (RPC)...)
 
Line 1: Line 1:
==Introduction==
+
Install ECF 3.0. See [http://www.eclipse.org/ecf/downloads.php ecf download].
  
The ECF remote services API is an abstract API for looking up remote services, and using/calling remote services via either normal synchronous remote procedure call (RPC) or asynchronous (non-blocking) remote procedure call.
+
In addition you will need Equinox in your target platform (either the [http://download.eclipse.org/equinox/ Equinox 3.5 SDK] or the parts that come with Eclipse).  
  
The ECF remote services API is documented via the [[ECF_API_Docs | API documentation here]].
+
===Service Interface===
  
==Registering a Service===
+
As with any OSGi service, you must first define your service interface.  Here is a trivial example 'hello' service interface:
Here is some example code for accessing a remote service with the ECF remote services API and using the r-OSGI provider
+
  
<source lang="java">
+
<source lang="java">package org.eclipse.ecf.examples.remoteservices.hello;
 +
 
 +
public interface IHello {
 +
 
 +
public void hello(String from);
 +
 +
}
 
</source>
 
</source>
 +
 +
This service is defined, along with a simple implementation, in this project in CVS
 +
 +
cvs: ''':pserver:anonymous@dev.eclipse.org:/cvsroot/rt'''<br>
 +
modules: '''org.eclipse.ecf/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello''', '''org.eclipse.ecf/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.host.rs''', '''org.eclipse.ecf/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.consumer.rs'''
 +
 +
Here is a [[Media:Hello_rs.psf|project set file]] for these projects.
 +
 +
The service interface above is contained in the o.e.e.e.remoteservices.hello bundle, along with a trivial implementation (in org.eclipse.ecf.examples.remoteservices.hello.impl.Hello).

Revision as of 20:02, 24 June 2009

Install ECF 3.0. See ecf download.

In addition you will need Equinox in your target platform (either the Equinox 3.5 SDK or the parts that come with Eclipse).

Service Interface

As with any OSGi service, you must first define your service interface. Here is a trivial example 'hello' service interface:

package org.eclipse.ecf.examples.remoteservices.hello;
 
public interface IHello {
 
	public void hello(String from);
 
}

This service is defined, along with a simple implementation, in this project in CVS

cvs: :pserver:anonymous@dev.eclipse.org:/cvsroot/rt
modules: org.eclipse.ecf/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello, org.eclipse.ecf/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.host.rs, org.eclipse.ecf/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.consumer.rs

Here is a project set file for these projects.

The service interface above is contained in the o.e.e.e.remoteservices.hello bundle, along with a trivial implementation (in org.eclipse.ecf.examples.remoteservices.hello.impl.Hello).