/** * Initializes the container. * * @throws Exception generic exception */ public void initialize() throws Exception { this.manager = ServiceContainerFactory.create( this.config ); }
clazzName = getServiceContainerClazzName(configuration);
clazzName = getServiceContainerClazzName(configuration);
/** * Create a fully initialized YAFFI service container. * * @param serviceManagerConfig the configuration to use * @return the service container * @throws Exception the creation failed */ public static ServiceContainer create( ServiceContainerConfiguration serviceManagerConfig) throws Exception { Validate.notNull(serviceManagerConfig,"serviceManagerConfig"); Context context = serviceManagerConfig.createFinalContext(); return ServiceContainerFactory.create( serviceManagerConfig, context ); }
/** * Create a fully initialized YAFFI service container. * * @param serviceManagerConfig the configuration to use * @return the service container * @throws Exception the creation failed */ public static ServiceContainer create( ServiceContainerConfiguration serviceManagerConfig) throws Exception { Validate.notNull(serviceManagerConfig,"serviceManagerConfig"); Context context = serviceManagerConfig.createFinalContext(); return ServiceContainerFactory.create( serviceManagerConfig, context ); }
/** * 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); }