I'm doing my first steps on RequestFactory. I managed to make it work by
different ways:
1. implementing the service methods as static methods on the entity class
2. implementing the service methods as static methods on a locator class
3. implementing the service methods as instance methods on a locator class,
providing a service locator on the @Service annotation. I could even use a
generic service locator
I want my service methods implemented on the server as instance methods, but
I want to avoid having to specify the service locator on all my
RequestContext interfaces.
I thought I could do that by implementing my on ServiceLayerDecorator which
always returns my generic service locator class on the resolveServiceLocator
method but id didn't work
This is my service layer decorator:
public class GuiceServiceLayerDecorator extends ServiceLayerDecorator {
public Class<? extends ServiceLocator> resolveServiceLocator(Method
contextMethod,
Method domainMethod) {
return GuiceRequestFactoryServiceLocator.class;
}
}
And this is my RequestFactoryServlet subclass, where I instantiate the
service layer decorator:
public class MyRequestFactoryServlet extends RequestFactoryServlet {
public MyRequestFactoryServlet() {
super(new DefaultExceptionHandler(), new GuiceServiceLayerDecorator());
}
}
And of course I'm serving "/gwtRequest" with MyRequestFactoryServlet instead
of RequestFactoryServlet
--
Magno Machado Paulo
http://blog.magnomachado.com.br
http://code.google.com/p/emballo/
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.