* @throws ClientExecuteException when the configuration
* is incomplete.
*/
public void execute() throws ClientExecuteException {
if (targetModuleID==null) {
throw new ClientExecuteException(localStrings.getLocalString(
"enterprise.deployapi.actions.clientconfigurationimpl.nomoduleid",
"No moduleID for deployed application found"));
}
TargetImpl target = (TargetImpl) 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, System.getProperty("java.io.tmpdir"));
// 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);
} catch(Exception e) {
Logger.getAnonymousLogger().log(Level.WARNING, "Error occurred", e);
throw new ClientExecuteException(localStrings.getLocalString(
"enterprise.deployapi.actions.clientconfigurationimpl.exception",
"Exception while invoking application client : \n {0}", new Object[] { e.getMessage() }));
}
}