/** * Stop this appender instance. The underlying stream or writer is also * closed. * * <p> * Stopped appenders cannot be reused. */ public void stop() { lock.lock(); try { closeOutputStream(); super.stop(); } finally { lock.unlock(); } }
/** * <p> * Sets the @link OutputStream} where the log output will go. The specified * <code>OutputStream</code> must be opened by the user and be writable. The * <code>OutputStream</code> will be closed when the appender instance is * closed. * * @param outputStream * An already opened OutputStream. */ public void setOutputStream(OutputStream outputStream) { lock.lock(); try { // close any previously opened output stream closeOutputStream(); this.outputStream = outputStream; if (encoder == null) { addWarn("Encoder has not been set. Cannot invoke its init method."); return; } encoderInit(); } finally { lock.unlock(); } }
/** * Stop this appender instance. The underlying stream or writer is also * closed. * * <p> * Stopped appenders cannot be reused. */ public void stop() { synchronized (lock) { closeOutputStream(); super.stop(); } }
/** * Stop this appender instance. The underlying stream or writer is also * closed. * * <p> * Stopped appenders cannot be reused. */ public void stop() { synchronized (lock) { closeOutputStream(); super.stop(); } }
/** * Stop this appender instance. The underlying stream or writer is also * closed. * * <p> * Stopped appenders cannot be reused. */ public void stop() { lock.lock(); try { closeOutputStream(); super.stop(); } finally { lock.unlock(); } }
/** * Stop this appender instance. The underlying stream or writer is also * closed. * * <p> * Stopped appenders cannot be reused. */ public void stop() { lock.lock(); try { closeOutputStream(); super.stop(); } finally { lock.unlock(); } }
/** * Stop this appender instance. The underlying stream or writer is also * closed. * * <p> * Stopped appenders cannot be reused. */ public void stop() { lock.lock(); try { closeOutputStream(); super.stop(); } finally { lock.unlock(); } }
/** * Stop this appender instance. The underlying stream or writer is also * closed. * * <p> * Stopped appenders cannot be reused. */ public void stop() { lock.lock(); try { closeOutputStream(); super.stop(); } finally { lock.unlock(); } }
/** * Stop this appender instance. The underlying stream or writer is also * closed. * * <p> * Stopped appenders cannot be reused. */ public void stop() { lock.lock(); try { closeOutputStream(); super.stop(); } finally { lock.unlock(); } }
/** * <p> * Sets the @link OutputStream} where the log output will go. The specified * <code>OutputStream</code> must be opened by the user and be writable. The * <code>OutputStream</code> will be closed when the appender instance is * closed. * * @param outputStream * An already opened OutputStream. */ public void setOutputStream(OutputStream outputStream) { lock.lock(); try { // close any previously opened output stream closeOutputStream(); this.outputStream = outputStream; if (encoder == null) { addWarn("Encoder has not been set. Cannot invoke its init method."); return; } encoderInit(); } finally { lock.unlock(); } }
/** * <p> * Sets the @link OutputStream} where the log output will go. The specified * <code>OutputStream</code> must be opened by the user and be writable. The * <code>OutputStream</code> will be closed when the appender instance is * closed. * * @param outputStream * An already opened OutputStream. */ public void setOutputStream(OutputStream outputStream) { lock.lock(); try { // close any previously opened output stream closeOutputStream(); this.outputStream = outputStream; if (encoder == null) { addWarn("Encoder has not been set. Cannot invoke its init method."); return; } encoderInit(); } finally { lock.unlock(); } }
/** * <p> * Sets the @link OutputStream} where the log output will go. The specified * <code>OutputStream</code> must be opened by the user and be writable. The * <code>OutputStream</code> will be closed when the appender instance is * closed. * * @param outputStream * An already opened OutputStream. */ public void setOutputStream(OutputStream outputStream) { lock.lock(); try { // close any previously opened output stream closeOutputStream(); this.outputStream = outputStream; if (encoder == null) { addWarn("Encoder has not been set. Cannot invoke its init method."); return; } encoderInit(); } finally { lock.unlock(); } }
/** * <p> * Sets the @link OutputStream} where the log output will go. The specified * <code>OutputStream</code> must be opened by the user and be writable. The * <code>OutputStream</code> will be closed when the appender instance is * closed. * * @param outputStream * An already opened OutputStream. */ public void setOutputStream(OutputStream outputStream) { lock.lock(); try { // close any previously opened output stream closeOutputStream(); this.outputStream = outputStream; if (encoder == null) { addWarn("Encoder has not been set. Cannot invoke its init method."); return; } encoderInit(); } finally { lock.unlock(); } }
/** * <p> * Sets the @link OutputStream} where the log output will go. The specified * <code>OutputStream</code> must be opened by the user and be writable. The * <code>OutputStream</code> will be closed when the appender instance is * closed. * * @param outputStream * An already opened OutputStream. */ public void setOutputStream(OutputStream outputStream) { lock.lock(); try { // close any previously opened output stream closeOutputStream(); this.outputStream = outputStream; if (encoder == null) { addWarn("Encoder has not been set. Cannot invoke its init method."); return; } encoderInit(); } finally { lock.unlock(); } }
/** * <p> * Sets the @link OutputStream} where the log output will go. The specified * <code>OutputStream</code> must be opened by the user and be writable. The * <code>OutputStream</code> will be closed when the appender instance is * closed. * * @param outputStream * An already opened OutputStream. */ public void setOutputStream(OutputStream outputStream) { synchronized (lock) { // close any previously opened output stream closeOutputStream(); this.outputStream = outputStream; if (encoder == null) { addWarn("Encoder has not been set. Cannot invoke its init method."); return; } encoderInit(); } }
/** * <p> * Sets the @link OutputStream} where the log output will go. The specified * <code>OutputStream</code> must be opened by the user and be writable. The * <code>OutputStream</code> will be closed when the appender instance is * closed. * * @param outputStream * An already opened OutputStream. */ public void setOutputStream(OutputStream outputStream) { synchronized (lock) { // close any previously opened output stream closeOutputStream(); this.outputStream = outputStream; if (encoder == null) { addWarn("Encoder has not been set. Cannot invoke its init method."); return; } encoderInit(); } }
private void connectSocketAndDispatchEvents(FutureTask<Boolean> connectionFuture) { try { while (socketConnectionCouldBeEstablished()) { try { socket.setSoTimeout(acceptConnectionTimeout); setOutputStream(socket.getOutputStream()); connectionFuture.run(); addInfo(peerId + "connection established"); dispatchEvents(); } catch (IOException ex) { addInfo(peerId + "connection failed: " + ex); } catch (Exception e) { addError("Error in connect loop", e); } finally { CloseUtil.closeQuietly(socket); socket = null; super.closeOutputStream(); addInfo(peerId + "connection closed"); } } } catch (InterruptedException ex) { assert true; // ok... we'll exit now } addInfo("shutting down"); }