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


        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

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

        // Create interceptor
        InterceptorStackImpl is = new InterceptorStackImpl(log, sp, r);

        Class interceptorClass = f.constructInterceptorClass(is, Collections.EMPTY_LIST);
        Constructor c = interceptorClass.getConstructors()[0];

        Object interceptor =  c.newInstance(new Object[] { is.getServiceLog(), is.peek() });
        is.push(interceptor);

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

        verifyControls();

        // Training
       
View Full Code Here

        ModuleImpl module = new ModuleImpl();
        module.setModuleId("module");
        module.toString();
        new RegistryInfrastructureImpl(null, Locale.ENGLISH).toString();
        new InterceptorStackImpl(null, mockServicePoint, null).toString();

        ModuleDefinition md = new ModuleDefinitionImpl("module", null, null, null);
        ServicePointDefinitionImpl spd = new ServicePointDefinitionImpl(md, "service", null,
                Visibility.PUBLIC, Runnable.class.getName());
        ImplementationDefinition sid = new ImplementationDefinitionImpl(md,
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--)
        {
            InterceptorDefinition id = (InterceptorDefinition) interceptors
                    .get(i);

            stack.process(id);
        }

        // 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

        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

        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

        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

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.