mil.dod.th.ose.integration/src/example/metatype/configadmin/ExampleInMemConfigClass.java
@Override
    public void updated(final Dictionary<String, ?> props)
    {
        //configuration object
        final Configuration configuration;
        try
        {
            configuration = m_ConfigAdmin.getConfiguration("example.metatype.configadmin.ExampleInMemConfigClass");
        }
        catch (final IOException e)
        {
            //log error
            m_Logging.debug(e.getMessage() + " Unable to get or create example configuration with PID [%s]", 
                "example.metatype.configadmin.ExampleInMemConfigClass");
            //error in the example class, nothing further can be done
            return;
        }

        //check properties in case this is an update versus calls made at activation.
        Dictionary<String, Object> existingProperties = configuration.getProperties();
        if (existingProperties ==  null)
        {
            existingProperties = new Hashtable<String, Object>();
        }

        if (props == null)
        {
            //add a property just as an example
            existingProperties.put("name.example.property", "example.example.bundle.example");
        }
        else
        {
            // add missing properties
            final Enumeration<String> keys = props.keys();
            while (keys.hasMoreElements())
            {
                final String key = keys.nextElement();
                existingProperties.put(key, props.get(key));
            }
        }
    }
/**
     * Update the configuration with the given values.
     * At activation if the configuration does not exist it will be created.
     * @param props
     *     map of properties to use. 
     */
Update the configuration with the given values.
At activation if the configuration does not exist it will be created.
@param props
map of properties to use.
Update the configuration with the given values . At activation if the configuration does not exist it will be created . @param props map of properties to use .
@Override
    public void updated(final Dictionary<String, ?> props)
    {
        final Configuration configuration;
        try
        {
            configuration = m_ConfigAdmin.getConfiguration("example.metatype.configadmin.ExampleInMemConfigClass");
        }
        catch (final IOException e)
        {
            m_Logging.debug(e.getMessage() + " Unable to get or create example configuration with PID [%s]", 
                "example.metatype.configadmin.ExampleInMemConfigClass");
            return;
        }
        Dictionary<String, Object> existingProperties = configuration.getProperties();
        if (existingProperties ==  null)
        {
            existingProperties = new Hashtable<String, Object>();
        }
        if (props == null)
        {
            existingProperties.put("name.example.property", "example.example.bundle.example");
        }
        else
        {
            final Enumeration<String> keys = props.keys();
            while (keys.hasMoreElements())
            {
                final String key = keys.nextElement();
                existingProperties.put(key, props.get(key));
            }
        }
    }
@ Override public void updated ( final Dictionary < String , ? > props ) { final Configuration configuration ; try { configuration = m_ConfigAdmin . getConfiguration ( "example.metatype.configadmin.ExampleInMemConfigClass" ) ; } catch ( final IOException e ) { m_Logging . debug ( e . getMessage ( ) + " Unable to get or create example configuration with PID [%s]" , "example.metatype.configadmin.ExampleInMemConfigClass" ) ; return ; } Dictionary < String , Object > existingProperties = configuration . getProperties ( ) ; if ( existingProperties == null ) { existingProperties = new Hashtable < String , Object > ( ) ; } if ( props == null ) { existingProperties . put ( "name.example.property" , "example.example.bundle.example" ) ; } else { final Enumeration < String > keys = props . keys ( ) ; while ( keys . hasMoreElements ( ) ) { final String key = keys . nextElement ( ) ; existingProperties . put ( key , props . get ( key ) ) ; } } }
Update the configuration with the given values.
Update the configuration with the given values .
//configuration object //log error //error in the example class, nothing further can be done //check properties in case this is an update versus calls made at activation. //add a property just as an example // add missing properties