Changeset 25

Show
Ignore:
Timestamp:
09/26/07 16:37:43 (1 year ago)
Author:
alexander
Message:

Enhanced the configuration mechanism of PlanetSim, that there is now a possibility to register an application specific properties class, which can utilize the general properties file of this run configuration

Location:
trunk/src/planet/util
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/planet/util/Properties.java

    r2 r25  
    110110    public static final String FACTORIES_ENDPOINT                               = "FACTORIES_ENDPOINT"; 
    111111 
     112    /** 
     113     * Application property: Default key specified in the properties file that 
     114     * identifies implementation class for ApplicationProperties interface. 
     115     */ 
     116    public static final String APPLICATION_PROPERTIES                           = "APPLICATION_PROPERTIES"; 
     117 
     118     
    112119     
    113120    /* *********************** SIMULATOR PROPERTIES NAMES ***********************/ 
     
    352359     */ 
    353360    public static Class factoriesEndPoint                                       = null; 
     361    /** 
     362     * Application property: Implementation class for PropertiesInitializer interface. 
     363     */ 
     364    public static Class applicationProperties                                   = null; 
     365    /** 
     366     * Application property: Instance of the implementation class for  
     367     * PropertiesInitializer interface for the current application. 
     368     */ 
     369    public static ApplicationProperties applicationPropertiesInstance           = null; 
     370     
    354371 
    355372     
     
    941958        Properties.factoriesApplication        = properties.getPropertyAsClass(FACTORIES_APPLICATION); 
    942959        Properties.factoriesEndPoint           = properties.getPropertyAsClass(FACTORIES_ENDPOINT); 
     960 
     961        Properties.applicationProperties         = properties.getPropertyAsClass(APPLICATION_PROPERTIES); 
    943962         
    944963        //testing the correctness of the values 
     
    947966        Interfaces.ensureImplementedInterfaceOrClass(Properties.factoriesApplication,       Interfaces.FACTORIES_APPLICATION,       FACTORIES_APPLICATION); 
    948967        Interfaces.ensureImplementedInterfaceOrClass(Properties.factoriesEndPoint,          Interfaces.FACTORIES_ENDPOINT,          FACTORIES_ENDPOINT); 
     968 
     969        //ending the loading process 
     970        Properties.applicationPropertiesInstance = (ApplicationProperties)loadPropertiesInitializer(Properties.applicationProperties); 
     971 
    949972    } 
    950973