Package org.apache.hivemind

Examples of org.apache.hivemind.ShutdownCoordinator


        Object intercepted = addInterceptors(proxy);

        RegistryShutdownListener outerProxy = ProxyUtils
                .createOuterProxy(intercepted, servicePoint);

        ShutdownCoordinator coordinator = servicePoint.getShutdownCoordinator();

        coordinator.addRegistryShutdownListener(outerProxy);

        return outerProxy;
    }
View Full Code Here


        ServiceSerializationHelper.setServiceSerializationSupport(null);

        // Allow service implementations and such to shutdown.

        ShutdownCoordinator coordinatorService = (ShutdownCoordinator) getService(
                "hivemind.ShutdownCoordinator",
                ShutdownCoordinator.class,
                null);

        coordinatorService.shutdown();

        // TODO: Shoudl this be moved earlier?

        _shutdown = true;
View Full Code Here

    public void shutdown()
    {
        checkShutdown();
        // Allow service implementations and such to shutdown.

        ShutdownCoordinator coordinatorService =
            (ShutdownCoordinator) getService("hivemind.ShutdownCoordinator",
                ShutdownCoordinator.class);

        coordinatorService.shutdown();

        _shutdown = true;

        // Shutdown infrastructure items, such as proxies.
View Full Code Here

    public synchronized void shutdown()
    {
        checkShutdown();
        // Allow service implementations and such to shutdown.

        ShutdownCoordinator coordinatorService =
            (ShutdownCoordinator) getService("hivemind.ShutdownCoordinator",
                ShutdownCoordinator.class);

        coordinatorService.shutdown();

        _shutdown = true;

        // Shutdown infrastructure items, such as proxies.
View Full Code Here

    }

    public void testShutdownCoordinator()
    {
        ShutdownCoordinator c = new ShutdownCoordinatorImpl();

        Fixture f = new Fixture();

        c.addRegistryShutdownListener(f);

        c.shutdown();

        assertEquals(true, f.isShutdown());

        // For good riddens; test no failure if already down.

        c.shutdown();
    }
View Full Code Here

    public void testShutdownCoordinatorService()
    {
        Registry r = RegistryBuilder.constructDefaultRegistry();

        ShutdownCoordinator c =
            (ShutdownCoordinator) r.getService(
                "hivemind.ShutdownCoordinator",
                ShutdownCoordinator.class);

        Fixture f = new Fixture();

        c.addRegistryShutdownListener(f);

        c.shutdown();

        assertEquals(true, f.isShutdown());
    }
View Full Code Here

        assertEquals(true, f.isShutdown());
    }

    public void testShutdownFailure() throws Exception
    {
        ShutdownCoordinator c = new ShutdownCoordinatorImpl();

        c.addRegistryShutdownListener(new RegistryShutdownListener()
        {
            public void registryDidShutdown()
            {
                throw new ApplicationRuntimeException("I'm just not in the mood.");
            }
        });

        interceptLogging();

        c.shutdown();

        assertLoggedMessagePattern("Unable to shutdown .*: I'm just not in the mood\\.");
    }
View Full Code Here

        Registry r = f.getRegistry();

        assertNotNull(r);

        ShutdownCoordinator coordinator =
            (ShutdownCoordinator) r.getService(ShutdownCoordinator.class);

        ShutdownListenerFixture l = new ShutdownListenerFixture();

        coordinator.addRegistryShutdownListener(l);

        MockControl requestControl = newControl(HttpServletRequest.class);
        HttpServletRequest request = (HttpServletRequest) requestControl.getMock();
        HttpServletResponse response = (HttpServletResponse) newMock(HttpServletResponse.class);
        FilterChain chain = new RebuildRegistryChainFixture();
View Full Code Here

        ServiceSerializationHelper.resetServiceSerializationSupport(this);

        // Allow service implementations and such to shutdown.

        ShutdownCoordinator coordinatorService = (ShutdownCoordinator) getService(
                "hivemind.ShutdownCoordinator",
                ShutdownCoordinator.class,
                null);

        coordinatorService.shutdown();

        _shutdown = true;

        // Shutdown infrastructure items, such as proxies.
View Full Code Here

        Object intercepted = addInterceptors(proxy);

        RegistryShutdownListener outerProxy = ProxyUtils
                .createOuterProxy(intercepted, servicePoint);

        ShutdownCoordinator coordinator = servicePoint.getShutdownCoordinator();

        coordinator.addRegistryShutdownListener(outerProxy);

        return outerProxy;
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.ShutdownCoordinator

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.