You can generate a server-side file using the RMI wizard or the RMI templates.
To generate server-side files using the RMI wizard:
The first pane of the wizard is an introduction to RMI.
yourName.java
,
containing a remote interface named yourName
.
If the Next button is disabled, a file with the same name already exists.
interfaceNameImpl
.
If you accept the default name, the wizard will generate a class named interfaceNameImpl
in a file named interfaceNameImpl.java
.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:
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
)
To create an implementation of an existing remote interface, select one of these templates:
Activatable_Impl
ClearUnicastObject_Impl
RMIIIOP_Impl
UnicastRemoteRemoteObject_Impl
To create a new remote interface and an implementation for it, select one of these templates:
Activatable Server (group)
ClearObject
(group)
IIOP Server (group)
Unicast
Server (group)
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.
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 |