use of org.apache.qpid.server.logging.EventLogger in project qpid-broker-j by apache.
the class SystemLauncher method startup.
public void startup(final Map<String, Object> systemConfigAttributes) throws Exception {
final SystemOutMessageLogger systemOutMessageLogger = new SystemOutMessageLogger();
_eventLogger = new EventLogger(systemOutMessageLogger);
Subject.doAs(_brokerTaskSubject, new PrivilegedExceptionAction<Object>() {
@Override
public Object run() throws Exception {
_listener.beforeStartup();
try {
startupImpl(systemConfigAttributes);
} catch (RuntimeException e) {
systemOutMessageLogger.message(new SystemStartupMessage(e));
LOGGER.error("Exception during startup", e);
_listener.errorOnStartup(e);
closeSystemConfigAndCleanUp();
} finally {
_listener.afterStartup();
}
return null;
}
});
}
use of org.apache.qpid.server.logging.EventLogger in project qpid-broker-j by apache.
the class AbstractSystemConfig method makeActive.
protected ListenableFuture<Void> makeActive() {
final EventLogger eventLogger = _eventLogger;
final EventLogger startupLogger = initiateStartupLogging();
try {
final Container<?> container = initiateStoreAndRecovery();
container.setEventLogger(startupLogger);
final SettableFuture<Void> returnVal = SettableFuture.create();
addFutureCallback(container.openAsync(), new FutureCallback() {
@Override
public void onSuccess(final Object result) {
State state = container.getState();
if (state == State.ACTIVE) {
startupLogger.message(BrokerMessages.READY());
container.setEventLogger(eventLogger);
returnVal.set(null);
} else {
returnVal.setException(new ServerScopedRuntimeException("Broker failed reach ACTIVE state (state is " + state + ")"));
}
}
@Override
public void onFailure(final Throwable t) {
returnVal.setException(t);
}
}, getTaskExecutor());
return returnVal;
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
}
use of org.apache.qpid.server.logging.EventLogger in project qpid-broker-j by apache.
the class AbstractSystemConfig method startQuiesced.
@StateTransition(currentState = State.UNINITIALIZED, desiredState = State.QUIESCED)
protected ListenableFuture<Void> startQuiesced() {
final EventLogger startupLogger = initiateStartupLogging();
try {
final Container<?> container = initiateStoreAndRecovery();
container.setEventLogger(startupLogger);
return Futures.immediateFuture(null);
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
}
use of org.apache.qpid.server.logging.EventLogger in project qpid-broker-j by apache.
the class NonJavaTrustStoreTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
when(_broker.getTaskExecutor()).thenReturn(_taskExecutor);
when(_broker.getChildExecutor()).thenReturn(_taskExecutor);
when(_broker.getModel()).thenReturn(_model);
when(_broker.getEventLogger()).thenReturn(new EventLogger());
when(((Broker) _broker).getCategoryClass()).thenReturn(Broker.class);
}
use of org.apache.qpid.server.logging.EventLogger in project qpid-broker-j by apache.
the class SiteSpecificTrustStoreTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
int connectTimeout = Integer.getInteger("SiteSpecificTrustStoreTest.connectTimeout", 1000);
int readTimeout = Integer.getInteger("SiteSpecificTrustStoreTest.readTimeout", 1000);
setTestSystemProperty(SiteSpecificTrustStore.TRUST_STORE_SITE_SPECIFIC_CONNECT_TIMEOUT, String.valueOf(connectTimeout));
setTestSystemProperty(SiteSpecificTrustStore.TRUST_STORE_SITE_SPECIFIC_READ_TIMEOUT, String.valueOf(readTimeout));
when(_broker.getTaskExecutor()).thenReturn(_taskExecutor);
when(_broker.getChildExecutor()).thenReturn(_taskExecutor);
when(_broker.getModel()).thenReturn(_model);
when(_broker.getEventLogger()).thenReturn(new EventLogger());
when(((Broker) _broker).getCategoryClass()).thenReturn(Broker.class);
}
Aggregations