-
Notifications
You must be signed in to change notification settings - Fork 1
CodeGenerationPlatform_Async
Shakespeare would ask: to generate async remote service or not to generate async remote service?
Our answer is: definetelly generated them! It allows you to keep these two files (remote service and async remote service) in the sync (maybe you have had a hard times with GWT compilation and knows perfectly this kind of error message: Missing asynchronous version of the synchronous method). Thanks to eclipse annotation processing support it is perfectly integrated with your IDE and async remote service is automatically regenerated after each change in the remote service).
The ones who does not use/like maven - we are supporting only maven configuration - if you can provide configuration for other project management tools, please let us know.
- Add following dependency to your pom.xml
<dependency>
<groupId>sk.seges.acris</groupId>
<artifactId>acris-async-service-processor</artifactId>
<scope>provided</scope>
<version>1.2.0</version>
</dependency>
- create .pap file in your project in order to enable annotation processors
When your remote service is annotated with one of the following annotation, async version is automatically generated by the async plugable annotation processor:
- com.google.gwt.user.client.rpc.RemoteServiceRelativePath
- sk.seges.acris.core.client.annotation.RemoteServicePath
- sk.seges.sesam.pap.service.annotation.RemoteServiceDefinition
Remote service:
@RemoteServiceRelativePath("/service")
public interface GWTContentAdministrationServiceRemote extends RemoteService {
PagedResult<List<ContentDTO>> findAll(Page page);
ContentDTO merge(ContentDTO content);
void remove(ContentDTO content);
}
Generated async version:
@Generated(value = "sk.seges.acris.pap.service.AsyncServiceProcessor")
public interface GWTContentAdministrationServiceRemoteAsync {
void findAll(Page page, AsyncCallback<PagedResult<List<ContentDTO>>> callback);
void merge(ContentDTO content, AsyncCallback<ContentDTO> callback);
void remove(ContentDTO content, AsyncCallback<Void> callback);
}