Package org.mule.construct

Examples of org.mule.construct.AbstractFlowConstruct


        return name;
    }

    public void postRegister(Boolean registrationDone)
    {
        AbstractFlowConstruct flow = muleContext.getRegistry().lookupObject(getName());
        try
        {
            if (flow.getStatistics() != null)
            {
                statsName = new ObjectName(objectName.getDomain() + ":type=org.mule.Statistics," +
                    flow.getConstructType() + "=" + getName());
                // unregister old version if exists
                if (this.server.isRegistered(statsName))
                {
                    this.server.unregisterMBean(statsName);
                }

                this.server.registerMBean(new FlowConstructStats(flow.getStatistics()), this.statsName);
            }
        }
        catch (Exception e)
        {
            LOGGER.error("Error post-registering the MBean", e);
View Full Code Here


        doTestStarted("started");
    }

    protected void doTestStarted(String flowName) throws Exception
    {
        AbstractFlowConstruct f = (AbstractFlowConstruct) muleContext.getRegistry().lookupFlowConstruct(
            flowName + "Flow");
        // Flow initially started
        assertTrue(f.isStarted());
        assertFalse(f.isStopped());

        // The listeners should be registered and started.
        doListenerTests(flowName, 1, true);
    }
View Full Code Here

    }

    @Test
    public void testInitialStateStopped() throws Exception
    {
        AbstractFlowConstruct f = (AbstractFlowConstruct) muleContext.getRegistry().lookupFlowConstruct(
            "stoppedFlow");
        assertEquals("stopped", f.getInitialState());
        // Flow initially stopped
        assertFalse(f.isStarted());
        assertTrue(f.isStopped());

        // The connector should be started, but with no listeners registered.
        doListenerTests("stopped", 0, true);

        f.start();
        assertTrue(f.isStarted());
        assertFalse(f.isStopped());

        // The listeners should now be registered and started.
        doListenerTests("stopped", 1, true);
    }
View Full Code Here

        doTestStopped("stoppedValidator", "in.validator.stopped");
    }

    protected void doTestStarted(String flowName, String endpointName) throws Exception
    {
        AbstractFlowConstruct f = (AbstractFlowConstruct) muleContext.getRegistry().lookupFlowConstruct(
            flowName);
        // Flow initially started
        assertTrue(f.isStarted());
        assertFalse(f.isStopped());

        // The listeners should be registered and started.
        doListenerTests(endpointName, 1, true);
    }
View Full Code Here

        doListenerTests(endpointName, 1, true);
    }

    public void doTestStopped(String flowName, String endpointName) throws Exception
    {
        AbstractFlowConstruct f = (AbstractFlowConstruct) muleContext.getRegistry().lookupFlowConstruct(
            flowName);
        assertEquals("stopped", f.getInitialState());
        // Flow initially stopped
        assertFalse(f.isStarted());
        assertTrue(f.isStopped());

        // The connector should be started, but with no listeners registered.
        doListenerTests(endpointName, 0, true);

        f.start();
        assertTrue(f.isStarted());
        assertFalse(f.isStopped());

        // The listeners should now be registered and started.
        doListenerTests(endpointName, 1, true);
    }
View Full Code Here

        return name;
    }

    public void postRegister(Boolean registrationDone)
    {
        AbstractFlowConstruct flow = muleContext.getRegistry().lookupObject(getName());
        try
        {
            if (flow.getStatistics() != null)
            {
                statsName = jmxSupport.getObjectName(String.format("%s:type=org.mule.Statistics,%s=%s", objectName.getDomain(),
                    flow.getConstructType(), jmxSupport.escape(getName())));
               
                // unregister old version if exists
                if (this.server.isRegistered(statsName))
                {
                    this.server.unregisterMBean(statsName);
                }

                this.server.registerMBean(new FlowConstructStats(flow.getStatistics()), this.statsName);
            }
        }
        catch (Exception e)
        {
            LOGGER.error("Error post-registering the MBean", e);
View Full Code Here

TOP

Related Classes of org.mule.construct.AbstractFlowConstruct

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.