Required Files for RMI Programs

The RMI module has several RMI templates available from the New Wizard. You can use the templates 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

Remote interface files are Java interfaces that extend java.rmi.Remote. The remote interface defines the interface of an RMI server. It is compiled to create the stub and skeleton files that enable a client and a 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. You also need a remote interface, which is required for compiling.

You can use an existing remote interface or you can write your own:

The RMI templates include a template named Remote that generates a remote interface that you complete in the IDE's editing window. The template wizard provides support for writing a remote interface, it provides you with dialog boxes that enable you to 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 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 your 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.

See also
RMI Technology
Steps for Creating an RMI Program

Legal Notices