Package org.apache.hivemind.impl

Examples of org.apache.hivemind.impl.InterceptorStackImpl


        int count = interceptors == null ? 0 : interceptors.size();

        if (count == 0)
            return core;

        InterceptorStackImpl stack = new InterceptorStackImpl(_log, _servicePoint, core);

        // They are sorted into runtime execution order. Since we build from the
        // core service impl outwarads, we have to reverse the runtime execution
        // order to get the build order.
        // That is, if user expects interceptors in order A B C (perhaps using
        // the rules: A before B, C after B).
        // Then that's the order for interceptors list: A B C 
        // To get that runtime execution order, we wrap C around the core,
        // wrap B around C, and wrap A around B.

        for (int i = count - 1; i >= 0; i--)
        {
            ServiceInterceptorContribution ic =
                (ServiceInterceptorContribution) interceptors.get(i);

            stack.process(ic);
        }

        // Whatever's on top is the final service.

        return stack.peek();
    }
View Full Code Here


        int count = interceptors == null ? 0 : interceptors.size();

        if (count == 0)
            return core;

        InterceptorStackImpl stack = new InterceptorStackImpl(_log, _servicePoint, core);

        // They are sorted into runtime execution order. Since we build from the
        // core service impl outwarads, we have to reverse the runtime execution
        // order to get the build order.
        // That is, if user expects interceptors in order A B C (perhaps using
        // the rules: A before B, C after B).
        // Then that's the order for interceptors list: A B C
        // To get that runtime execution order, we wrap C around the core,
        // wrap B around C, and wrap A around B.

        for (int i = count - 1; i >= 0; i--)
        {
            ServiceInterceptorContribution ic = (ServiceInterceptorContribution) interceptors
                    .get(i);

            stack.process(ic);
        }

        // Whatever's on top is the final service.

        return stack.peek();
    }
View Full Code Here

        new ConfigurationPointImpl().toString();
        new ElementImpl().toString();
        new AttributeImpl("foo", "bar").toString();
        new ServiceInterceptorContributionImpl().toString();
        new ServicePointImpl().toString();
        new InterceptorStackImpl(null, mockServicePoint, null).toString();
    }
View Full Code Here

        sp.getExtensionPointId();
        spControl.setReturnValue("foo.bar");
       
        replayControls();

        InterceptorStackImpl is = new InterceptorStackImpl(log, sp, r);

        f.createInterceptor(is, module, Collections.EMPTY_LIST);

        Runnable ri = (Runnable) is.peek();

        verifyControls();

        // Training
       
View Full Code Here

                }

            });
        replay(rootService, realCreatedService);

        InterceptorStack stack = new InterceptorStackImpl(log, servicePoint, rootService);

        // create the interceptor
        factory.createInterceptor(stack, invokingModule, parameters);
        ServiceImplementationFactory intercepted = (ServiceImplementationFactory) stack.peek();

        assertNotNull(intercepted);

        SomeService result = (SomeService) intercepted.createCoreServiceImplementation(factoryParameters);
        MockSwitcher switcher = (MockSwitcher) Proxy.getInvocationHandler(result);
View Full Code Here

TOP

Related Classes of org.apache.hivemind.impl.InterceptorStackImpl

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.