Examples of listConfigurations()


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

    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

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

        }
            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

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

    {
        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

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

    }

    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

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

    {
        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

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

            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

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

    @Override
    protected Dictionary getEditedProps() throws Exception {
        if(pid != null) {
            ConfigurationAdmin configurationAdmin = getConfigurationAdmin();
            if (configurationAdmin != null) {
                Configuration[] configs = configurationAdmin.listConfigurations("(service.pid=" + pid + ")");
                if (configs != null && configs.length > 0) {
                    Configuration configuration = configs[0];
                    if (configuration != null) {
                        return configuration.getProperties();
                    }
View Full Code Here

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

        Dictionary<String, Object> conf4 = new Hashtable<String, Object>();
        conf4.put("zar", "visitor");
        conf4.put(Constants.SERVICE_PID, "jmx.acl");

        ConfigurationAdmin ca = getMockConfigAdmin2(conf1, conf2, conf3, conf4);
        assertEquals("Precondition", 4, ca.listConfigurations("(service.pid=jmx.acl*)").length);

        KarafMBeanServerGuard guard = new KarafMBeanServerGuard();
        guard.setConfigAdmin(ca);

        ObjectName on = ObjectName.getInstance("foo.bar:type=Test");
View Full Code Here

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

        ConfigurationAdmin ca = EasyMock.createMock(ConfigurationAdmin.class);
        for (Configuration c : allConfigs) {
            EasyMock.expect(ca.getConfiguration(c.getPid())).andReturn(c).anyTimes();
        }
        EasyMock.expect(ca.listConfigurations(EasyMock.eq("(service.pid=jmx.acl*)"))).andReturn(
                allConfigs.toArray(new Configuration[]{})).anyTimes();
        EasyMock.replay(ca);
        return ca;
    }

View Full Code Here

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

            EasyMock.replay(conf);
            configurations[i] = conf;
        }

        ConfigurationAdmin ca = EasyMock.createMock(ConfigurationAdmin.class);
        EasyMock.expect(ca.listConfigurations("(&(service.pid=org.apache.karaf.service.acl.*)(service.guard=*))")).andReturn(configurations).anyTimes();
        EasyMock.replay(ca);

        final ServiceReference caSR = EasyMock.createMock(ServiceReference.class);
        EasyMock.replay(caSR);

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.