/** * Create a new BusFactory * * @param className The class of the BusFactory to create. If null, uses the default search algorithm. * @return a new BusFactory to be used to create Bus objects */ public static BusFactory newInstance(String className) { BusFactory instance = null; if (className == null) { ClassLoader loader = Thread.currentThread().getContextClassLoader(); className = getBusFactoryClass(loader); if (className == null && loader != BusFactory.class.getClassLoader()) { className = getBusFactoryClass(BusFactory.class.getClassLoader()); } } if (className == null) { className = BusFactory.DEFAULT_BUS_FACTORY; } Class<? extends BusFactory> busFactoryClass; try { busFactoryClass = ClassLoaderUtils.loadClass(className, BusFactory.class) .asSubclass(BusFactory.class); instance = busFactoryClass.newInstance(); } catch (Exception ex) { LogUtils.log(LOG, Level.SEVERE, "BUS_FACTORY_INSTANTIATION_EXC", ex); throw new RuntimeException(ex); } return instance; }
/** * Create a new BusFactory * * @param className The class of the BusFactory to create. If null, uses the default search algorithm. * @return a new BusFactory to be used to create Bus objects */ public static BusFactory newInstance(String className) { BusFactory instance = null; if (className == null) { ClassLoader loader = Thread.currentThread().getContextClassLoader(); className = getBusFactoryClass(loader); if (className == null && loader != BusFactory.class.getClassLoader()) { className = getBusFactoryClass(BusFactory.class.getClassLoader()); } } if (className == null) { className = BusFactory.DEFAULT_BUS_FACTORY; } Class<? extends BusFactory> busFactoryClass; try { busFactoryClass = ClassLoaderUtils.loadClass(className, BusFactory.class) .asSubclass(BusFactory.class); instance = busFactoryClass.newInstance(); } catch (Exception ex) { LogUtils.log(LOG, Level.SEVERE, "BUS_FACTORY_INSTANTIATION_EXC", ex); throw new RuntimeException(ex); } return instance; }
/** * Create a new BusFactory * * @param className The class of the BusFactory to create. If null, uses the default search algorithm. * @return a new BusFactory to be used to create Bus objects */ public static BusFactory newInstance(String className) { BusFactory instance = null; if (className == null) { ClassLoader loader = Thread.currentThread().getContextClassLoader(); className = getBusFactoryClass(loader); if (className == null && loader != BusFactory.class.getClassLoader()) { className = getBusFactoryClass(BusFactory.class.getClassLoader()); } } if (className == null) { className = BusFactory.DEFAULT_BUS_FACTORY; } Class<? extends BusFactory> busFactoryClass; try { busFactoryClass = ClassLoaderUtils.loadClass(className, BusFactory.class) .asSubclass(BusFactory.class); instance = busFactoryClass.newInstance(); } catch (Exception ex) { LogUtils.log(LOG, Level.SEVERE, "BUS_FACTORY_INSTANTIATION_EXC", ex); throw new RuntimeException(ex); } return instance; }
/** * Create a new BusFactory * * @param className The class of the BusFactory to create. If null, uses the default search algorithm. * @return a new BusFactory to be used to create Bus objects */ public static BusFactory newInstance(String className) { BusFactory instance = null; if (className == null) { ClassLoader loader = Thread.currentThread().getContextClassLoader(); className = getBusFactoryClass(loader); if (className == null && loader != BusFactory.class.getClassLoader()) { className = getBusFactoryClass(BusFactory.class.getClassLoader()); } } if (className == null) { className = BusFactory.DEFAULT_BUS_FACTORY; } Class<? extends BusFactory> busFactoryClass; try { busFactoryClass = ClassLoaderUtils.loadClass(className, BusFactory.class) .asSubclass(BusFactory.class); instance = busFactoryClass.newInstance(); } catch (Exception ex) { LogUtils.log(LOG, Level.SEVERE, "BUS_FACTORY_INSTANTIATION_EXC", ex); throw new RuntimeException(ex); } return instance; }