Package org.apache.felix.dm

Examples of org.apache.felix.dm.DependencyManager.createServiceDependency()


        m.add(shellClient);
        e.waitForStep(3, 5000);
        // now create a component with a missing dependency
        Component missing = m.createComponent()
            .setImplementation(new Object() { public String toString() { return "Object"; }})
            .add(m.createServiceDependency()
                .setService(Object.class)
                .setRequired(true)
            );
        m.add(missing);
        e.step(4);
View Full Code Here


                .setImplementation(new BImpl(e));               
       
        Component c = m.createComponent()
                .setImplementation(new CImpl())
                .setInterface(C.class.getName(), null)
                .add(m.createServiceDependency().setService(A.class, "(foo=bar)").setRequired(true));                    
             
        m.add(a);
        m.add(c);
        m.add(b);
       
View Full Code Here

        }

        void init(Component c) {
            m_e.step(2);
            DependencyManager dm = c.getDependencyManager();
            c.add(dm.createServiceDependency().setService(C.class).setRequired(true).setInstanceBound(true).setCallbacks("add", "remove"));
        }     
       
        public void add(C c) {
            m_e.step(3);
        }
View Full Code Here

            m_startStep = startStep;
        }
       
        public void init(Component s) {
            DependencyManager dm = s.getDependencyManager();
            s.add(dm.createServiceDependency()
                .setInstanceBound(true)
                .setService(ProviderInterface.class)
                .setRequired(m_required)
                .setAutoConfig("m_provider"));
            m_ensure.step(m_startStep);
View Full Code Here

                .setInterface(S2.class.getName(), null)
                .setImplementation(new S1Adapter(e));
       
        Component s3 = m.createComponent()
                .setImplementation(new S3(e))
                .add(m.createServiceDependency()
                     .setService(S2.class)
                     .setRequired(true)
                     .setCallbacks("add", "change", null));
                    
             
View Full Code Here

       
        public void init(Component s) {
            DependencyManager dm = s.getDependencyManager();
            m_ensure.step(m_startStep);
            List extra = Arrays.asList(new ServiceDependency[] {
                    dm.createServiceDependency() // this dependency is available at this point
                      .setInstanceBound(true)
                      .setService(MyService1.class)
                      .setRequired(false)
                      .setCallbacks("bind", null),
                    dm.createServiceDependency() // not available: we should not be started
View Full Code Here

                    dm.createServiceDependency() // this dependency is available at this point
                      .setInstanceBound(true)
                      .setService(MyService1.class)
                      .setRequired(false)
                      .setCallbacks("bind", null),
                    dm.createServiceDependency() // not available: we should not be started
                      .setInstanceBound(true)
                      .setService(MyService2.class)
                      .setRequired(true)
                      .setAutoConfig("m_myService2")
            });
View Full Code Here

                    .setFilter("(path=*.doc)")
                    .setCallbacks("add", null));
        ResourceProvider provider = new ResourceProvider(e);
        Component resourceProvider = m.createComponent()
            .setImplementation(provider)
            .add(m.createServiceDependency()
                .setService(ResourceHandler.class)
                .setCallbacks("add", "remove"));
       
        // first add the consumer
        m.add(consumer);
View Full Code Here

            .setImplementation(provider);
       
        Consumer consumer = new Consumer(e);
        Component c = m.createComponent()
            .setImplementation(consumer)
            .add(m.createServiceDependency()
                .setService(Service.class)
                .setRequired(true)
                );
       
        m.add(p);
View Full Code Here

           .setInterface(ServiceAbstract.class.getName(), null)
           .setImplementation(new ServiceProvider(e))
           ;
       Component sc = m.createComponent()
           .setImplementation(new ServiceConsumer(e))
           .add(m.createServiceDependency()
               .setService(ServiceAbstract.class)
               .setRequired(true)
               .setCallbacks("bind", "unbind")
               );
       m.add(sp);
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.