The Files You Need for RMI Programs

The RMI module has an RMI wizard and several RMI templates. You can use either tool to generate Java source files (.java files) for the different parts of RMI programs. The kind of RMI program you are writing determines the files you need to generate.

Remote Interface Files

This is a Java interface that extends java.rmi.Remote. The remote interface defines the interface of an RMI server. It is compiled to create the stub and skeleton files that allow client and server to communicate. On the server side, you need a remote interface in the package with your implementation class.  On the client side, you need to know the method signatures declared in the remote interface, because your client will be invoking these methods.

The RMI module lets use an existing remote interface or write your own:

The RMI templates include a template named RemoteInterface that generates a remote interface that you complete in the IDE's editing window. The RMI wizard provides more support for writing a remote interface; it has buttons that add interface elements in correct syntax.

Client-side Files

The files you need for a client-side program are: If you are writing a client program to access an existing RMI server, you will need a copy of the remote interface, which contains method signatures for the server-side methods your program can invoke.

Server-side Files

The files you need for a server-side program are: If you are using the RMI templates to generate you server-side files, you should generate and complete a remote interface (or obtain a copy of an existing interface) before generating the other server-side files. If you are using the RMI Wizard, the wizard can help you write a remote interface.

Legal Notices