Package org.mule.management.stats

Examples of org.mule.management.stats.FlowConstructStatistics


        configureStatistics();
    }

    protected void configureStatistics()
    {
        statistics = new FlowConstructStatistics(getConstructType(), name);
        statistics.setEnabled(muleContext.getStatistics().isEnabled());
        muleContext.getStatistics().add(statistics);
    }
View Full Code Here


        configureStatistics();
    }

    protected void configureStatistics()
    {
        statistics = new FlowConstructStatistics(getConstructType(), name);
        statistics.setEnabled(muleContext.getStatistics().isEnabled());
        muleContext.getStatistics().add(statistics);
    }
View Full Code Here

     * @param event The MuleEvent 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();
        }

        MuleMessage logMessage = event.getMessage();
        String logUniqueId = StringUtils.defaultString(logMessage.getUniqueId(), NOT_SET);
        String correlationId = StringUtils.defaultString(logMessage.getCorrelationId(), NOT_SET);
View Full Code Here

    }

    void processOutboundRouterStatistics(FlowConstruct construct)
    {
        List<MessageProcessor> processors = getMessageProcessors();
        FlowConstructStatistics statistics = construct.getStatistics();
        if (CollectionUtils.isNotEmpty(processors) && statistics instanceof ServiceStatistics)
        {
            if (statistics.isEnabled())
            {
                for (MessageProcessor endpoint : processors)
                {
                    ((ServiceStatistics) statistics).getOutboundRouterStat().incrementRoutedMessage(endpoint);
                }
View Full Code Here

        }
    }

    protected ServiceStatistics getServiceStatistics(FlowConstruct flowConstruct)
    {
        FlowConstructStatistics stats = getFlowConstructStatistics(flowConstruct);
        if (!(stats instanceof ServiceStatistics))
        {
            //this should never happen, but JIC
            logger.fatal("The Default Service Exception Strategy has been invoked but there is no current service on the context. Please report this to dev@mule.codehaus.org");
            return null;
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);
        }
        if (processingStrategy instanceof QueuedAsynchronousProcessingStrategy)
        {
            ((QueuedAsynchronousProcessingStrategy) processingStrategy).setQueueStatistics(statistics);
        }
View Full Code Here

        }
    }

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

        // Left this here for backwards-compatibility, remove in the next major version.
        defaultHandler(ex);
View Full Code Here

        }
    }

    private void processStatistics(MuleEvent event)
    {
        FlowConstructStatistics statistics = event.getFlowConstruct().getStatistics();
        if (statistics != null && statistics.isEnabled())
        {
            statistics.incExecutionError();
        }
    }
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

    @Test
    public void testCorrectAverageQueueSize() throws Exception
    {
        ServiceStatistics stats = getServiceStatistics();
        assertEquals(1, stats.getAverageQueueSize());
        FlowConstructStatistics fstats = getFlowConstructStatistics();
        assertEquals(1, fstats.getAverageQueueSize());
    }
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.