且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我可以在远程/本地接口中使用继承吗? (EJB3)

更新时间:2022-12-04 19:32:59

不允许使用您的方式,因为您不能根据规范同时使用@Local和@Remote批注来标记您的界面.从代码读取的角度来看,这不是一个好主意.

Your way is not allowed as you can not mark your interface with both @Local and @Remote annotations according to specification. And it is not a good idea from point of code reading.

推荐的解决方案是

public interface SomeComponent {
    public Something processStuff();
}

@Local
public interface SomeComponentLocal extends SomeComponent {
}

@Remote
public interface SomeComponentRemote extends SomeComponent {
}