void connect() throws ControllerException { this.write.lock(); try { checkState(!this.manager.isConnected(),"Already connected"); this.manager.connect(); declareExchange(); prepareQueue(); } catch(final ControllerException e) { disconnectGracefully(); throw e; } finally { this.write.unlock(); } }