private void init(final SmartlyPackageLoader packageLoader) throws Exception { // Run Smartly configuration deployer (new Deployer(PathUtils.getAbsolutePath(IConstants.PATH_CONFIGFILES), isSilent())).deploy(); // -- init package loader --// _packageLoader = packageLoader; // run all packages and flush deployers queue. // this allow packages to access deployed files _packageLoader.load(); // packages are loaded // now run remaining deployers if any FileDeployer.deployAll(); // set configuration last time Smartly._configuration = new JsonRepository(PathUtils.getAbsolutePath(IConstants.PATH_CONFIGFILES)); // set loaded package names Smartly._packages = _packageLoader.getPackageNames(); // notify all packages Smartly is ready. _packageLoader.ready(); // -- add shutdown hook --// Runtime.getRuntime().addShutdownHook(new SmartlyShutdownHook(_packageLoader)); }
public static void register(final FileDeployer deployer) { FileDeployer.register(deployer); }