Stub and Skeleton

11 Mar 2011 by

Stub and Skeleton

Stub and Skeleton

Java RMI is powerful middleware that replaces raw request/reply method as UDP and TCP. The core technology to make it works is Stub and Skeleton function. Stub is located on the client side while Skeleton is located on server side. The role of stub and skeleton is to do marshalling and unmarshalling meaning that it will squash the argument and return value of a method to be a standard format for storing in a file or transferring over the network. Without Stub and Skeleton, java RMI cannot work.

Note on Stub and Skel files (Skeleton)

  • Java JDK 1.6 does not require to have Stub and Skeleton file (Skel for short) as it takes advantage of reflection to accomplish the task
  • Java JDK 1.5, it requires only Stub file at the client. To generate stub file:
    • rmic PowerServer
    • PowerServer_Stub.class will be generated
  • Java JDK prior to 1.4 (not quite sure), it requires both Stub and Skel files
    • rmic -vcompat PowerServer
    • PowerServer_Stub.class and PowerServer_Skel.class will be generated

2 responses so far

Leave a Reply