Package org.apache.avalon.excalibur.monitor

Examples of org.apache.avalon.excalibur.monitor.Monitor


    public void testActiveMonitor()
        throws CascadingAssertionFailedError
    {
        ComponentSelector selector = null;
        Monitor activeMonitor = null;

        try
        {
            selector = (ComponentSelector)manager.lookup( Monitor.ROLE + "Selector" );
            activeMonitor = (Monitor)selector.select( "active" );
View Full Code Here


    public void testPassiveMonitor()
        throws CascadingAssertionFailedError
    {
        ComponentSelector selector = null;
        Monitor passiveMonitor = null;

        try
        {
            selector = (ComponentSelector)manager.lookup( Monitor.ROLE + "Selector" );
            passiveMonitor = (Monitor)selector.select( "passive" );
View Full Code Here

    }

    public void testActiveMonitorThreadSafety() throws CascadingAssertionFailedError
    {
        ComponentSelector selector = null;
        Monitor activeMonitor = null;

        try
        {
            selector = (ComponentSelector) manager.lookup( Monitor.ROLE + "Selector" );
            activeMonitor = (Monitor) selector.select( "active" );
            final Monitor monitor = activeMonitor;
            getLogger().info( "Aquired Active monitor" );
            for ( int i = 0; i < 500; i++ )
            {
                final int threadNum = i;
                final Thread thread = new Thread() {
                    Resource resource = new FileResource( "testts-" + threadNum + ".txt" );

                    public void run()
                    {
                        while ( true )
                        {
                            monitor.addResource( resource );
                            monitor.removeResource( resource );
                        }
                    }
                };
                thread.start();
            }
View Full Code Here

    public void testActiveMonitor()
        throws CascadingAssertionFailedError
    {
        ComponentSelector selector = null;
        Monitor activeMonitor = null;

        try
        {
            selector = (ComponentSelector)manager.lookup( Monitor.ROLE + "Selector" );
            activeMonitor = (Monitor)selector.select( "active" );
View Full Code Here

    public void testPassiveMonitor()
        throws CascadingAssertionFailedError
    {
        ComponentSelector selector = null;
        Monitor passiveMonitor = null;

        try
        {
            selector = (ComponentSelector)manager.lookup( Monitor.ROLE + "Selector" );
            passiveMonitor = (Monitor)selector.select( "passive" );
View Full Code Here

    }

    public void testActiveMonitorThreadSafety() throws CascadingAssertionFailedError
    {
        ComponentSelector selector = null;
        Monitor activeMonitor = null;

        try
        {
            selector = (ComponentSelector) manager.lookup( Monitor.ROLE + "Selector" );
            activeMonitor = (Monitor) selector.select( "active" );
            final Monitor monitor = activeMonitor;
            getLogger().info( "Aquired Active monitor" );
            for ( int i = 0; i < 500; i++ )
            {
                final int threadNum = i;
                final Thread thread = new Thread() {
                    Resource resource = new FileResource( "testts-" + threadNum + ".txt" );

                    public void run()
                    {
                        while ( true )
                        {
                            monitor.addResource( resource );
                            monitor.removeResource( resource );
                        }
                    }
                };
                thread.start();
            }
View Full Code Here

TOP

Related Classes of org.apache.avalon.excalibur.monitor.Monitor

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.