Java Reference
In-Depth Information
L ISTING 7.11 Continued
/** Implements the related Deploylet method */
public void stopApplication() {
//
try {
String serverName = “rmi://localhost/deployletRepository”;
ServerRepository server = (ServerRepository)
Naming.lookup(serverName);
if (server!=null) {
server.remove(this.getName());
}
} catch (Exception e) {
System.out.println(“ServerDeploylet during
ServerRepository lookup: “+e);
}
}
/** Implements the related Deploylet method */
public void initApplication() {
}
/** Implements the related Deploylet method */
public ServiceResult requestService(DeploymentService ds) {
System.out.println(“requestedService=”+ds);
if (ds instanceof DebugService) {
//process debug service
return processDebugService((DebugService)ds);
}
return null;
}
/**
*
*/
private ServiceResult processDebugService(DebugService ds){
Object[] s = ds.getContents();
System.out.println(“Processing Debug message:”);
System.out.println(“message=”+s[0].toString()+”\nDeploylet
log=\n”+s[1].toString());
return null;
}
/** Implements the related Deploylet method */
public Deploylet getServer() {
Search WWH ::




Custom Search