Java Reference
In-Depth Information
String[] getProjects();
String[] getMilestones(String project);
String addEntries(Vector<TimeEntryData> entries) throws
NotLoggedInException;
Vector<TimeEntryData> getEntries() throws NotLoggedInException;
}
■
Note
Notice the @RemoteServiceRelativePath annotation. You'll define this path in the deployment
descriptor based on the relative path of the base URL.
The guts of your service reside in the
DataServiceImpl
class shown in Listing 7-8. The
methods defined in your interface are implemented in addition to a number of helper
methods. This class extends GWT
RemoteServiceServlet
and does the heavy lifting of
serializing responses and deserializing requests for you. Since the servlet runs as Java
bytecode instead of JavaScript on the client, you are not hamstrung by the
functionality of the browser.
Listing 7-8. The entire listing for DataServiceImpl.java
package com.appirio.timeentry.server;
import java.util.List;
import java.util.Vector;
import java.util.logging.Logger;
import java.util.logging.Level;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;
import javax.jdo.JDOHelper;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
import com.appirio.timeentry.client.NotLoggedInException;
import com.appirio.timeentry.client.DataService;
import com.appirio.timeentry.client.TimeEntryData;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;