inheritance in Services that are used by RequestFactory RequestContext classes
Hallo,
I am using RequestFactory in my project.
What I would like to do is to have base class for some of my
GWT@Service classes which will be holding some common functionality
( e.g. CRUD operations)
First try to achieve that was creating structure like this:
// request definition on client side
@Service(CourseGwtService.class)
CourseRequest extends RequestContext
{
Request<CourseProxy> getConnectedCourse();
// .. other methods
}
// service definition on server (jboss) side
public class CourseGwtService extends BaseGwtService
{
// some specific methods
}
// base implementation for gwt services
public class BaseGwtService
{
public static Course getConnectedCourse( )
{
return courseDao.getConnectedCourse();
}
}
This code compiles without errors. But after running application and
calling getConnectedCourse() method :
requestFactory.courseRequest().getConnectedCourse( ).fire();
I am getting an exception:
java.lang.IllegalArgumentException: Unknown operation
shared.request.CourseRequest::getConnectedCourse
at
com.google.gwt.requestfactory.server.JsonRequestProcessor.getOperation(JsonRequestProcessor.java:
702) [:]
at
com.google.gwt.requestfactory.server.JsonRequestProcessor.processJsonRequest(JsonRequestProcessor.java:
844) [:]
at
com.google.gwt.requestfactory.server.JsonRequestProcessor.decodeAndInvokeRequest(JsonRequestProcessor.java:
232) [:]
So my questions are:
- can we use inheritance in @Service classes?
- can we use generics arguments in @Service classes? e.g. I would like
to create something like this:
BaseGwtService <T>
{
public static T getConnectedEntity( )
{
return dao.getConnectedEntity();
}
public static T save( T toSave)
{
return dao.save(T toSave);
}
}
regards and thanks in advance:)
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home