@Test public void testInterceptor() throws Exception { LifecycleHelper.init(metricsInterceptor); LifecycleHelper.start(metricsInterceptor); AdaptrisMessage message = createMessage(COUNTER_1); assertEquals(0, metricsInterceptor.getStats().size()); submitMessage(message); assertEquals(1, metricsInterceptor.getStats().size()); assertEquals(1, ((MetadataStatistic) metricsInterceptor.getStats().get(0)).getValue(COUNTER_1)); assertEquals(0, ((MetadataStatistic) metricsInterceptor.getStats().get(0)).getValue(COUNTER_2)); }
@Override public void init() throws CoreException { if (isEmpty(getMetadataKey())) throw new CoreException("metadata-key is empty/null"); super.init(); }
MetadataCountInterceptor extends MetadataMetricsInterceptorImpl { @Override public void init() throws CoreException { if (isEmpty(getMetadataKey())) throw new CoreException("metadata-key is empty/null"); super.init(); } }
MetadataCountInterceptor extends MetadataMetricsInterceptorImpl { @Override public void init() throws CoreException { if (isEmpty(getMetadataKey())) throw new CoreException("metadata-key is empty/null"); super.init(); } MetadataCountInterceptor();  MetadataCountInterceptor(String key); }
MetadataCountInterceptor extends MetadataMetricsInterceptorImpl { @Override public void init() throws CoreException { if (isEmpty(getMetadataKey())) throw new CoreException("metadata-key is empty/null"); super.init(); } MetadataCountInterceptor();  MetadataCountInterceptor(String key); @Override void init(); @Override synchronized void workflowStart(AdaptrisMessage inputMsg); @Override synchronized void workflowEnd(AdaptrisMessage inputMsg, final AdaptrisMessage outputMsg); String getMetadataKey(); void setMetadataKey(String key); }
MetadataCountInterceptor extends MetadataMetricsInterceptorImpl { @Override public void init() throws CoreException { if (isEmpty(getMetadataKey())) throw new CoreException("metadata-key is empty/null"); super.init(); } MetadataCountInterceptor();  MetadataCountInterceptor(String key); @Override void init(); @Override synchronized void workflowStart(AdaptrisMessage inputMsg); @Override synchronized void workflowEnd(AdaptrisMessage inputMsg, final AdaptrisMessage outputMsg); String getMetadataKey(); void setMetadataKey(String key);  }