/** * Bootstraps a Limbus System engine that utilizes {@link LimbusSystem} to create a * runtime environment of components. * * @param system * The uninitialized configured {@link LimbusSystem} * @throws Exception * Thrown on any error while bootstrapping. */ public static void bootstrapLimbusSystem(LimbusSystem system) throws Exception { SystemEngine engine = new SystemEngine(system); bootstrap(engine); }
@Override protected void performInitialize() throws Exception { if (system == null) { this.system = configureLimbusSystem(); } this.system.initialize(); }
private LimbusSystem configureLimbusSystem() throws Exception { File confDir = getConfigurationDirectoryUnchecked(); File systemConfig = getOrFailFile("limbus system description", new File(confDir, DEFAULT_SYSTEM_FILENAME)); try (FileInputStream fin = new FileInputStream(systemConfig)) { return fromInputStream(fin); } }
/** * Constructs a System Engine that reads the system descriptor from the specified input stream. * * @param descriptorInput * The input stream containing the XML system descriptor. * @throws SerializeException * Thrown if the Limbus System cannot be deserialized. */ public SystemEngine(InputStream descriptorInput) throws SerializeException { Lang.denyNull("descriptorInput", descriptorInput); try { this.system = fromInputStream(descriptorInput); } finally { Lang.closeQuietly(descriptorInput); } }
/** * Bootstraps a Limbus System engine that utilizes {@link LimbusSystem} and a valid system description to create a * runtime environment of components. The system descriptor is specified via {@link InputStream}. * * @param systemDescriptor * The input stream representing the XML system descriptor. * * @throws SerializeException * Thrown if the {@link LimbusSystem} cannot be created from the specified system descriptor. * @throws Exception * Thrown on any error while bootstrapping. */ public static void bootstrapLimbusSystem(InputStream systemDescriptor) throws SerializeException, Exception { SystemEngine engine = new SystemEngine(systemDescriptor); bootstrap(engine); }