protected T createInstance(String className) throws ClassNotFoundException { @SuppressWarnings("unchecked") Class<T> clz = (Class<T>) Class.forName(className); return Instances.newInstance(clz); }
protected T createInstance(String className) throws ClassNotFoundException { Class clz = Class.forName(className); return (T) Instances.newInstance(clz); }
protected T createInstance(String className) throws ClassNotFoundException { @SuppressWarnings("unchecked") Class<T> clz = (Class<T>) Class.forName(className); return Instances.newInstance(clz); }
protected T createInstance(String className) throws ClassNotFoundException { Class clz = Class.forName(className); return (T) Instances.newInstance(clz); }
protected T createInstance(String className) throws ClassNotFoundException { Class clz = Class.forName(className); return (T) Instances.newInstance(clz); }
TransactionPruningPlugin instance = Instances.newInstance(clazz); instance.initialize(conf); LOG.debug("Plugin {} initialized", plugin);
@SuppressWarnings("unchecked") @Override protected void doStart() throws Exception { for (Map.Entry<String, String> entry : containerLiveNodeData.getLogLevels().entrySet()) { String loggerName = entry.getKey(); String oldLogLevel = setLogLevel(loggerName, entry.getValue()); if (!defaultLogLevels.containsKey(loggerName)) { oldLogLevels.put(loggerName, oldLogLevel); } } commandExecutor = Executors.newSingleThreadExecutor( Threads.createDaemonThreadFactory("runnable-command-executor")); Class<?> runnableClass = classLoader.loadClass(specification.getClassName()); Preconditions.checkArgument(TwillRunnable.class.isAssignableFrom(runnableClass), "Class %s is not instance of TwillRunnable.", specification.getClassName()); runnable = Instances.newInstance((Class<TwillRunnable>) runnableClass); runnable.initialize(context); }
@SuppressWarnings("unchecked") @Override protected void doStart() throws Exception { for (Map.Entry<String, String> entry : containerLiveNodeData.getLogLevels().entrySet()) { String loggerName = entry.getKey(); String oldLogLevel = setLogLevel(loggerName, entry.getValue()); if (!defaultLogLevels.containsKey(loggerName)) { oldLogLevels.put(loggerName, oldLogLevel); } } commandExecutor = Executors.newSingleThreadExecutor( Threads.createDaemonThreadFactory("runnable-command-executor")); Class<?> runnableClass = classLoader.loadClass(specification.getClassName()); Preconditions.checkArgument(TwillRunnable.class.isAssignableFrom(runnableClass), "Class %s is not instance of TwillRunnable.", specification.getClassName()); runnable = Instances.newInstance((Class<TwillRunnable>) runnableClass); runnable.initialize(context); }
"Class {} does not implements {}", handlerClass, EventHandler.class.getName()); final EventHandler delegate = Instances.newInstance((Class<? extends EventHandler>) handlerClass);
"Class {} does not implements {}", handlerClass, EventHandler.class.getName()); final EventHandler delegate = Instances.newInstance((Class<? extends EventHandler>) handlerClass);