Final Unit 5
Final Unit 5
stub
The stub is an object, acts as a gateway for the client side. All the
outgoing requests are routed through it.
It resides at the client side and represents the remote object. When
the caller invokes method on the stub object, it does the following
tasks:
1. It initiates a connection with remote Virtual Machine (JVM),
2. It writes and transmits (marshals) the parameters to the
remote Virtual Machine (JVM),
3. It waits for the result
4. It reads (unmarshals) the return value or exception, and
5. It finally, returns the value to the caller.
skeleton
The skeleton is an object, acts as a gateway for the server side
object. All the incoming requests are routed through it. When the
skeleton receives the incoming request, it does the following tasks:
1. It reads the parameter for the remote method
2. It invokes the method on the actual remote object, and
3. It writes and transmits (marshals) the result to the caller.
MessageImpl() throws
RemoteException{ super();
}
3) Create the Stub and Skeleton objects using the rmic Tool
The rmic tool invokes the RMI compiler and crates stub and
skeleton objects. Run following command in your terminal.
rmic Message
rmiregistry 5000
5) Create and Run the Server Application
Now rmi services need to be hosted in a server process. The Naming
class provides methods to get and store the remote object. In this
example, we are binding the remote object by the name rmiserver.
import java.rmi.*;
import java.rmi.registry.*;
ProductImpl.java
import java.rmi.*;
import java.rmi.server.*;
ProductImpl() throws
RemoteException{ super();
}
Client.java
import java.rmi.*;
IIOP
The CORBA standard includes specifications for inter-ORB
communication protocols that transmit object requests between
various ORBs running on the network.
The Inter-ORB Protocol (IIOP) is an inter-ORB protocol based on
TCP/IP and so is extensively used on the Internet.
POA
The POA connects the server object implementation to the ORB. It
extends the functionality of the ORB and some its services include:
activation and deactivation of the object implementations,
generation and management of object references, mapping of object
references to their implementations, and dispatching of client
requests to server objects through a skeleton.