A remote client of an enterprise bean has the following traits:
It can run on a different machine and a different Java virtual machine (JVM) than the enterprise bean it accesses. (It is not required to run on a different JVM.)
It can be a web component, an application client, or another enterprise bean.
To a remote client, the location of the enterprise bean is transparent.
To create an enterprise bean that allows remote access, you must do one of the following:
Decorate the business interface of the enterprise bean with the @Remote annotation:
@Remote public interface InterfaceName { ... }
Decorate the bean class with @Remote, specifying the business interface or interfaces:
@Remote(InterfaceName.class) public class BeanName implements InterfaceName { ... }
The remote interface defines the business and life cycle methods that are specific to the bean. For example, the remote interface of a bean named BankAccountBean might have business methods named deposit and credit. Figure 20–1 shows how the interface controls the client’s view of an enterprise bean.