use of io.javaoperatorsdk.operator.OperatorException in project java-operator-sdk by java-operator-sdk.
the class EventSourceManager method registerEventSource.
public final void registerEventSource(EventSource eventSource) throws OperatorException {
Objects.requireNonNull(eventSource, "EventSource must not be null");
lock.lock();
try {
eventSources.add(eventSource);
eventSource.setEventHandler(eventProcessor);
} catch (Throwable e) {
if (e instanceof IllegalStateException || e instanceof MissingCRDException) {
// leave untouched
throw e;
}
throw new OperatorException("Couldn't register event source: " + eventSource.getClass().getName(), e);
} finally {
lock.unlock();
}
}
Aggregations