Package org.mule.management.stats

Examples of org.mule.management.stats.RouterStatistics


    {
        // initialise statistics
        stats = createStatistics();
        stats.setEnabled(muleContext.getStatistics().isEnabled());
        muleContext.getStatistics().add(stats);
        RouterStatistics routerStatistics = null;

        // If the router collection already has router statistics, keep using them.
        if (outboundRouter instanceof OutboundRouterCollection)
        {
            routerStatistics = ((OutboundRouterCollection)outboundRouter).getRouterStatistics();
        }
        if (routerStatistics == null)
        {
            routerStatistics = new RouterStatistics(RouterStatistics.TYPE_OUTBOUND);
        }
        stats.setOutboundRouterStat(routerStatistics);
        if (outboundRouter != null && outboundRouter instanceof RouterStatisticsRecorder)
        {
            ((RouterStatisticsRecorder)outboundRouter).setRouterStatistics(routerStatistics);
        }
        RouterStatistics inboundRouterStatistics = new RouterStatistics(RouterStatistics.TYPE_INBOUND);
        stats.setInboundRouterStat(inboundRouterStatistics);
        if (messageSource instanceof RouterStatisticsRecorder)
        {
            ((RouterStatisticsRecorder) messageSource).setRouterStatistics(inboundRouterStatistics);
        }
View Full Code Here


    protected MessageProcessor catchAllStrategy;
    private final InterceptingMessageProcessor internalCatchAllStrategy = new InternalCatchAllMessageProcessor();

    public ServiceCompositeMessageSource()
    {
        statistics = new RouterStatistics(RouterStatistics.TYPE_INBOUND);
    }
View Full Code Here

    protected Long timeout;
    protected boolean failOnTimeout = true;

    public ServiceAsyncReplyCompositeMessageSource()
    {
        statistics = new RouterStatistics(RouterStatistics.TYPE_RESPONSE);
    }
View Full Code Here

    @Test
    public void testMatchingRouteWithStatistics() throws Exception
    {
        choiceRouter.addRoute(new TestMessageProcessor("bar"), new EqualsFilter("zap"));
        choiceRouter.setRouterStatistics(new RouterStatistics(RouterStatistics.TYPE_OUTBOUND));
        assertEquals("zap:bar", choiceRouter.process(getTestEvent("zap")).getMessageAsString());
    }
View Full Code Here

        try
        {
            TestMessageProcessor mp = new TestMessageProcessor("bar");
            choiceRouter.addRoute(mp, new EqualsFilter("zap"));
            choiceRouter.removeRoute(mp);
            choiceRouter.setRouterStatistics(new RouterStatistics(RouterStatistics.TYPE_OUTBOUND));
            choiceRouter.process(getTestEvent("zap"));
            fail("should have got a MuleException");
        }
        catch (MuleException me)
        {
View Full Code Here

        final String domainOriginal = "TEST_DOMAIN_1";

        // inbound/outbound router statistics are required

        final SedaServiceStatistics statistics = new SedaServiceStatistics("TEST_IN", 0, 0);
        statistics.setInboundRouterStat(new RouterStatistics(RouterStatistics.TYPE_INBOUND));
        statistics.setOutboundRouterStat(new RouterStatistics(RouterStatistics.TYPE_OUTBOUND));
        ServiceStats stats = new ServiceStats(statistics);

        final ObjectName name = ObjectName.getInstance(domainOriginal + ":type=TEST_NAME");
        mBeanServer.registerMBean(stats, name);
View Full Code Here

     * @throws org.mule.api.routing.RoutingException
     *          if there is a failure while processing this message.
     */
    public final MuleEvent process(MuleEvent event) throws RoutingException
    {
        RouterStatistics stats = getRouterStatistics();
        if(stats !=null && stats.isEnabled())
        {
            stats.incrementCaughtMessage();
        }
        else
        {
            logger.warn("Routing statistics not set on catch all strategy, this invocation will not be recorded.");
        }
View Full Code Here

    private MuleContext muleContext;
    private final Map<QName, Object> annotations = new ConcurrentHashMap<QName, Object>();

    public AbstractSelectiveRouter()
    {
        routerStatistics = new RouterStatistics(RouterStatistics.TYPE_OUTBOUND);
    }
View Full Code Here

    {
        super.postRegister(registrationDone);

        try
        {
            RouterStatistics is = statistics.getInboundRouterStat();
            if (is != null)
            {
                String quotedStatsName = ObjectName.quote(statistics.getName());
                inboundName = new ObjectName(name.getDomain() + ":type=org.mule.Statistics,service="
                                             + quotedStatsName + ",router=inbound");

                // unregister old version if exists
                if (server.isRegistered(inboundName))
                {
                    server.unregisterMBean(inboundName);
                }
                server.registerMBean(new RouterStats(is), this.inboundName);
            }

            RouterStatistics os = this.statistics.getOutboundRouterStat();
            if (os != null)
            {
                String quotedStatsName = ObjectName.quote(statistics.getName());
                outboundName = new ObjectName(name.getDomain() + ":type=org.mule.Statistics,service="
                                              + quotedStatsName + ",router=outbound");
View Full Code Here

TOP

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

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.