Remote Business Interfaces for Session Beans

It is possible to invoke a Session Bean over the network by declaring the interface of a session bean as Remote. This is done using the @Remote annotation, which is equal to having it extend the java.rmi.Remote interface.
The reference to the bean that gets aquired by a client is not a local reference on the same server but an RMI stub that can be used to invoke the session bean from another server or a client application.

Remote interfaces should only be used if the bean is to be invoked from another point than the server itself. Any calls to a session bean that is made on the same server should use a Local interface.
That is because the network overhead take their toll on performance. However, making remote calls are usually fare more efficient than calling web services using the SOAP-protocol,
since soap envelopes tend to add even more overhead.
Another thing to have in mind when using remote interfaces is that parameters (even if they’re objects) are passed by value, as opposed to making calls through local interfaces when they are passed by reference.
That means that any changes that are made on the server to the passed object will not reflect through to the client.
Objects that are sent through remote interfaces must also implement the interface, which is not necessary using local calls.

An example of a Remote interface:

Search for more Java info on this site here:
Custom Search

Please type any questions here.