Package org.apache.sling.models.impl.injectors

Examples of org.apache.sling.models.impl.injectors.RequestAttributeInjector


        // register sling models adapter factory
        MockModelAdapterFactory mockModelAdapterFactory = new MockModelAdapterFactory(componentContext);
        bundleContext.registerService(AdapterFactory.class.getName(), mockModelAdapterFactory, null);

        // register some injectors
        bundleContext.registerService(Injector.class.getName(), new RequestAttributeInjector(), null);
        OSGiServiceInjector osgiServiceInjector = new OSGiServiceInjector();
        osgiServiceInjector.activate(componentContext);
        bundleContext.registerService(Injector.class.getName(), osgiServiceInjector, null);

        // register implementation pickers
View Full Code Here


        osgiInjector.activate(componentCtx);

        BindingsInjector bindingsInjector = new BindingsInjector();
        ValueMapInjector valueMapInjector = new ValueMapInjector();
        ChildResourceInjector childResourceInjector = new ChildResourceInjector();
        RequestAttributeInjector requestAttributeInjector = new RequestAttributeInjector();

        factory.bindInjector(bindingsInjector,
                Collections.<String, Object> singletonMap(Constants.SERVICE_ID, 1L));
        factory.bindInjector(valueMapInjector,
                Collections.<String, Object> singletonMap(Constants.SERVICE_ID, 2L));
View Full Code Here

        when(request.getAttribute("attribute")).thenReturn(INT_VALUE);
        when(request.getAttribute("attribute2")).thenReturn(STRING_VALUE);

        factory = new ModelAdapterFactory();
        factory.activate(componentCtx);
        factory.bindInjector(new RequestAttributeInjector(), new ServicePropertiesMap(1, 1));
        factory.bindInjector(new SelfInjector(), new ServicePropertiesMap(2, 2));
    }
View Full Code Here

        registerService(Injector.class, new BindingsInjector());
        registerService(Injector.class, new ChildResourceInjector());
        OSGiServiceInjector osgiServiceInjector = new OSGiServiceInjector();
        osgiServiceInjector.activate(componentContext());
        registerService(Injector.class, osgiServiceInjector);
        registerService(Injector.class, new RequestAttributeInjector());
        registerService(Injector.class, new ResourcePathInjector());
        registerService(Injector.class, new ResourceResolverInjector());
        registerService(Injector.class, new SelfInjector());
        registerService(Injector.class, new SlingObjectInjector());
        registerService(Injector.class, new ValueMapInjector());
View Full Code Here

        when(componentCtx.getProperties()).thenReturn(new Hashtable<String, Object>());

        factory = new ModelAdapterFactory();
        factory.activate(componentCtx);

        RequestAttributeInjector injector = new RequestAttributeInjector();
        factory.bindInjector(injector, new ServicePropertiesMap(1, 1));
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.models.impl.injectors.RequestAttributeInjector

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.