mplates.1.2.source-code.GWTPojoService.ftl Maven / Gradle / Ivy
<#assign object = doc.object>
package ${object.@package}.gwt.mvp.service;
import com.google.gwt.json.client.JSONObject;
import redora.client.mvp.ClientFactory;
import ${object.@package}.gwt.mvp.service.base.${object.@name}ServiceBase;
import ${object.@package}.gwt.mvp.util.ClientFactoryImpl;
/**
* Service object for ${object.@name} that will do the communication with the server.
* Implemented as singleton to allow caching of objects on the client side.
* Redora has generated the standard service methods in {@link ${object.@name}ServiceBase},
* you can add your custom methods here.
*
* @author Redora (www.redora.net)
*/
public class ${object.@name}Service extends ${object.@name}ServiceBase {
//As singleton: allows to cache result sets and pojos
private static ${object.@name}Service instance;
private ${object.@name}Service(ClientFactory clientFactory) {
super(clientFactory);
}
public static synchronized ${object.@name}Service getInstance() {
if (instance == null)
instance = new ${object.@name}Service(new ClientFactoryImpl());
return instance;
}
@Override
public boolean customResponse(int status, JSONObject responseJSON) {
return true;
}
@Override
public String getAuthInfo() {
return "";
}
}