@Override public void run() { try { operationsQuantizer.remove(operation); operation.invoke(); } catch ( InterruptedException e ) { //We expect to get interrupted during shutdown, //so just ignore these events if ( state.get() != State.CLOSED ) { handleException(e); } Thread.currentThread().interrupt(); } catch ( Exception e ) { ThreadUtils.checkInterrupted(e); handleException(e); } } }
@Override public Void apply(PathChildrenCacheListener listener) { try { listener.childEvent(client, event); } catch ( Exception e ) { ThreadUtils.checkInterrupted(e); handleException(e); } return null; } }
@Override public void process(WatchedEvent event) { try { if ( event.getType() == Event.EventType.NodeDeleted ) { remove(event.getPath()); } else if ( event.getType() == Event.EventType.NodeDataChanged ) { offerOperation(new GetDataOperation(PathChildrenCache.this, event.getPath())); } } catch ( Exception e ) { ThreadUtils.checkInterrupted(e); handleException(e); } } };