Package org.apache.felix.dm

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


          props.put("number", "" + i);
          Component original = m.createComponent()
              .setImplementation(new ServiceProvider("" + i, e))
              .setInterface(OriginalService.class.getName(), props);
         
          Component consumer = m.createComponent()
              .setImplementation(new ServiceConsumer(e, "" + i))
              .add(m.createServiceDependency()
                  .setService(AdaptedService.class, "(number=" + i + ")")
                  .setCallbacks("add", null, "remove", "swap")
                  .setRequired(true)
View Full Code Here


        // helper class that ensures certain steps get executed in sequence
        Ensure e = new Ensure();
        // create a service provider and consumer
        Component sp = m.createComponent().setImplementation(new ServiceProvider(e)).setInterface(ServiceInterface.class.getName(), null);
        Component sc = m.createComponent().setImplementation(new ServiceConsumer(e)).add(m.createServiceDependency().setService(ServiceInterface.class).setRequired(true));
        Component sc2 = m.createComponent().setImplementation(new ServiceConsumerCallbacks(e)).add(m.createServiceDependency().setService(ServiceInterface.class).setRequired(false).setCallbacks("add", "remove"));
        m.add(sp);
        m.add(sc);
        m.remove(sc);
        m.add(sc2);
        m.remove(sp);
View Full Code Here

        // helper class that ensures certain steps get executed in sequence
        m_ensure = new Ensure();
       
        // Create a Configuration instance, which will create/update/remove a configuration for factoryPid "MyFactoryPid"
        ConfigurationCreator configurator = new ConfigurationCreator("MyFactoryPid", "key", "value1");
        Component s1 = m.createComponent()
            .setImplementation(configurator)
            .add(m.createServiceDependency()
                .setService(ConfigurationAdmin.class)
                .setRequired(true));
View Full Code Here

            .setService(AdapterExtraDependency.class)
            .setRequired(true)
            .setAutoConfig(true));
       
        // Create extra adapter service dependency upon which our adapter depends on.
        Component s3 = m.createComponent()
            .setImplementation(new AdapterExtraDependency())
            .setInterface(AdapterExtraDependency.class.getName(), null);
       
        // Create an AdapterService Consumer
        Component s4 = m.createComponent()
View Full Code Here

        Component s3 = m.createComponent()
            .setImplementation(new AdapterExtraDependency())
            .setInterface(AdapterExtraDependency.class.getName(), null);
       
        // Create an AdapterService Consumer
        Component s4 = m.createComponent()
            .setImplementation(AdapterServiceConsumer.class)
            .add(m.createServiceDependency()
                .setService(AdapterService.class)
                .setRequired(true)
                .setCallbacks("bind", "change", "remove"));
View Full Code Here

        m_invokeStep = new Ensure();
       
        // Create our original "S" service.
        Dictionary props = new Hashtable();
        props.put("foo", "bar");
        Component s = m.createComponent()
                .setImplementation(new SImpl())
                .setInterface(S.class.getName(), props);
       
        // Create an aspect aware client, depending on "S" service.
        Client clientImpl;
View Full Code Here

                .setImplementation(new SImpl())
                .setInterface(S.class.getName(), props);
       
        // Create an aspect aware client, depending on "S" service.
        Client clientImpl;
        Component client = m.createComponent()
                .setImplementation((clientImpl = new Client()))
                .add(m.createServiceDependency()
                     .setService(S.class)
                     .setRequired(true)
                     .setDebug("client")
View Full Code Here

        m_invokeStep = new Ensure();
       
        // Create our original "S" service.
        Dictionary props = new Hashtable();
        props.put("foo", "bar");
        Component s = m.createComponent()
                .setImplementation(new SImpl())
                .setInterface(S.class.getName(), props);
       
        // Create an aspect aware client, depending on "S" service.
        Client clientImpl;
View Full Code Here

                .setImplementation(new SImpl())
                .setInterface(S.class.getName(), props);
       
        // Create an aspect aware client, depending on "S" service.
        Client clientImpl;
        Component client = m.createComponent()
                .setImplementation((clientImpl = new Client()))
                .add(m.createServiceDependency()
                     .setService(S.class)
                     .setRequired(true)
                     .setDebug("client")
View Full Code Here

        m_invokeStep = new Ensure();
       
        // Create our original "S" service.
        Dictionary props = new Hashtable();
        props.put("foo", "bar");
        Component s = m.createComponent()
                .setImplementation(new SImpl())
                .setInterface(S.class.getName(), props);
       
        // Create some "S" aspects
        Component[] aspects = new Component[ASPECTS];
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.