Package org.osgi.service.cm

Examples of org.osgi.service.cm.ConfigurationAdmin.listConfigurations()


        {

            ConfigurationAdmin ca = (ConfigurationAdmin) getBundleContext().getService(sr);
            try
            {
                Configuration[] configs = ca.listConfigurations(null);

                if (configs != null && configs.length > 0)
                {
                    Set factories = new HashSet();
                    SortedMap sm = new TreeMap();
View Full Code Here


  public String[] listConfigurations(String filter) throws Exception {
    ConfigurationAdmin cad=ac.getConfigurationAdmin();
    Configuration[] confs = null;
    if (cad!= null) {
      confs = cad.listConfigurations(filter);
            refresh();
      if (confs == null)
        return null;
    }
    String[] result = new String[confs.length];
View Full Code Here

   */
  public void deleteConfigurations(String filter) throws Exception {
    ConfigurationAdmin cad=ac.getConfigurationAdmin();
    Configuration[] confs = null;
    if (cad!= null) {
      confs = cad.listConfigurations(filter);
    }
    if (confs != null)
      for (int i = 0; i < confs.length; i++) {
        confs[i].delete();
      }
View Full Code Here

  public void removePropertyFromConfigurations(String filter, String name)
    throws Exception {
    ConfigurationAdmin cad=ac.getConfigurationAdmin();
    Configuration[] confs = null;
    if (cad != null) {
      confs = cad.listConfigurations(filter);
    }
    if (confs != null)
      for (int i = 0; i < confs.length; i++) {
        Dictionary dic = confs[i].getProperties();
        Enumeration keys = dic.keys();
View Full Code Here

    throws Exception {
    if (isValidType(type)) {
      ConfigurationAdmin cad=ac.getConfigurationAdmin();
      Configuration[] confs = null;
      if (cad != null) {
        confs = cad.listConfigurations(filter);
      }
      if (confs != null)
        for (int i = 0; i < confs.length; i++) {
          Dictionary dic = confs[i].getProperties();
          dic.put(name, castValueToType(type, value));
View Full Code Here

        }
            ac.debug("creating mbeans for existing config objects");
            Configuration[] confs = null;
            //confs contains the new config objects
            //The old ones are in configObjects, whose key is the object name.
            confs = cad.listConfigurations(null);
            if (confs!=null) {
                ac.debug("Existing conf objects: ");
            for(int i=0;i<confs.length;i++) {
                ac.debug("\t"+confs[i].getPid());
                //now we add the new ones
View Full Code Here

    {
        ConfigurationAdmin ca = getConfigurationAdmin();
        try
        {
            final String filter = "(service.factoryPid=" + factoryPid + ")";
            org.osgi.service.cm.Configuration[] configs = ca.listConfigurations( filter );
            if ( configs != null )
            {
                for ( org.osgi.service.cm.Configuration configuration : configs )
                {
                    configuration.delete();
View Full Code Here

    }

    protected Configuration findConfiguration(String pid) throws Exception {
      final ConfigurationAdmin ca = this.waitForConfigAdmin(true);
      if (ca != null) {
        final Configuration[] cfgs = ca.listConfigurations(null);
        if (cfgs != null) {
          for(Configuration cfg : cfgs) {
              try {
                if(cfg.getPid().equals(pid)) {
                  return cfg;
View Full Code Here

    {
        ConfigurationAdmin ca = getConfigurationAdmin();
        try
        {
            final String filter = "(service.factoryPid=" + factoryPid + ")";
            org.osgi.service.cm.Configuration[] configs = ca.listConfigurations( filter );
            if ( configs != null )
            {
                for ( org.osgi.service.cm.Configuration configuration : configs )
                {
                    configuration.delete();
View Full Code Here

            return;
        }

        try {
            // find a configuration for theses properties...
            Configuration[] cfgs = ca.listConfigurations("("
                + ConfigurationAdmin.SERVICE_FACTORYPID + "="
                + SERVER_REPOSITORY_FACTORY_PID + ")");
            if (cfgs != null && cfgs.length > 0) {
                log.info(
                    "verifyConfiguration: {} Configurations available for {}, nothing to do",
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.