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

Difference between revisions of "ECF/tooling/remote-service-development-user-guide"

< ECF
Line 33: Line 33:
 
This tool introduce following two annotations which can be used to generate the interface and implementation class.  
 
This tool introduce following two annotations which can be used to generate the interface and implementation class.  
  
===== '''@RemoteService?(type="Async")'''  =====
+
===== '''@RemoteService.'''  =====
  
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  
+
This a type annotation, this is used to identify the remote service type. if the service is an '''<u>asynchronous(@Remoteservice(type="Async"))</u>''' type should be define as Async if the service is a normal remote service type'''<u>(@Remoteservice(type="sync"))</u>''' 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'''.  =====
 
===== '''@Async'''.  =====

Revision as of 20:44, 30 July 2013

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.

Functionalities

currently user can generate following class and interface by pointing existing service interface.

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

All above code generation support for generating any type of return 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

Downloads

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

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

@RemoteService.

This a type annotation, this is used to identify the remote service type. if the service is an asynchronous(@Remoteservice(type="Async")) type should be define as Async if the service is a normal remote service type(@Remoteservice(type="sync")) 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.

Demostration

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


Back to the top