This might not directly answer your question but it'll hopefully help.
You will find all the moving pieces you need there. In my DAO, I am
injecting via @Autowired some beans (not shown in the example).
Proxy:
===============================================
@ProxyFor(value = Card.class, locator = CardLocator.class)
public interface CardProxy extends EntityProxy {
.....
===============================================
Entity:
===============================================
@Table(name = "cards")
@Entity
public class Card {
public class CardLocator extends Locator<Card, Integer>{
@Override
public Card create(Class<? extends Card> clazz) {
return new Card();
}
@Override
public Card find(Class<? extends Card> clazz, Integer id) {
return ((CardDAO) BeanContextUtil.getBean(CardDAO.class)).find(id);
}
.....
===============================================
RequestContext:
===============================================
@Service(value = CardDAO.class, locator = CardServiceLocator.class)
public interface CardRequestContext extends RequestContext {
....
===============================================
DAO:
===============================================
@Component
public class CardDAO {
....
===============================================
Service Locator:
===============================================
public class CardServiceLocator implements ServiceLocator {
@Override
public Object getInstance(Class<?> clazz) {
return BeanContextUtil.getBean(CardDAO.class);
}
}
===============================================
Bean Util:
===============================================
public class BeanContextUtil {
public BeanContextUtil() {
}
public static Object getBean(Class<?> clazz) {
HttpServletRequest request =
RequestFactoryServlet.getThreadLocalRequest();
ServletContext servletCtx = request.getSession().getServletContext();
ApplicationContext springCtx =
WebApplicationContextUtils.getWebApplicationContext(servletCtx);
return springCtx.getBean(clazz);
}
}
===============================================
Best regards,
Alfredo
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/google-web-toolkit/-/xLI56yX5k3MJ.