use of com.intellij.util.messages.Topic in project intellij-community by JetBrains.
the class MessageBusConnectionImpl method deliverMessage.
void deliverMessage(@NotNull Message message) {
final Message messageOnLocalQueue = myPendingMessages.get().poll();
assert messageOnLocalQueue == message;
final Topic topic = message.getTopic();
final Object handler = mySubscriptions.get(topic);
try {
Method listenerMethod = message.getListenerMethod();
if (handler == myDefaultHandler) {
myDefaultHandler.handle(listenerMethod, message.getArgs());
} else {
listenerMethod.invoke(handler, message.getArgs());
}
} catch (AbstractMethodError e) {
//Do nothing. This listener just does not implement something newly added yet.
} catch (ProcessCanceledException e) {
throw e;
} catch (InvocationTargetException e) {
if (e.getCause() instanceof ProcessCanceledException) {
throw (ProcessCanceledException) e.getCause();
}
LOG.error(e.getCause() == null ? e : e.getCause());
} catch (Throwable e) {
LOG.error(e.getCause() == null ? e : e.getCause());
}
}
Aggregations