use of com.facebook.presto.spi.eventlistener.EventListener in project presto by prestodb.
the class EventListenerManager method setConfiguredEventListener.
@VisibleForTesting
protected void setConfiguredEventListener(String name, Map<String, String> properties) {
requireNonNull(name, "name is null");
requireNonNull(properties, "properties is null");
log.info("-- Loading event listener --");
EventListenerFactory eventListenerFactory = eventListenerFactories.get(name);
checkState(eventListenerFactory != null, "Event listener %s is not registered", name);
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(eventListenerFactory.getClass().getClassLoader())) {
EventListener eventListener = eventListenerFactory.create(ImmutableMap.copyOf(properties));
this.configuredEventListener.set(Optional.of(eventListener));
}
log.info("-- Loaded event listener %s --", name);
}
Aggregations