Package org.mule.management.stats

Examples of org.mule.management.stats.FlowConstructStatistics


                logFatal(event, e);
            }
        }
       
        List<MessageProcessor> processors = getMessageProcessors();
        FlowConstructStatistics statistics = event.getFlowConstruct().getStatistics();
        if (CollectionUtils.isNotEmpty(processors) && statistics instanceof ServiceStatistics)
        {
            if (statistics.isEnabled())
            {
                for (MessageProcessor endpoint : processors)
                {
                    ((ServiceStatistics) statistics).getOutboundRouterStat().incrementRoutedMessage(endpoint);
                }
View Full Code Here


     * @param message The MuleMessage currently being processed
     * @param t the fatal exception to log
     */
    protected void logFatal(MuleEvent event, Throwable t)
    {
        FlowConstructStatistics statistics = event.getFlowConstruct().getStatistics();
        if (statistics != null && statistics.isEnabled())
        {
            statistics.incFatalError();
        }

        logger.fatal(
            "Failed to dispatch message to error queue after it failed to process.  This may cause message loss."
                            + (event.getMessage() == null ? "" : "Logging Message here: \n" + event.getMessage().toString()), t);
View Full Code Here

    }

    protected void registerApplicationServices() throws NotCompliantMBeanException, MBeanRegistrationException,
        InstanceAlreadyExistsException, MalformedObjectNameException
    {
        FlowConstructStatistics appStats = muleContext.getStatistics().getApplicationStatistics();
        if (appStats != null)
        {
            final String rawName = appStats.getName();
            final String name = jmxSupport.escape(rawName);
            final String jmxName = String.format("%s:type=%s,name=%s", jmxSupport.getDomainName(muleContext, !containerMode), appStats.getFlowConstructType(), name);
            ObjectName on = jmxSupport.getObjectName(jmxName);
            FlowConstructServiceMBean fcMBean = new ApplicationService(appStats.getFlowConstructType(), rawName, muleContext,appStats);
            ClassloaderSwitchingMBeanWrapper wrapper = new ClassloaderSwitchingMBeanWrapper(fcMBean, FlowConstructServiceMBean.class, muleContext.getExecutionClassLoader());
            logger.debug("Registering application statistics with name: " + on);
            mBeanServer.registerMBean(wrapper, on);
        }
    }
View Full Code Here

        return handleException(ex, event, null);
    }
   
    protected void doHandleException(Exception ex, MuleEvent event, RollbackMethod rollbackMethod)
    {
        FlowConstructStatistics statistics = event.getFlowConstruct().getStatistics();
        if (statistics != null && statistics.isEnabled())
        {
            statistics.incExecutionError();
        }

        if (isRollback(ex))
        {
            logger.debug("Rolling back transaction");
View Full Code Here

    }

    private FlowConstructStatistics getFlowConstructStatistics()
    {
        Iterator<FlowConstructStatistics> iterator = muleContext.getStatistics().getServiceStatistics().iterator();
        FlowConstructStatistics stat1;
        do
        {
            assertTrue(iterator.hasNext());
            stat1 = iterator.next();
        }
        while (stat1.getClass() != FlowConstructStatistics.class);
        return stat1;
    }
View Full Code Here

    }

    private ApplicationStatistics getApplicationStatistics()
    {
        Iterator<FlowConstructStatistics> iterator = muleContext.getStatistics().getServiceStatistics().iterator();
        FlowConstructStatistics stat1;
        do
        {
            assertTrue(iterator.hasNext());
            stat1 = iterator.next();
        }
View Full Code Here

    public void testCorrectAsynchEventsReceived() throws Exception
    {
        ServiceStatistics stats = getServiceStatistics();
        assertEquals(1, stats.getAsyncEventsReceived());
        FlowConstructStatistics fstats = getFlowConstructStatistics();
        assertEquals(2, fstats.getAsyncEventsReceived());
        ApplicationStatistics astats = getApplicationStatistics();
        assertEquals(3, astats.getAsyncEventsReceived());
    }
View Full Code Here

    public void testCorrectTotalEventsReceived() throws Exception
    {
        ServiceStatistics stats = getServiceStatistics();
        assertEquals(1, stats.getTotalEventsReceived());
        FlowConstructStatistics fstats = getFlowConstructStatistics();
        assertEquals(2, fstats.getTotalEventsReceived());
        ApplicationStatistics astats = getApplicationStatistics();
        assertEquals(3, astats.getTotalEventsReceived());
    }
View Full Code Here

    }

    private ServiceStatistics getServiceStatistics()
    {
        Iterator<FlowConstructStatistics> iterator = muleContext.getStatistics().getServiceStatistics().iterator();
        FlowConstructStatistics stat1;
        do
        {
            assertTrue(iterator.hasNext());
            stat1 = iterator.next();
        }
View Full Code Here

    protected void configureStatistics()
    {
        if (processingStrategy instanceof AsynchronousProcessingStrategy
            && ((AsynchronousProcessingStrategy) processingStrategy).getMaxThreads() != null)
        {
            statistics = new FlowConstructStatistics(getConstructType(), name,
                ((AsynchronousProcessingStrategy) processingStrategy).getMaxThreads());
        }
        else
        {
            statistics = new FlowConstructStatistics(getConstructType(), name);
        }
        statistics.setEnabled(muleContext.getStatistics().isEnabled());
        muleContext.getStatistics().add(statistics);
    }
View Full Code Here

TOP

Related Classes of org.mule.management.stats.FlowConstructStatistics

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.