Java Reference
In-Depth Information
an application could register persistently some data (both on the client and on the server) or
perform some logging mechanism, etc.
Also in Table 7.1, some lifecycle phases are mapped on runtime services (“ see runtime ser-
vices ”in the second column). This means that in order to use a given deployment service, the
client application should use the related runtime service. An example of this is given in the log
method discussed in Listing 7.8.
After having mapped our abstract model to the deploylet class framework in a theoretical, top-
down fashion, we are ready to see the code details.
The Implementation
First of all, let's see the Deploylet interface, shown in Listing 7.9. This interface captures the
behavior of deploylet entities discussed before, and needs to be implemented both on the client
side (by the ClientDeploylet class and all its subclasses) and on the server side
( ServerDeployment and all its subclasses) in order for the deployment circuit to work.
L ISTING 7.9 The Deploylet Interface
package com.marinilli.b2.c7.deploylet;
import java.rmi.*;
* Chapter 7 - Deployable interface
* This interface models the lifecycle of a deployable application,
* abstracting from its client/server actual implementation.
* @author Mauro Marinilli
* @version 1.0
public interface Deploylet extends Remote {
// lifecycle methods
* triggers the publication phase
public void publish() throws RemoteException;
* implements the resolution phase
public void resolve() throws RemoteException;
Search WWH ::

Custom Search