updated ramtune test app

git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@643 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
kascade 2007-04-20 00:33:48 +00:00
parent 6d164f0f7e
commit abc2838aac
1 changed files with 10 additions and 3 deletions

View File

@ -10,15 +10,22 @@ import static enginuity.util.ParamChecker.checkNotNull;
import static enginuity.util.ParamChecker.checkNotNullOrEmpty;
public final class CommandExecutorImpl implements CommandExecutor {
private final EcuConnection ecuConnection;
private final ConnectionProperties connectionProperties;
private final String port;
public CommandExecutorImpl(ConnectionProperties connectionProperties, String port) {
checkNotNull(connectionProperties);
checkNotNullOrEmpty(port, "port");
this.ecuConnection = new EcuConnectionImpl(connectionProperties, port);
this.connectionProperties = connectionProperties;
this.port = port;
}
public CommandResult executeCommand(Command command) {
return new CommandResultImpl(ecuConnection.send(command.getBytes()));
EcuConnection ecuConnection = new EcuConnectionImpl(connectionProperties, port);
try {
return new CommandResultImpl(ecuConnection.send(command.getBytes()));
} finally {
ecuConnection.close();
}
}
}