Examples of ThreadEventNotifier


Examples of org.apache.hivemind.service.ThreadEventNotifier

                "hivemind.test.services.ThreadedDiscardable",
                StringHolder.class);

        h.setValue("bar");

        ThreadEventNotifier n = (ThreadEventNotifier) r.getService(
                "hivemind.ThreadEventNotifier",
                ThreadEventNotifier.class);

        interceptLogging("hivemind.test.services");

        n.fireThreadCleanup();

        assertLoggedMessage("threadDidDiscardService() has been invoked.");
    }
View Full Code Here

Examples of org.apache.hivemind.service.ThreadEventNotifier

        assertLoggedMessage("activateService()");

        s.setValue("funky monkey");
        assertEquals("funky monkey", s.getValue());

        ThreadEventNotifier n =
            (ThreadEventNotifier) r.getService(
                HiveMind.THREAD_EVENT_NOTIFIER_SERVICE,
                ThreadEventNotifier.class);

        n.fireThreadCleanup();

        assertLoggedMessage("passivateService()");

        assertNull(s.getValue());
    }
View Full Code Here

Examples of org.apache.hivemind.service.ThreadEventNotifier

        assertNull(s.getValue());

        s.setValue("funky monkey");
        assertEquals("funky monkey", s.getValue());

        ThreadEventNotifier n =
            (ThreadEventNotifier) r.getService(
                HiveMind.THREAD_EVENT_NOTIFIER_SERVICE,
                ThreadEventNotifier.class);

        n.fireThreadCleanup();

        assertEquals("funky monkey", s.getValue());
    }
View Full Code Here

Examples of org.apache.hivemind.service.ThreadEventNotifier

        Registry r = f.getRegistry();

        assertNotNull(r);

        ThreadEventNotifier t = (ThreadEventNotifier) r.getService(
                HiveMind.THREAD_EVENT_NOTIFIER_SERVICE,
                ThreadEventNotifier.class);

        ThreadListenerFixture l = new ThreadListenerFixture();

        t.addThreadCleanupListener(l);

        MockControl requestControl = newControl(HttpServletRequest.class);
        HttpServletRequest request = (HttpServletRequest) requestControl.getMock();
        HttpServletResponse response = (HttpServletResponse) newMock(HttpServletResponse.class);
        FilterChain chain = (FilterChain) newMock(FilterChain.class);

        request.setAttribute(HiveMindFilter.REQUEST_KEY, r);

        chain.doFilter(request, response);

        request.getAttribute(HiveMindFilter.REBUILD_REQUEST_KEY);
        requestControl.setReturnValue(null);

        request.getAttribute(HiveMindFilter.REQUEST_KEY);
        requestControl.setReturnValue(r);

        replayControls();

        f.doFilter(request, response, chain);

        assertSame(r, HiveMindFilter.getRegistry(request));

        assertEquals(true, l.getCleanup());

        f.destroy();

        try
        {
            t.addThreadCleanupListener(null);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "The HiveMind Registry has been shutdown.");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.