If your EJB implements any interface, but you do not specify (neither the EJB, nor the interface itself) which interface it is (@Remote, @Local), than it suggested that it is @Local.
Therefore your code:
public interface MyBeanIntf { void doStuff(); } @Stateless public class MyBean implements MyBeanIntf { public void doStuff(){ } }
semantically identical to the following:
@Local public interface MyBeanIntf { void doStuff(); } @Stateless public class MyBean implements MyBeanIntf { public void doStuff(){ } }
When it comes to the second part of your question, I think that section 4.9.2.1 Session Bean Superclasses from EJB 3.1 FR spec will be interesting for you. From my understanding (so that this may be wrong), it seems that your Bean should not be construed as exposing a valid local interface due to the following passage:
@Stateless public class A implements Foo { ... } @Stateless public class B extends A implements Bar { ... }
Assuming Foo and Bar are local business interfaces and there is no associated deployment descriptor, the Bean session exposes the local Foo business interface and the Bean B session provides the local business interface, but not Foo .
The Bean B session will need to explicitly include Foo in its set of open views for this interface.
Update:
In addition, another excerpt from the specification:
A Bean session series is allowed to have superclasses that are Bean sessions themselves. However, there are no special rules that apply to processing annotations or deploying a descriptor for this case. In order to handle a particular session Bean class, all processing of the superclass is identical regardless of whether the superclasses themselves are Bean classes.
Piotr nowicki
source share