Stub creation

For any distributed application, the client must know what object it is going to contact, and which method of this object it must call. Because the ORB is a general framework, you must give it general information about the method that you want to call.

You provide the connection information by implementing a Java™ interface, for example Sample. The interface contains basic information about the methods that can be called in the remote object.
This picture shows stub creation with the Sample Java interface

The client relies on the existence of a server containing an object that implements the Sample interface. You create a proxy object that is available on the client side for the client application to use. The proxy object is called a stub. The stub that acts as an interface between the client application and the ORB.

To create the stub, run the RMIC compiler on the Java interface:
rmic -iiop Sample

This command generates a file and object named _Sample_Stub.class.

The presence of a stub is not always mandatory for a client application to operate. When you use particular CORBA features such as the Dynamic Invocation Interface (DII), you do not require a stub. The reason is that the proxy code is implemented directly by the client application. You can also upload a stub from the server to which you are trying to connect. See the CORBA specification for further details.