Information Technology Reference
In-Depth Information
Table 5.1.
RMI generated output files.
Type
Name
Purpose
Client Files
ClockService.class
The client class file that connects to the
remote service getDate() contained in the
generated ClockDate server class
_IClockDate.class
The RemoteJ generated RMI interface class
Server Files
ClockDate.class
The server class file that contains the re-
mote service getDate()
RMIServer.class
The RemoteJ generated RMI server class
using the setHosts() method. If a list of hosts is defined, it is used by the
recovery routine to bind to an alternate server if the current server becomes
unavailable.
registryPort. Defines the RMI registry port number used by clients to bind to a
server. If the runEmbeddedRegistry option described below is defined, it is
used as the port number for the embedded registry.
runEmbeddedRegistry. If defined, an embedded RMI registry is started. If not, the
registry defined by the registryHost and registryPort options must be
available at runtime for the generated server to export the remote objects to,
and for the generated client to bind to, so that it may locate the exported
objects.
serverPlugin. This optional statement is used to add a user-defined class to be
started in a thread in the server-generated code. It is provided to allow for
advanced user-defined recovery scenarios as described in Section 5.3.
servers. This optional statement is used to define a comma-separated list of servers
that clients may connect to. If defined, it is used by the nextServer state-
ment to connect to an alternate server in the event of a communication or dis-
tribution error. This may be overridden by the remotej.servers command
line option. If neither servers nor remotej.servers have been defined, the
application will terminate.
Given a DDL with the single pointcut statement illustrated in Figure 5.6,
the classes in Table 5.1 are generated.
The RMI implementation has the following code generation phases:
Interface generation phase. Used to generate interfaces that extend the
java.rmi.Remote interface and contain all matching methods referred
to in the DDL. If more than one class is matched by a pointcut in the DDL,
multiple interfaces are generated, one for each class containing the matched
methods of that class.
Server generation phase. Matching classes and associated methods defined in the
DDL are altered to implement the interface described above.
 
Search WWH ::




Custom Search