This article will discuss local interfaces, their proposed implementation, and issues that developers may expect to encounter when dealing with this technology. As everyone knows, session and entity beans have had home and remote interfaces, where business operations are defined. The latest EJB specification introduces the possibility of having local home and local interfaces in addition to the existing remote home and remote interfaces. As a result of this distinction, it makes sense to expect local clients to have optimized access to an EJB's operations as opposed to remote clients that are required to use RMI semantics. The EJB specification defines just that.
Local interfaces provide an appealing new aspect to developers.
Methods invoked on a local home or local interface of an EJB will only be invoked using pass by reference semantics. Essentially, it's nothing more than a method invocation on a local Java object. Writing local home and local interfaces is very similar to writing remote and remote home interfaces. The throws clause of all methods in the local home and local interfaces must not throw java.rmi.RemoteException . A local home interface must extend EJBLocalHome instead of EJBHome .