@Test public void testGetMessageStatistics() throws Exception { String adapterName = this.getClass().getSimpleName() + "." + getName(); String payload = "SomePayload"; MessageMetricsInterceptor interceptor = (MessageMetricsInterceptor) createInterceptor(); interceptor.setUniqueId(getName()); Adapter adapter = createSingleChannelAdapter(adapterName, interceptor); List<BaseComponentMBean> mBeans = createJmxManagers(adapter); try { start(adapter); register(mBeans); ObjectName workflowObj = createWorkflowObjectName(adapterName); ObjectName metricsObj = createMetricsObjectName(adapterName, getName()); MessageMetricsStatisticsMBean stats = JMX.newMBeanProxy(mBeanServer, metricsObj, MessageMetricsStatisticsMBean.class); MessageProcessor workflow = JMX.newMBeanProxy(mBeanServer, workflowObj, MessageProcessor.class); workflow.processAsync(createMessageForInjection(payload)); assertEquals(1, stats.getStatistics().size()); assertEquals(interceptor.getStats().size(), stats.getStatistics().size()); MessageStatistic interceptorStat = (MessageStatistic) interceptor.getStats().get(0); MessageStatistic mbeanStat = stats.getStatistics().get(0); assertNotSame(interceptorStat, mbeanStat); assertEquals(interceptorStat.getEndMillis(), mbeanStat.getEndMillis()); assertEquals(interceptorStat.getTotalMessageCount(), mbeanStat.getTotalMessageCount()); assertEquals(interceptorStat.getTotalMessageErrorCount(), mbeanStat.getTotalMessageErrorCount()); assertEquals(interceptorStat.getTotalMessageSize(), mbeanStat.getTotalMessageSize()); } finally { stop(adapter); } }
@Override public List<MessageStatistic> getStatistics() throws CoreException { return getStatistics(0, wrappedComponent.getStats().size()); }
MessageMetricsStatistics extends ChildRuntimeInfoComponentImpl implements MessageMetricsStatisticsMBean { @Override public List<MessageStatistic> getStatistics() throws CoreException { return getStatistics(0, wrappedComponent.getStats().size()); } }
MessageMetricsStatistics extends ChildRuntimeInfoComponentImpl implements MessageMetricsStatisticsMBean { @Override public List<MessageStatistic> getStatistics() throws CoreException { return getStatistics(0, wrappedComponent.getStats().size()); } private  MessageMetricsStatistics(); protected  MessageMetricsStatistics(WorkflowManager owner, MessageMetricsInterceptorImpl interceptor); }
MessageMetricsStatistics extends ChildRuntimeInfoComponentImpl implements MessageMetricsStatisticsMBean { @Override public List<MessageStatistic> getStatistics() throws CoreException { return getStatistics(0, wrappedComponent.getStats().size()); } private  MessageMetricsStatistics(); protected  MessageMetricsStatistics(WorkflowManager owner, MessageMetricsInterceptorImpl interceptor); @Override int getNumberOfTimeSlices(); @Override int getTimeSliceDurationSeconds(); @Override String getTotalStringStats(); @Override ParentRuntimeInfoComponent getParentRuntimeInfoComponent(); @Override List<MessageStatistic> getStatistics(); @Override List<MessageStatistic> getStatistics(int fromIndex, int toIndex); @Override void clearStatistics(); }
MessageMetricsStatistics extends ChildRuntimeInfoComponentImpl implements MessageMetricsStatisticsMBean { @Override public List<MessageStatistic> getStatistics() throws CoreException { return getStatistics(0, wrappedComponent.getStats().size()); } private  MessageMetricsStatistics(); protected  MessageMetricsStatistics(WorkflowManager owner, MessageMetricsInterceptorImpl interceptor); @Override int getNumberOfTimeSlices(); @Override int getTimeSliceDurationSeconds(); @Override String getTotalStringStats(); @Override ParentRuntimeInfoComponent getParentRuntimeInfoComponent(); @Override List<MessageStatistic> getStatistics(); @Override List<MessageStatistic> getStatistics(int fromIndex, int toIndex); @Override void clearStatistics();  }