문제

I have a Session Bean like this:

@Stateless
@Local(MySessionBeanInterface.class)
public class MySessionBean implements MySessionBeanInterface {

}

I wanted to know if its okay to implement another interface as well. For instance, I have interface called, MyXYXInterface. I want the above bean to implement this as well.

@Stateless
@Local(MySessionBeanInterface.class)
public class MySessionBean implements MySessionBeanInterface, MyXYZInterface {

}

So, in the context of EJB's / Session Beans, is it a bad thing? does it interfere with treatment of EJBs in the container?

도움이 되었습니까?

해결책

There are no problems with implementing additional interfaces in addition to EJB so long as you use @Local explicitly (either on the EJB or on one of the interfaces on the implements clause). If you don't use @Local, then the EJB container will "infer" the local interface, and if you add additional interfaces to the implements clause, that will cause problems.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top