@Test public void executeNextWhenNoMoreAction() throws Exception { DefaultResourceReferenceHandlerChain chain = DefaultResourceReferenceHandlerChain.EMPTY; chain.handleNext(mock(ResourceReference.class)); }
@Override public void handleNext(ResourceReference reference) throws ResourceReferenceHandlerException { if (!this.handlerStack.isEmpty()) { ResourceReferenceHandler<?> handler = this.handlerStack.poll(); if (this.observation != null) { this.observation.notify(new ResourceReferenceHandlingEvent(reference), handler); } ResourceReferenceHandlerException exception = null; try { handler.handle(reference, this); } catch (ResourceReferenceHandlerException e) { exception = e; } finally { if (this.observation != null) { this.observation.notify(new ResourceReferenceHandledEvent(reference), handler, exception); } } if (exception != null) { throw exception; } } }
DefaultResourceReferenceHandlerChain implements ResourceReferenceHandlerChain { @Override public void handleNext(ResourceReference reference) throws ResourceReferenceHandlerException { if (!this.handlerStack.isEmpty()) { ResourceReferenceHandler<?> handler = this.handlerStack.poll(); if (this.observation != null) { this.observation.notify(new ResourceReferenceHandlingEvent(reference), handler); } ResourceReferenceHandlerException exception = null; try { handler.handle(reference, this); } catch (ResourceReferenceHandlerException e) { exception = e; } finally { if (this.observation != null) { this.observation.notify(new ResourceReferenceHandledEvent(reference), handler, exception); } } if (exception != null) { throw exception; } } } }
DefaultResourceReferenceHandlerChain implements ResourceReferenceHandlerChain { @Override public void handleNext(ResourceReference reference) throws ResourceReferenceHandlerException { if (!this.handlerStack.isEmpty()) { ResourceReferenceHandler<?> handler = this.handlerStack.poll(); if (this.observation != null) { this.observation.notify(new ResourceReferenceHandlingEvent(reference), handler); } ResourceReferenceHandlerException exception = null; try { handler.handle(reference, this); } catch (ResourceReferenceHandlerException e) { exception = e; } finally { if (this.observation != null) { this.observation.notify(new ResourceReferenceHandledEvent(reference), handler, exception); } } if (exception != null) { throw exception; } } } DefaultResourceReferenceHandlerChain(Collection<ResourceReferenceHandler> orderedHandlers,
        ObservationManager observation); }
DefaultResourceReferenceHandlerChain implements ResourceReferenceHandlerChain { @Override public void handleNext(ResourceReference reference) throws ResourceReferenceHandlerException { if (!this.handlerStack.isEmpty()) { ResourceReferenceHandler<?> handler = this.handlerStack.poll(); if (this.observation != null) { this.observation.notify(new ResourceReferenceHandlingEvent(reference), handler); } ResourceReferenceHandlerException exception = null; try { handler.handle(reference, this); } catch (ResourceReferenceHandlerException e) { exception = e; } finally { if (this.observation != null) { this.observation.notify(new ResourceReferenceHandledEvent(reference), handler, exception); } } if (exception != null) { throw exception; } } } DefaultResourceReferenceHandlerChain(Collection<ResourceReferenceHandler> orderedHandlers,
        ObservationManager observation); @Override void handleNext(ResourceReference reference); }
DefaultResourceReferenceHandlerChain implements ResourceReferenceHandlerChain { @Override public void handleNext(ResourceReference reference) throws ResourceReferenceHandlerException { if (!this.handlerStack.isEmpty()) { ResourceReferenceHandler<?> handler = this.handlerStack.poll(); if (this.observation != null) { this.observation.notify(new ResourceReferenceHandlingEvent(reference), handler); } ResourceReferenceHandlerException exception = null; try { handler.handle(reference, this); } catch (ResourceReferenceHandlerException e) { exception = e; } finally { if (this.observation != null) { this.observation.notify(new ResourceReferenceHandledEvent(reference), handler, exception); } } if (exception != null) { throw exception; } } } DefaultResourceReferenceHandlerChain(Collection<ResourceReferenceHandler> orderedHandlers,
        ObservationManager observation); @Override void handleNext(ResourceReference reference); static final DefaultResourceReferenceHandlerChain EMPTY; }