}
private void send(X10Event[] events) throws CruiseControlException {
LOG.info("Sending X10 events...");
Transmitter transmitter = getTransmitter();
if (port != null) {
((SerialGateway) transmitter).setPortName(port);
}
try {
((Gateway) transmitter).allocate();
} catch (Exception e) {
throw new CruiseControlException("Trouble allocating the x10 gateway.", e);
}
for (int j = 0; j < events.length; j++) {
LOG.debug("Transmitting: " + events[ j ]);
try {
transmitter.transmit(events[ j ]);
} catch (IOException e) {
throw new CruiseControlException("Trouble transmitting event " + events[ j ], e);
}
}