Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

ECF/tooling/remote-service-development-user-guide

< ECF
Revision as of 20:28, 30 July 2013 by Unnamed Poltroon (Talk)

Summary

This project introduce a new developer tool which can be use to generate eclipse ecf remote-service interface and class.Specially ECF has introduced asynchronous remote services which need a little bit complex interface.Using this tool you can generate these interface in seconds by defining two simple annotation.

Currently supporting functionalties

user can generate following class and interface by pointing exsiting service interface.

  1. Create Asyn service interface template.
  2. Create Async service impl class temeplate.
  3. Create Non-Async serivce (normal remote service)  impl class

All above code generation support for generating any type of retun statements , parameters and exceptions

Future releases of this tool will be generating following  code as well.

  1. service registration code.
  2. service consumer code.
  3. service test classes


pre-requires

Install eclipse ecf [1]-http://www.eclipse.org/ecf/downloads.php

I have used Eclipse Kepler for development and Testing  with JDK 1.7

Project can be download via

svn checkout https://ecfremotetservicegenool.googlecode.com/svn/trunk/ or http://ecfremotetservicegenool.googlecode.com/svn/trunk

once you download the project import into eclipse workspace and you can run eclipase self hosting mode for testing (Plugin feature will be provided to install at the end of the project)

How to use the tool for code generation process

This tool introduce following two annotations which can be used to generate the interface and implementation class.

@RemoteService?(type="Async")

This a type annotation, this is used to identify the remote service type. if the service is an asynchronous type should be define as Async if the service is a normal remote service type should be equal to sync When service type is Asynchronous user should define methods as asynchronous for that user can be use Async annotation as follows

@Async
This a method annotaion,can be used to modify the method as

@Async(type="both") pubic void foo(int i);

Async method can be crates 3 ways

  1. creating a method using IFuture.
  2. create a method using callback handler.
  3. creat methods useing both types.

this argument can be pass a annotation option as follows if the method use IFuture

@Async(type="future") pubic void foo(int i);. if the method use callback handler @Async(type="callback") pubic void foo(int i);</u

<u>if user want to create both above methods @Async(type="both") pubic void foo(int i);

Once you done above declarations, right click on the file and select "generate ecf service" option from the right click menu.Async service interface and service impl class will be generated.

If your service type is sync then no need to define any annotations for methods, just right click on the interface and select the service generation option from the right click menu,Service impl class will be generated.

This video[3] describing above scenarios step by step

[3]-http://youtu.be/vwMslJtiowQ (use google chrome browser to see this video)


Back to the top