@Override public synchronized void startInternal() throws LifecycleException { try { // direct coupling with LogbackValve implementation FieldUtils.writeField(this, "scheduledExecutorService", ExecutorServiceUtil.newScheduledExecutorService(), true); FieldUtils.writeField(this, "started", true, true); setState(LifecycleState.STARTING); } catch (IllegalAccessException e) { throw new IllegalStateException(e); } } }
@Override public synchronized ScheduledExecutorService getScheduledExecutorService() { if (scheduledExecutorService == null) { scheduledExecutorService = ExecutorServiceUtil.newScheduledExecutorService(); } return scheduledExecutorService; }
@Override public synchronized ScheduledExecutorService getScheduledExecutorService() { if (scheduledExecutorService == null) { scheduledExecutorService = ExecutorServiceUtil.newScheduledExecutorService(); } return scheduledExecutorService; }
@Override public synchronized ScheduledExecutorService getScheduledExecutorService() { if (scheduledExecutorService == null) { scheduledExecutorService = ExecutorServiceUtil.newScheduledExecutorService(); } return scheduledExecutorService; }
@Override public synchronized ScheduledExecutorService getScheduledExecutorService() { if (scheduledExecutorService == null) { scheduledExecutorService = ExecutorServiceUtil.newScheduledExecutorService(); } return scheduledExecutorService; }
@Override public void startInternal() throws LifecycleException { try { // direct coupling with LogbackValve implementation FieldUtils.writeField(this, "scheduledExecutorService", ExecutorServiceUtil.newScheduledExecutorService(), true); FieldUtils.writeField(this, "started", true, true); setState(LifecycleState.STARTING); } catch (IllegalAccessException e) { throw new IllegalStateException(e); } } }
@Before public void setupValidAppenderWithMockDependencies() throws Exception { executorService = spy(ExecutorServiceUtil.newScheduledExecutorService()); mockContext = new MockContext(executorService); preSerializationTransformer = spy(new StringPreSerializationTransformer()); socket = mock(Socket.class); socketConnector = mock(SocketConnector.class); objectWriter = mock(AutoFlushingObjectWriter.class); objectWriterFactory = mock(ObjectWriterFactory.class); deque = spy(new LinkedBlockingDeque<String>(1)); queueFactory = mock(QueueFactory.class); appender = spy(new InstrumentedSocketAppender(preSerializationTransformer, queueFactory, objectWriterFactory, socketConnector)); doReturn(mock(OutputStream.class)).when(socket).getOutputStream(); doReturn(objectWriter).when(objectWriterFactory).newAutoFlushingObjectWriter(any(OutputStream.class)); doReturn(deque).when(queueFactory).<String>newLinkedBlockingDeque(anyInt()); appender.setContext(mockContext); appender.setRemoteHost("localhost"); }
@Override public void startInternal() throws LifecycleException { scheduledExecutorService = ExecutorServiceUtil.newScheduledExecutorService();