Package org.osgi.service.cm

Examples of org.osgi.service.cm.Configuration


    protected Configuration configure( final String pid, final String location, final boolean withProps )
    {
        final ConfigurationAdmin ca = getConfigurationAdmin();
        try
        {
            final Configuration config = ca.getConfiguration( pid, location );
            if ( withProps )
            {
                config.update( theConfig );
            }
            return config;
        }
        catch ( IOException ioe )
        {
View Full Code Here


        final boolean withProps )
    {
        final ConfigurationAdmin ca = getConfigurationAdmin();
        try
        {
            final Configuration config = ca.createFactoryConfiguration( factoryPid, location );
            if ( withProps )
            {
                config.update( theConfig );
            }
            return config;
        }
        catch ( IOException ioe )
        {
View Full Code Here

    {
        final ConfigurationAdmin ca = getConfigurationAdmin();
        try
        {
            configurations.remove( pid );
            final Configuration config = ca.getConfiguration( pid );
            config.delete();
        }
        catch ( IOException ioe )
        {
            TestCase.fail( "Failed deleting configuration " + pid + ": " + ioe.toString() );
        }
View Full Code Here

        ComponentConfigurationDTO dto = findComponentConfigurationByName(name, ComponentConfigurationDTO.SATISFIED);
        AnnoComponent ac = getServiceFromConfiguration(dto, AnnoComponent.class);
        checkA1NoValues(ac.m_a1_activate);
        checkA1ArraysNoValues(ac.m_a1Arrays_activate);
       
        Configuration c = configure(name, null, allValues());
        delay();
       
        checkA1(ac.m_a1_modified);
        checkA1Array(ac.m_a1Arrays_modified);

        ungetServiceFromConfiguration(dto, AnnoComponent.class);
        checkA1(ac.m_a1_deactivate);
        checkA1Array(ac.m_a1Arrays_deactivate);
        ac = getServiceFromConfiguration(dto, AnnoComponent.class);
        checkA1(ac.m_a1_activate);
        checkA1Array(ac.m_a1Arrays_activate);
       
        c.delete();
        delay();
       
        checkA1NoValues(ac.m_a1_modified);
        checkA1ArraysNoValues(ac.m_a1Arrays_modified);
       
        c = configure(name, null, arrayValues());
        delay();
       
        checkA1FromArray(ac.m_a1_modified);
        checkA1ArrayFromArray(ac.m_a1Arrays_modified, false);
       
        c.delete();
        delay();
       
        checkA1NoValues(ac.m_a1_modified);
        checkA1ArraysNoValues(ac.m_a1Arrays_modified);
       
View Full Code Here

    @Test
    public void test_configuration_getFacotryPid_after_config_admin_stop() throws BundleException
    {
        final String pid = "test_configuration_after_config_admin_stop";
        final Configuration config = configure( pid, null, true );

        final Bundle cfgAdminBundle = configAdminTracker.getServiceReference().getBundle();
        cfgAdminBundle.stop();
        try
        {
            config.getFactoryPid();
        }
        finally
        {
            try
            {
View Full Code Here

    @Test
    public void test_configuration_equals_after_config_admin_stop() throws BundleException
    {
        final String pid = "test_configuration_after_config_admin_stop";
        final Configuration config = configure( pid, null, true );

        final Bundle cfgAdminBundle = configAdminTracker.getServiceReference().getBundle();
        cfgAdminBundle.stop();
        try
        {
            config.equals( config );
        }
        finally
        {
            try
            {
View Full Code Here

    @Test
    public void test_configuration_hashCode_after_config_admin_stop() throws BundleException
    {
        final String pid = "test_configuration_after_config_admin_stop";
        final Configuration config = configure( pid, null, true );

        final Bundle cfgAdminBundle = configAdminTracker.getServiceReference().getBundle();
        cfgAdminBundle.stop();
        try
        {
            config.hashCode();
        }
        finally
        {
            try
            {
View Full Code Here

    @Test
    public void test_configuration_toString_after_config_admin_stop() throws BundleException
    {
        final String pid = "test_configuration_after_config_admin_stop";
        final Configuration config = configure( pid, null, true );

        final Bundle cfgAdminBundle = configAdminTracker.getServiceReference().getBundle();
        cfgAdminBundle.stop();
        try
        {
            config.toString();
        }
        finally
        {
            try
            {
View Full Code Here


    public void test_configuration_getPid_after_config_admin_stop() throws BundleException
    {
        final String pid = "test_configuration_after_config_admin_stop";
        final Configuration config = configure( pid, null, true );

        final Bundle cfgAdminBundle = configAdminTracker.getServiceReference().getBundle();
        cfgAdminBundle.stop();
        try
        {
            config.getPid();
        }
        finally
        {
            try
            {
View Full Code Here

    @Test
    public void test_configuration_getProperties_after_config_admin_stop() throws BundleException
    {
        final String pid = "test_configuration_after_config_admin_stop";
        final Configuration config = configure( pid, null, true );

        final Bundle cfgAdminBundle = configAdminTracker.getServiceReference().getBundle();
        cfgAdminBundle.stop();
        try
        {
            config.getProperties();
        }
        finally
        {
            try
            {
View Full Code Here

TOP

Related Classes of org.osgi.service.cm.Configuration

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.