11.5. Creating Stub and Skeleton Classes

The stub and skeleton classes are responsible for dispatching and processing RMI requests. Developers should not write these classes, however. Once a service implementation exists, the rmic tool, which ships with the JDK, should be used to create them.

The implementation and interface should be compiled, and then the following typed at the command line:

rmic implementation

where implementation is the name of the service implementation class.

For example, if the class files for the RMILightBulb system are in the current directory, the following would be typed to produce stub and skeleton classes:

rmic RMILightBulbImpl

Two files would then be produced in this case:

  • RMILightBulbImpl_Stub.class

  • RMILightBulbImpl_Skeleton.class ...

Get Java™ Network Programming and Distributed Computing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.