Package org.apache.felix.dm

Examples of org.apache.felix.dm.Dependency


        System.out.println("destroy");
      }
     
      void changed(Component component) {
        m_ensure.step(2);
        Dependency oldDependency = null;
       
        for (Object dependency : component.getDependencies()) {
          if (dependency instanceof ServiceDependency) {
            // remove the dependency
            oldDependency = (Dependency) dependency;
View Full Code Here


      }
     
      void changed(Component component) {
        m_ensure.step(2);
        System.out.println("Changing the dependencies");
        Dependency oldDependency = null;
       
        for (Object dependency : component.getDependencies()) {
          if (dependency instanceof ServiceDependency) {
            // remove the dependency
            oldDependency = (Dependency) dependency;
            System.out.println("Old dependency props: " + oldDependency.getProperties());
          }
        }
       
        // and add a new dependency
        component.add(component.getDependencyManager().createServiceDependency().setService(ServiceInterface.class, "(id=2)").setRequired(true).setInstanceBound(true));
View Full Code Here

       
        // if we're inactive, don't do anything, otherwise we might want to start
        // the dependencies
        if (!oldState.isInactive()) {
            for (int i = 0; i < dependencies.size(); i++) {
                Dependency dependency = (Dependency) dependencies.get(i);
                // if the dependency is required, it should be started regardless of the state
                // we're in
                if (dependency.isRequired()) {
                    ((DependencyActivation) dependency).start(this);
                }
                else {
                    // if the dependency is optional, it should only be started if we're in
                    // bound state
View Full Code Here

    }
   
    private void configureServiceWithExtraDependencies(State state) {
        Iterator i = state.getDependencies().iterator();
        while (i.hasNext()) {
            Dependency dependency = (Dependency) i.next();
            if (dependency.isAutoConfig() && dependency.isInstanceBound()) {
                configureImplementation(dependency.getAutoConfigType(), dependency.getAutoConfigInstance(), dependency.getAutoConfigName());
            }
        }
    }
View Full Code Here

    }

    private void startTrackingOptional(State state) {
        Iterator i = state.getDependencies().iterator();
        while (i.hasNext()) {
            Dependency dependency = (Dependency) i.next();
            if (!dependency.isRequired()) {
                ((DependencyActivation) dependency).start(this);
            }
        }
    }
View Full Code Here

    }
   
    private void stopTrackingOptional(State state) {
        Iterator i = state.getDependencies().iterator();
        while (i.hasNext()) {
            Dependency dependency = (Dependency) i.next();
            if (!dependency.isRequired()) {
                ((DependencyActivation) dependency).stop(this);
            }
        }
    }
View Full Code Here

    }

    private void startTrackingRequired(State state) {
        Iterator i = state.getDependencies().iterator();
        while (i.hasNext()) {
            Dependency dependency = (Dependency) i.next();
            if (dependency.isRequired()) {
                ((DependencyActivation) dependency).start(this);
            }
        }
    }
View Full Code Here

    }

    private void stopTrackingRequired(State state) {
        Iterator i = state.getDependencies().iterator();
        while (i.hasNext()) {
            Dependency dependency = (Dependency) i.next();
            if (dependency.isRequired()) {
                ((DependencyActivation) dependency).stop(this);
            }
        }
    }
View Full Code Here

  private Dictionary calculateServiceProperties() {
    Dictionary properties = new Properties();
    addTo(properties, m_serviceProperties);
    for (int i = 0; i < m_dependencies.size(); i++) {
      Dependency d = (Dependency) m_dependencies.get(i);
      if (d.isPropagated() && d.isAvailable()) {
        Dictionary dict = d.getProperties();
        addTo(properties, dict);
      }
    }
    if (properties.size() == 0) {
      properties = null;
View Full Code Here

    }

    private void configureServices(State state) {
        Iterator i = state.getDependencies().iterator();
        while (i.hasNext()) {
            Dependency dependency = (Dependency) i.next();
            if (dependency.isAutoConfig()) {
                configureImplementation(dependency.getAutoConfigType(), dependency.getAutoConfigInstance(), dependency.getAutoConfigName());
            }
            if (dependency.isRequired()) {
                dependency.invokeAdded(this);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.felix.dm.Dependency

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.