This method performs an exec and starts the
application client running in another process.
if (targetModuleID==null) {
throw new ClientExecuteException(localStrings.getLocalString(
"enterprise.deployapi.actions.clientconfigurationimpl.nomoduleid",
"No moduleID for deployed application found"));
}
SunTarget target = (SunTarget) targetModuleID.getTarget();
String moduleID;
if (targetModuleID.getParentTargetModuleID()!=null) {
moduleID = targetModuleID.getParentTargetModuleID().getModuleID();
} else {
moduleID = targetModuleID.getModuleID();
}
try {
// retrieve the stubs from the server
String location = target.exportClientStubs(moduleID, 0, System.getProperty("java.io.tmpdir"));
// get the module id for the appclient
String id = targetModuleID.getModuleID();
if (id.indexOf('#")!=-1) {
id = id.substring(id.indexOf('#")+1);
}
// invoke now the appclient...
String j2eeHome = System.getProperty("com.sun.aas.installRoot");
String appClientBinary = j2eeHome + File.separatorChar + "bin" + File.separatorChar + "appclient";
String command = appClientBinary + " -client " + location;
Process p = Runtime.getRuntime().exec(command);
InputStream is = p.getInputStream();
} catch(Exception e) {
e.printStackTrace();
throw new ClientExecuteException(localStrings.getLocalString(
"enterprise.deployapi.actions.clientconfigurationimpl.exception",
"Exception while invoking application client : \n {0}", new Object[] { e.getMessage() }));
}