Package org.osgi.service.cm

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


            String[] selection = (String[]) opts.get("selection");

            Configuration[] cs = null;
            if (selection == null) {
                cs = srvCA.listConfigurations(null);
            } else {
                cs = getConfigurations(session, srvCA, selection);
            }
            if (cs == null || cs.length == 0) {
                out.println("No configurations available");
View Full Code Here


                    String filter = "(&(service.factoryPid=" + FACTORY_PID
                            + ")" + "(|(service.bundleLocation="
                            + bc.getBundle().getLocation() + ")"
                            + "(service.bundleLocation=NULL)"
                            + "(!(service.bundleLocation=*))))";
                    configs = admin.listConfigurations(filter);
                }
            } catch (Exception e) {
                if (log.doDebug())
                    log.debug("Exception when trying to get CM", e);
            }
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

       
        out.println("# The CRANKSTART_CONFIG_ID property that we add to configs is meant to detect which factory configs have already been created");
       
        final ConfigurationAdmin ca = (ConfigurationAdmin)bundleContext.getService(ref);
        try {
            final Configuration [] allCfg = ca.listConfigurations(null);
            int count = 0;
            if(allCfg != null) {
                for(Configuration cfg : allCfg) {
                    count++;
                    if(cfg.getFactoryPid() != null && cfg.getFactoryPid().length() > 0) {
View Full Code Here

            return;
        }

        try {
            // find a configuration for theses properties...
            Configuration[] cfgs = ca.listConfigurations("("
                + ConfigurationAdmin.SERVICE_FACTORYPID + "="
                + this.getClientRepositoryFactoryPID() + ")");
            if (cfgs != null && cfgs.length > 0) {
                log.info(
                    "verifyConfiguration: {} Configurations available for {}, nothing to do",
View Full Code Here

    @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

            {
                // we use listConfigurations to not create configuration
                // objects persistently without the user providing actual
                // configuration
                String filter = '(' + Constants.SERVICE_PID + '=' + pid + ')';
                Configuration[] configs = ca.listConfigurations(filter);
                if (configs != null && configs.length > 0)
                {
                    return true;
                }
            }
View Full Code Here

    {
        final ConfigurationAdmin ca = getConfigurationAdmin();
        try
        {
            final String filter = "(" + Constants.SERVICE_PID + "=" + pid + ")";
            final Configuration[] configs = ca.listConfigurations( filter );
            if ( configs != null && configs.length > 0 )
            {
                return configs[0];
            }
        }
View Full Code Here

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

        final Bundle cfgAdminBundle = configAdminTracker.getServiceReference().getBundle();
        cfgAdminBundle.stop();
        try
        {
            ca.listConfigurations( "(service.pid=sample)" );
            TestCase.fail( "Expected IllegalStateException for ConfigurationAdmin.listConfigurations" );
        }
        catch ( IllegalStateException ise )
        {
            // expected
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.