Latest Tutorials| Questions and Answers|Ask Questions?|Site Map

Home Help Java I Java Remote Interface

Related Tutorials


Share on Google+Share on Google+

Java Remote Interface

The Remote interface identifies interfaces whose methods may be invoked remotely from a non-local virtual machine.

Java Remote Interface


The Remote interface identifies interfaces whose methods may be invoked remotely from a non-local virtual machine. Any remote object must directly or indirectly implement this interface. Implementation classes can implement any number of remote interfaces and can extend other remote implementation classes.

The methods specified in a "remote interface", extends java.rmi.Remote. Therefore, these methods must be defined as being capable of throwing a java.rmi.RemoteException. This exception is thrown by the RMI system from a remote method invocation to indicate that either a communication failure or a protocol error has occurred.

The Enterprise Java Bean (EJB) 2.0 specification also contains a remote client view in cases when you plan to use the bean in distributed environments.

To access a remote object, you first need to find it, which can usually be accomplished through the use of a directory or naming service, such as the RMI registry or JNDI

When you obtain a reference to a remote object through a directory service, you don't receive an actual reference to that object, but rather a reference to a stub object that implements the same interface as the remote object. The stub marshals the method parameters and converts them into a byte-stream representation. Then it sends the marshaled parameters over the network to a skeleton object, which unmarshals them and invokes the actual remote method you wanted to invoke. Then the method returns a value to the skeleton, the skeleton marshals the return value and transports it to the stub, and the stub unmarshals it and returns the value to the caller.


Read example at:




If you enjoyed this post then why not add us on Google+? Add us to your Circles

Liked it!  Share this Tutorial

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: June 19, 2009

Related Tutorials

Discuss: Java Remote Interface  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
deepak kumar sana
March 20, 2013
java programming lanuage

for learning