Search in sources :

Example 1 with ConfigRepositoryImpl

use of org.apache.karaf.config.core.impl.ConfigRepositoryImpl in project karaf by apache.

the class EditCommandTest method setUp.

@Override
protected void setUp() throws Exception {
    command = new EditCommand();
    admin = createMock(ConfigurationAdmin.class);
    command.setConfigRepository(new ConfigRepositoryImpl(admin));
    session = new MockCommandSession();
    command.setSession(session);
}
Also used : ConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin) ConfigRepositoryImpl(org.apache.karaf.config.core.impl.ConfigRepositoryImpl)

Example 2 with ConfigRepositoryImpl

use of org.apache.karaf.config.core.impl.ConfigRepositoryImpl in project karaf by apache.

the class Activator method doStart.

protected void doStart() throws Exception {
    ConfigurationAdmin configurationAdmin = getTrackedService(ConfigurationAdmin.class);
    if (configurationAdmin == null) {
        return;
    }
    ConfigRepository configRepository = new ConfigRepositoryImpl(configurationAdmin, new File(System.getProperty("karaf.etc")));
    register(ConfigRepository.class, configRepository);
    ConfigMBeanImpl configMBean = new ConfigMBeanImpl();
    configMBean.setConfigRepo(configRepository);
    registerMBean(configMBean, "type=config");
}
Also used : ConfigRepository(org.apache.karaf.config.core.ConfigRepository) ConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin) File(java.io.File) ConfigRepositoryImpl(org.apache.karaf.config.core.impl.ConfigRepositoryImpl) ConfigMBeanImpl(org.apache.karaf.config.core.impl.ConfigMBeanImpl)

Aggregations

ConfigRepositoryImpl (org.apache.karaf.config.core.impl.ConfigRepositoryImpl)2 ConfigurationAdmin (org.osgi.service.cm.ConfigurationAdmin)2 File (java.io.File)1 ConfigRepository (org.apache.karaf.config.core.ConfigRepository)1 ConfigMBeanImpl (org.apache.karaf.config.core.impl.ConfigMBeanImpl)1