/** Shut down communication with the autosampler. */ public void disconnect() { if (m_reader != null) { m_reader.quit(); m_reader.interrupt(); } if (m_sender != null) { m_sender.quit(); m_sender.interrupt(); } if (m_statusPoller != null) { m_statusPoller.quit(); m_statusPoller.interrupt(); } if (m_CryoSocket != null) { m_CryoSocket.disconnect(); m_CryoSocket = null; } }
/** * Send a command to the cryobay. * * @param commandMessage The string to send to the cryobay. * @return True if there is a connection to the cryobay */ public synchronized boolean sendToCryoBay(String command) { if (m_sender == null) { m_sender = new Sender(null, m_retries, this); m_sender.start(); } if (isConnected()) { m_sender.addCommand(command); // TODO: (Java 5) Release semaphore here // m_sender.interrupt(); // Wake up the run() method return true; } else { return false; } }
/** * Does the work for processReply. * * @see #processReply */ private void processReplyInEventThread(String what, boolean value) { // Messages.postDebug("cryocmd", "CryoSocketControl.processReply(" // + what + ", " + value + ")"); if (debug) System.out.println("CryoSocketControl.gotReply: " + what); if (what != null) { m_sender.gotReply(value); processStatus(what, value); } }