private static Engine getEngineForName(String engineClass) throws Exception { try { Class<Engine> engineCls = ReflectionUtil.loadServiceClass(engineClass, Engine.class); return getEngineByClass(engineCls); } catch (Exception e) { throw new Exception(String.format("Engine instance %s cannot be created.", engineClass), e); } }
/** * Bootstraps an engine implementation specified by its class. * * @param engineClass * The engine class. * @throws Exception * Thrown on any bootstrap error. */ public static void bootstrap(Class<? extends Engine> engineClass) throws Exception { Engine engine; try { engine = getEngineByClass(engineClass); } catch (Exception e) { throw new Exception( String.format("Cannot get engine implementation using the specified class %s", engineClass.getName()), e); } bootstrap(engine); }
/** * Bootstraps a Limbus System engine that utilizes {@link LimbusSystem} and a valid system description to create a * runtime environment of components. The system descriptor can be provided in the following ways: * <ul> * <li>Place a file <tt>limbus-system.xml</tt> in the Limbus configuration directory.</li> * <li>Place a Limbus Property file for class {@link SystemEngine} overriding the default system descriptor filename. * </li> * </ul> * * @throws Exception * Thrown on any bootstrapping error. */ public static void bootstrapLimbusSystem() throws Exception { Engine engine; try { engine = getEngineByClass(SystemEngine.class); } catch (Exception e) { throw new Exception( String.format("Cannot get engine implementation using the specified class %s", SystemEngine.class.getName()), e); } bootstrap(engine); }