public static void prepareContext(GenericApplicationContext ctx)
  {
    final String configFileName = "annis-service.properties";
    
    MutablePropertySources sources = ctx.getEnvironment().getPropertySources();
    try
    {
      File fBase = new File(Utils.getAnnisFile(
        "conf/" + configFileName ).getAbsolutePath());
      if(fBase.canRead() && fBase.isFile())
      {
        sources.addFirst(new ResourcePropertySource("file:" + fBase.getCanonicalPath()));
      }
      
      String globalConfig = System.getenv("ANNIS_CFG");
      if(globalConfig == null)
      {
        globalConfig = "/etc/annis";
      }
      File fGlobal = new File(globalConfig + "/" + configFileName);
      if(fGlobal.canRead() && fGlobal.isFile())
      {
        sources.addFirst(new ResourcePropertySource("file:" + fBase.getCanonicalPath()));
      }
      
      String userConfig = System.getProperty("user.home") + "/.annis";
      File fUser = new File(userConfig + "/" + configFileName);
      if(fUser.canRead() && fUser.isFile())
      {
        sources.addFirst(new ResourcePropertySource("file:" + fUser.getCanonicalPath()));
      }
      
    }
    catch (IOException ex)
    {
      log.error("Could not load configuration", ex);
    }
  }
public static void prepareContext ( GenericApplicationContext ctx ) { final String configFileName = "annis-service.properties" ; MutablePropertySources sources = ctx . getEnvironment ( ) . getPropertySources ( ) ; try { File fBase = new File ( Utils . getAnnisFile ( "conf/" + configFileName ) . getAbsolutePath ( ) ) ; if ( fBase . canRead ( ) && fBase . isFile ( ) ) { sources . addFirst ( new ResourcePropertySource ( "file:" + fBase . getCanonicalPath ( ) ) ) ; } String globalConfig = System . getenv ( "ANNIS_CFG" ) ; if ( globalConfig == null ) { globalConfig = "/etc/annis" ; } File fGlobal = new File ( globalConfig + "/" + configFileName ) ; if ( fGlobal . canRead ( ) && fGlobal . isFile ( ) ) { sources . addFirst ( new ResourcePropertySource ( "file:" + fBase . getCanonicalPath ( ) ) ) ; } String userConfig = System . getProperty ( "user.home" ) + "/.annis" ; File fUser = new File ( userConfig + "/" + configFileName ) ; if ( fUser . canRead ( ) && fUser . isFile ( ) ) { sources . addFirst ( new ResourcePropertySource ( "file:" + fUser . getCanonicalPath ( ) ) ) ; } } catch ( IOException ex ) { log . error ( "Could not load configuration" , ex ) ; } }
Adds the ANNIS specific {@link ResourcePropertySource} sources to the
{@link GenericApplicationContext}.

The annis-service.properties is loaded from the following locations (in order):
$ANNIS_HOME/conf/
$ANNIS_CFG or /etc/annis/
~/.annis/

@param ctx