Local accessibility is the default accessibility of an enterprise bean. If the bean’s business interface is not decorated with @Local or @Remote, and the bean class does not specify the interface using @Local or @Remote, the business interface is by default a local interface. An enterprise bean that allows only local access can be created in any of the following two ways:
By annotating the business interface of the enterprise bean as a @Local interface:
@Local
public interface InterfaceName { … }
By decorating the bean class with @Local and specifying the interface name.
@Local(InterfaceName.class)
public class BeanName implements InterfaceName { … }
Responses to “How to build an enterprise bean that allows only local access?”