当前位置: 代码迷 >> JBoss >> jboss-5.1.0.GA 怎么声明bean 既是remote也是local
  详细解决方案

jboss-5.1.0.GA 怎么声明bean 既是remote也是local

热度:9581   发布时间:2013-02-26 00:00:00.0
jboss-5.1.0.GA 如何声明bean 既是remote也是local
@Stateless
@Remote
@Local
public class ……


这样会出错,要如何声明?

------解决方案--------------------------------------------------------
是这样申明的,你可以这样来设计比价好,
public interface StudentRemote{ //这里面可以些你的远程接口
...
}
public interface Student extends StudentRemote{ //这里面写你的本地借口
.....
}

@Stateless
@Local({Student.class})
@Remote({StudentRemote.class})
public class StudentBean implements Student{
......
}
------解决方案--------------------------------------------------------
楼上不错,是个无状态的会话bean
  相关解决方案