public void applyProperties ( Properties props ) { Iterator < ? > iter = props . keySet ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { String fullName = ( String ) iter . next ( ) ; String value = props . getProperty ( fullName ) . trim ( ) ; if ( fullName . indexOf ( ":" ) != - 1 && value != null && value . length ( ) > 0 ) { String name = fullName . substring ( fullName . lastIndexOf ( ":" ) + 1 ) ; if ( fullName . startsWith ( "server:" ) ) { if ( name . endsWith ( ".class" ) ) { m_className = value ; } else { setParameterValue ( name , value , true ) ; } } else if ( fullName . startsWith ( "module." ) ) { String role = fullName . substring ( 7 , fullName . lastIndexOf ( ":" ) ) ; ModuleConfiguration module = getModuleConfiguration ( role ) ; if ( module == null ) { module = new ModuleConfiguration ( new ArrayList < Parameter > ( ) , role , null , null ) ; m_moduleConfigurations . add ( module ) ; } if ( name . endsWith ( ".class" ) ) { module . setClassName ( value ) ; } else { module . setParameterValue ( name , value , true ) ; } } else if ( fullName . startsWith ( "datastore." ) ) { String id = fullName . substring ( 10 , fullName . lastIndexOf ( ":" ) ) ; DatastoreConfiguration datastore = getDatastoreConfiguration ( id ) ; if ( datastore == null ) { datastore = new DatastoreConfiguration ( new ArrayList < Parameter > ( ) , id , null ) ; m_datastoreConfigurations . add ( datastore ) ; } datastore . setParameterValue ( name , value , true ) ; } } } }
Apply the given properties to this ServerConfiguration . Trims leading and trailing spaces from the property values before applying them .