Package org.apache.hivemind.definition

Examples of org.apache.hivemind.definition.InterceptorDefinition


        if (interceptors != null)
        {
            for (Iterator i = interceptors.iterator(); i.hasNext();)
            {
                InterceptorDefinition icd = (InterceptorDefinition) i.next();

                Element interceptor = getInterceptorElement(icd);

                servicePoint.appendChild(interceptor);
            }
View Full Code Here


    public void testInterceptorSort() throws Exception
    {
        ModuleDefinition module = new SimpleModule();
        ServicePointDefinition servicePoint = module.getServicePoint("Simple");
       
        InterceptorDefinition interceptor1 = new OrderedInterceptorDefinitionImpl(module, "Fred", newLocation(), new TrackerServiceInterceptorConstructor("Fred"), "Barney", null);
        servicePoint.addInterceptor(interceptor1);
        InterceptorDefinition interceptor2 = new OrderedInterceptorDefinitionImpl(module, "Barney", newLocation(), new TrackerServiceInterceptorConstructor("Barney"), null, null);
        servicePoint.addInterceptor(interceptor2);
        InterceptorDefinition interceptor3 = new OrderedInterceptorDefinitionImpl(module, "Wilma", newLocation(), new TrackerServiceInterceptorConstructor("Wilma"), null, "Barney");
        servicePoint.addInterceptor(interceptor3);
       
        Registry r =
            buildFrameworkRegistry(module);
View Full Code Here

                catch (Exception e) {
                    throw new ApplicationRuntimeException(e);
                }
                interceptorStack.push(interceptor);
            }};
        InterceptorDefinition interceptor = new InterceptorDefinitionImpl(module, "hivemind.LoggingInterceptor", module.getLocation(), constructor);
        sp.addInterceptor(interceptor);
        return buildFrameworkRegistry(module);
    }
View Full Code Here

        // 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);
        }
View Full Code Here

                catch (Exception e) {
                    throw new ApplicationRuntimeException(e);
                }
                interceptorStack.push(interceptor);
            }};
        InterceptorDefinition interceptor = new InterceptorDefinitionImpl(helper.getModule(), "hivemind.LoggingInterceptor", getLocation(), constructor);
        sp.addInterceptor(interceptor);
    }
View Full Code Here

                .interceptorContribution());

        Iterator i = interceptorDefinitions.iterator();
        while (i.hasNext())
        {
            InterceptorDefinition sid = (InterceptorDefinition) i.next();

            // Sort them into runtime excecution order. When we build
            // the interceptor stack we'll apply them in reverse order,
            // building outward from the core service implementation.

            String precedingNames = null;
            String followingNames = null;
            // Check if info about ordering is available
            if (sid instanceof Orderable) {
                Orderable orderable = (Orderable) sid;
                precedingNames = orderable.getPrecedingNames();
                followingNames = orderable.getFollowingNames();
            }
           
            orderer.add(sid, sid.getName(), precedingNames, followingNames);
        }

        return orderer.getOrderedObjects();
    }
View Full Code Here

        replayControls();

        ModuleDefinition moduleDef = createModuleDefinition("module");
        ServicePointImpl sp = newServicePoint(moduleDef, l, module);
       
        InterceptorDefinition interceptor1 = new OrderedInterceptorDefinitionImpl(moduleDef, "Interceptor1", null, null,
                null, null);
        sp.getServicePointDefinition().addInterceptor(interceptor1);
        InterceptorDefinition interceptor2 = new OrderedInterceptorDefinitionImpl(moduleDef, "Interceptor2", null, null,
                null, null);
        sp.getServicePointDefinition().addInterceptor(interceptor2);
//        sp.getServicePointDefinition()setExtensionPointId("ExtensionPointId");
        final List ordered = sp.getOrderedInterceptorContributions();
        assertNotNull(ordered);
View Full Code Here

        replayControls();

        ModuleDefinition moduleDef = createModuleDefinition("module");
        ServicePointImpl sp = newServicePoint(moduleDef, l, module);
       
        InterceptorDefinition interceptor1 = new OrderedInterceptorDefinitionImpl(moduleDef, "Interceptor1", null, null,
                null, null);
        sp.getServicePointDefinition().addInterceptor(interceptor1);
        InterceptorDefinition interceptor2 = new OrderedInterceptorDefinitionImpl(moduleDef, "Interceptor2", null, null,
                null, "Interceptor1");
        sp.getServicePointDefinition().addInterceptor(interceptor2);
        final List ordered = sp.getOrderedInterceptorContributions();
        assertNotNull(ordered);
        assertEquals(2, ordered.size());
View Full Code Here

TOP

Related Classes of org.apache.hivemind.definition.InterceptorDefinition

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.