/** * Loads a containerConfiguration file and set is as the Avalon configuration to * be used for Configurable.configure(). Take care that the implementation uses * an InputStreamLocator to find the containerConfiguration which uses the * previously set application root directory. * * @param location the location of the containerConfiguration * @throws IOException loading the configuration failed */ public void loadContainerConfiguration(String location) throws IOException { this.loadContainerConfiguration(location, "false"); }
/** * Loads a containerConfiguration file and set is as the Avalon * configuration to be used for Configurable.configure(). Take * care that the implementation uses an InputStreamLocator to * find the containerConfiguration which uses the previously * set application root directory. * * @param location the location of the containerConfiguration * @throws IOException loading the configuration failed */ public void loadContainerConfiguration( String location ) throws IOException { this.loadContainerConfiguration( location, "false" ); }
/** * Initialize the instance * * @throws Exception the initialization failed */ public void initialize() throws Exception { this.getLogger().debug( "Initializing " + this.getClass().getName() ); ServiceContainerConfiguration config = new ServiceContainerConfiguration(); // initialize the Avalon container config.setLogger( this.getLogger() ); config.setApplicationRootDir( this.getApplicationHome() ); config.setTempRootDir( this.getTempHome() ); config.loadContainerConfiguration( this.getContainerConfigValue(), "auto" ); this.container = ServiceContainerFactory.create( config ); // initialize shutdown hook of JVM for a server application if( this.hasShutdownHook() ) { this.getLogger().debug( "Registering shutdown hook" ); Shutdown shutdown = new Shutdown( this ); this.shutdownThread = new Thread( shutdown, "ShutdownThread" ); Runtime.getRuntime().addShutdownHook( this.shutdownThread ); } this.setInitialized(true); }
/** * Initialize the instance * * @throws Exception the initialization failed */ public void initialize() throws Exception { this.getLogger().debug( "Initializing " + this.getClass().getName() ); ServiceContainerConfiguration config = new ServiceContainerConfiguration(); // initialize the Avalon container config.setLogger( this.getLogger() ); config.setApplicationRootDir( this.getApplicationHome() ); config.setTempRootDir( this.getTempHome() ); config.loadContainerConfiguration( this.getContainerConfigValue(), "auto" ); this.container = ServiceContainerFactory.create( config ); // initialize shutdown hook of JVM for a server application if( this.hasShutdownHook() ) { this.getLogger().debug( "Registering shutdown hook" ); Shutdown shutdown = new Shutdown( this ); this.shutdownThread = new Thread( shutdown, "ShutdownThread" ); Runtime.getRuntime().addShutdownHook( this.shutdownThread ); } this.setInitialized(true); }