GWT RequestFactory:将接口继承到RequestContext中

时间:2011-02-16 21:29:00

标签: gwt requestfactory

我有我的OrganizationRequestContext接口,效果很好:

@Service(OrganizationDAO.class)
public interface OrganizationRequestContext extends RequestContext
{
    Request<OrganizationProxy> findOrganization(Long id);

    InstanceRequest<OrganizationProxy, Void> persist();
    InstanceRequest<OrganizationProxy, Void> remove();
}

现在我想把最后两个函数放在我自己设计的PersistentRequestContext中,这样我就可以在客户端代码中对待所有的RequestContexts:

public interface PersistableRequestContext<T extends BaseProxy>
{
    InstanceRequest<T, Void> persist();
    InstanceRequest<T, Void> remove();
}

...

@Service(OrganizationDAO.class)
public interface OrganizationRequestContext extends RequestContext, PersistentRequestContext<OrganizationProxy>
{
    Request<OrganizationProxy> findOrganization(Long id);
}

但验证失败:服务器抱怨

[ERROR] com.activegrade.shared.data.PersistableRequestContext is not a RequestContext

如果我使PersistableRequestContext扩展RequestContext,那么服务器会抱怨它没有链接到任何特定的DAO服务。

有没有办法在我的各种RequestContext接口中扩展除RequestContext之外的公共接口?

1 个答案:

答案 0 :(得分:0)

此问题已在GWT 2.4中修复。谢谢谷歌!

http://code.google.com/p/google-web-toolkit/issues/detail?id=6035