Generating a Server-side File

You can generate a server-side file using the RMI wizard or the RMI templates.

To generate server-side files using the RMI wizard:

  1. Decide what type of implementation you want to create.
  2. From the main window, choose Tools  RMI Wizard.

    The first pane of the wizard is an introduction to RMI.

  3. On the second pane, specify the filesystem and package in which the wizard should place the files it generates.
  4. On the third pane, specify the remote interface you are creating for your server program.

    If the Next button is disabled, a file with the same name already exists.

  5. On the fourth pane of the wizard, define your remote interface:
  6. On the fifth pane of the wizard, choose values that describe the type of implementation class that you want the wizard to create:
  7. On the sixth pane of the wizard, review the information you have entered in the wizard. Click Finsh to create the file or Back to edit your information.

    When you click Finish, the IDE generates the file and displays it in the Source Editor and Explorer windows.

To generate server-side files using the RMI templates:

  1. Decide what kind of implementation you want to create.

    There are RMI templates for each of the RMI base class types (UnicastRemoteObject, Activatable, RMIIIOP) and for implementation classes that do not extend one of the base classes (ClearObject

  2. If you are creating an implementation of an existing remote interface, copy that interface to the package in which you are creating the implementation.
  3. From the main window, choose File  New
  4. In the New From Template wizard, expand the RMI node.
  5. Create a remote interface:

    To create an implementation of an existing remote interface, select one of these templates:

    To create a new remote interface and an implementation for it, select one of these templates:

  6. On the second pane of the wizard, enter a name for your server file and the package in which it should be generated.

    If you are using one of the _Impl templates to implement an existing remote interface, use a name that matches the interface name. For example, if you are implementing an interface named Hello, name your implementation class HelloImpl. The RMI module will declare your class as an implementation of the interface and generate method bodies for methods declared in the remote interface.

  7. Click Finish.

    The IDE creates an RMI server source file called Name_You_Specified.java. If you used an _Impl template and used a name that matches the interface name, the IDE will declare your implementation class as an implementation of the interface and generate method bodies for methods declared in the interface. If you used a group template the IDE also generates a remote interface.

See also
Adding Code to a Server-side File
Compiling a Server-side File
Browsing RMI Registries

Legal Notices