fai un applicazione RMI, il server risiede sulla macchina che ha il comando da eseguire e lo lanci da qualsiasi cliente.
public interface RemoteCommand extends Remote {
public StringBuffer runCommand(String myPathToCommand) throw RemoteException;
}
public class RemoteCommandImpl implements RemoteCommand extends UnicastRemoteObject {
.. bla bla ..
public StringBuffer runCommand(String myPathToCommand) throw RemoteException{
Runtime.getRuntime().exec(myPathToCommand);
..bla bla ... Riempi StringBuffer con output comando
return myStringBuffer;
}
}
spero di esserti stato di aiuto.
AP