@Override
    public void onBlocked(BlockException ex, Context context, ResourceWrapper resourceWrapper, DefaultNode param,
                          int count, Object... args) {
        for (MetricExtension m : MetricExtensionProvider.getMetricExtensions()) {
            if (m instanceof AdvancedMetricExtension) {
                ((AdvancedMetricExtension) m).onBlocked(resourceWrapper, count, context.getOrigin(), ex, args);
            } else {
                m.addBlock(resourceWrapper.getName(), count, context.getOrigin(), ex, args);
            }
        }
    }
@Test
    public void onBlocked() throws Exception {
        FakeMetricExtension extension = new FakeMetricExtension();
        FakeAdvancedMetricExtension advancedExtension = new FakeAdvancedMetricExtension();
        MetricExtensionProvider.addMetricExtension(extension);
        MetricExtensionProvider.addMetricExtension(advancedExtension);

        MetricEntryCallback entryCallback = new MetricEntryCallback();
        StringResourceWrapper resourceWrapper = new StringResourceWrapper("resource", EntryType.OUT);
        Context context = mock(Context.class);
        when(context.getOrigin()).thenReturn("origin1");
        int count = 2;
        Object[] args = {"args1", "args2"};
        entryCallback.onBlocked(new FlowException("xx"), context, resourceWrapper, null, count, args);
        // assert extension
        Assert.assertEquals(extension.block, count);
        // assert advancedExtension
        Assert.assertEquals(advancedExtension.block, count);
    }