@Override public void start() { super.start(); synchronized (this) { try { Class syslogClass = syslogConfig.getSyslogClass(); syslog = (SyslogIF) syslogClass.newInstance(); syslog.initialize(syslogClass.getSimpleName(), syslogConfig); } catch (ClassCastException | IllegalAccessException | InstantiationException cse) { throw new SyslogRuntimeException(cse); } } }
@Override public void stop() { super.stop(); clear(); } }
public synchronized void doAppend(E eventObject) { // WARNING: The guard check MUST be the first statement in the // doAppend() method. // prevent re-entry. if (guard) { return; } try { guard = true; if (!this.started) { if (statusRepeatCount++ < ALLOWED_REPEATS) { addStatus(new WarnStatus( "Attempted to append to non started appender [" + name + "].", this)); } return; } if (getFilterChainDecision(eventObject) == FilterReply.DENY) { return; } // ok, we now invoke derived class' implementation of append this.append(eventObject); } catch (Exception e) { if (exceptionCount++ < ALLOWED_REPEATS) { addError("Appender [" + name + "] failed to append.", e); } } finally { guard = false; } }
/** * Options are activated and become effective only after calling this method. */ public void start() { int errors = 0; if (this.layout == null) { addStatus(new ErrorStatus("No layout set for the RocketmqLogbackAppender named \"" + name + "\".", this)); errors++; } if (errors > 0 || !checkEntryConditions()) { return; } try { producer = ProducerInstance.getProducerInstance().getInstance(nameServerAddress, producerGroup); } catch (Exception e) { addError("Starting RocketmqLogbackAppender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } if (producer != null) { super.start(); } }
@Override public void stop() { super.stop(); synchronized(this) { if (syslog != null) { syslog.shutdown(); syslog = null; } } }
public synchronized void doAppend(E eventObject) { // WARNING: The guard check MUST be the first statement in the // doAppend() method. // prevent re-entry. if (guard) { return; } try { guard = true; if (!this.started) { if (statusRepeatCount++ < ALLOWED_REPEATS) { addStatus(new WarnStatus( "Attempted to append to non started appender [" + name + "].", this)); } return; } if (getFilterChainDecision(eventObject) == FilterReply.DENY) { return; } // ok, we now invoke derived class' implementation of append this.append(eventObject); } catch (Exception e) { if (exceptionCount++ < ALLOWED_REPEATS) { addError("Appender [" + name + "] failed to append.", e); } } finally { guard = false; } }
public void start() { cb = new CyclicBuffer<E>(maxSize); super.start(); }
public void stop() { cb = null; super.stop(); }
public synchronized void doAppend(E eventObject) { // WARNING: The guard check MUST be the first statement in the // doAppend() method. // prevent re-entry. if (guard) { return; } try { guard = true; if (!this.started) { if (statusRepeatCount++ < ALLOWED_REPEATS) { addStatus(new WarnStatus("Attempted to append to non started appender [" + name + "].", this)); } return; } if (getFilterChainDecision(eventObject) == FilterReply.DENY) { return; } // ok, we now invoke derived class' implementation of append this.append(eventObject); } catch (Exception e) { if (exceptionCount++ < ALLOWED_REPEATS) { addError("Appender [" + name + "] failed to append.", e); } } finally { guard = false; } }
/** * Options are activated and become effective only after calling this method. */ public void start() { int errors = 0; if (this.layout == null) { addStatus(new ErrorStatus("No layout set for the RocketmqLogbackAppender named \"" + name + "\".", this)); errors++; } if (errors > 0 || !checkEntryConditions()) { return; } try { producer = ProducerInstance.getProducerInstance().getInstance(nameServerAddress, producerGroup); } catch (Exception e) { addError("Starting RocketmqLogbackAppender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } if (producer != null) { super.start(); } }
@Override public void stop() { if (sos != null) { sos.close(); } super.stop(); }
public synchronized void doAppend(E eventObject) { // WARNING: The guard check MUST be the first statement in the // doAppend() method. // prevent re-entry. if (guard) { return; } try { guard = true; if (!this.started) { if (statusRepeatCount++ < ALLOWED_REPEATS) { addStatus(new WarnStatus("Attempted to append to non started appender [" + name + "].", this)); } return; } if (getFilterChainDecision(eventObject) == FilterReply.DENY) { return; } // ok, we now invoke derived class' implementation of append this.append(eventObject); } catch (Exception e) { if (exceptionCount++ < ALLOWED_REPEATS) { addError("Appender [" + name + "] failed to append.", e); } } finally { guard = false; } }
peerId = "remote peer " + remoteHost + ":" + port + ": "; task = getContext().getExecutorService().submit(this); super.start();
/** * {@inheritDoc} */ @Override public void stop() { if (!isStarted()) return; CloseUtil.closeQuietly(socket); task.cancel(true); if(connectorTask != null) connectorTask.cancel(true); super.stop(); }
public synchronized void doAppend(E eventObject) { // WARNING: The guard check MUST be the first statement in the // doAppend() method. // prevent re-entry. if (guard) { return; } try { guard = true; if (!this.started) { if (statusRepeatCount++ < ALLOWED_REPEATS) { addStatus(new WarnStatus("Attempted to append to non started appender [" + name + "].", this)); } return; } if (getFilterChainDecision(eventObject) == FilterReply.DENY) { return; } // ok, we now invoke derived class' implementation of append this.append(eventObject); } catch (Exception e) { if (exceptionCount++ < ALLOWED_REPEATS) { addError("Appender [" + name + "] failed to append.", e); } } finally { guard = false; } }
@Override public void start() { if (isStarted()) return; try { ServerSocket socket = getServerSocketFactory().createServerSocket( getPort(), getBacklog(), getInetAddress()); ServerListener<RemoteReceiverClient> listener = createServerListener(socket); runner = createServerRunner(listener, getContext().getExecutorService()); runner.setContext(getContext()); getContext().getExecutorService().execute(runner); super.start(); } catch (Exception ex) { addError("server startup error: " + ex, ex); } }
@Override public void stop() { if (!isStarted()) return; try { runner.stop(); super.stop(); } catch (IOException ex) { addError("server shutdown error: " + ex, ex); } }
public synchronized void doAppend(E eventObject) { // WARNING: The guard check MUST be the first statement in the // doAppend() method. // prevent re-entry. if (guard) { return; } try { guard = true; if (!this.started) { if (statusRepeatCount++ < ALLOWED_REPEATS) { addStatus(new WarnStatus( "Attempted to append to non started appender [" + name + "].", this)); } return; } if (getFilterChainDecision(eventObject) == FilterReply.DENY) { return; } // ok, we now invoke derived class' implementation of append this.append(eventObject); } catch (Exception e) { if (exceptionCount++ < ALLOWED_REPEATS) { addError("Appender [" + name + "] failed to append.", e); } } finally { guard = false; } }
@Override public void stop() { super.stop(); } }