Adding client/server GWT communication classes in Fenix

From Giews

Jump to: navigation, search

[edit] How to add a new client/server call

[edit] Adding a method in an existing service

To add a new call in an existing service, we need to add:

  • a synchronous method in the service synch interface
  • the related asynchronous method in the "twin" async interface
  • the implementation of the synchronous method in the service

The synch method will be something in this form

YourRetObject yourMethod( .... yourParams ....)

and the corresponding asynch method will be like this:

void yourMethod( .... yourParams ...., AsyncCallback callback)

[edit] Adding a brand new service

If you want to add a brand new service for your collection of methods, you'll need to:

  • add the sync interface
    in org.fenix.web.client.services.YourService
  • add the async interface
    in org.fenix.web.client.services.YourServiceAsync
  • add the implementation class
    in org.fenix.web.server.YourServiceImpl
  • modify org.fenix.web.client.Fenix in order to initialize the new service
    You will need something of this form
yourService = (YourServiceAsync)GWT.create(YourService.class);
ServiceDefTarget targetYourService = (ServiceDefTarget) yourService;
targetYourService.setServiceEntryPoint(urlService);

but also refer to the existing code.

  • modify the spring config file TODO
Personal tools