public void disconnect() { if (isConnected()) { connected = false; messageHandler.disconnect(); messageHandler = null; } }
public void handleMessage(OutboundMessage message) { if (connected && messageHandler != null) { logger.debug("Sending " + message + " to " + this); messageHandler.handleMessage(message); } else { logger.warn(this + " not connected"); } }