public static Class classForName(String className, boolean useConfiguredLoader) throws ClassNotFoundException { if (useConfiguredLoader) return classForName(className); // try context class loader first, so that applications can override provided classes try { return Class.forName(className, false, Thread.currentThread().getContextClassLoader()); } catch (ClassNotFoundException e) { // fall back on the loader of this class return Class.forName(className, false, ClassLoaderUtil.class.getClassLoader()); } }
public static Class classForName(String className, boolean useConfiguredLoader) throws ClassNotFoundException { if (useConfiguredLoader) return classForName(className); // try context class loader first, so that applications can override provided classes try { return Class.forName(className, false, Thread.currentThread().getContextClassLoader()); } catch (ClassNotFoundException e) { // fall back on the loader of this class return Class.forName(className, false, ClassLoaderUtil.class.getClassLoader()); } }
protected void initPrincipalClass(String principalClassName) { try { principalClass = ClassLoaderUtil.classForName(principalClassName); } catch (ClassNotFoundException e) { throw new JbpmException("principal class not found: " + principalClassName, e); } }
private Class getExceptionClass() { if (exceptionClass == null) { try { exceptionClass = ClassLoaderUtil.classForName(exceptionClassName); } catch (ClassNotFoundException e) { throw new JbpmException("exception class not found: " + exceptionClassName, e); } } return exceptionClass; }
private Class getExceptionClass() { if (exceptionClass == null) { try { exceptionClass = ClassLoaderUtil.classForName(exceptionClassName); } catch (ClassNotFoundException e) { throw new JbpmException("exception class not found: " + exceptionClassName, e); } } return exceptionClass; }
protected void initPrincipalClass(String principalClassName) { try { principalClass = ClassLoaderUtil.classForName(principalClassName); } catch (ClassNotFoundException e) { throw new JbpmException("principal class not found: " + principalClassName, e); } }
/** * Returns the <code>Class</code> associated with the value for the attribute with the given * name. */ private static Class classForAttributeValue(Element element, String attributeName) { String className = element.attributeValue(attributeName); if (className != null) { try { return ClassLoaderUtil.classForName(className); } catch (ClassNotFoundException e) { throw new JbpmException("no such class " + className, e); } } return String.class; }
/** * Returns the <code>Class</code> associated with the value for the attribute with the given * name. */ private static Class classForAttributeValue(Element element, String attributeName) { String className = element.attributeValue(attributeName); if (className != null) { try { return ClassLoaderUtil.classForName(className); } catch (ClassNotFoundException e) { throw new JbpmException("no such class " + className, e); } } return String.class; }
private static List loadModuleClasses(String resource) { Properties properties = ClassLoaderUtil.getProperties(resource); List moduleClasses = new ArrayList(); Log log = LogFactory.getLog(ProcessDefinition.class); boolean debug = log.isDebugEnabled(); for (Iterator iter = properties.keySet().iterator(); iter.hasNext();) { String moduleClassName = (String) iter.next(); try { Class moduleClass = ClassLoaderUtil.classForName(moduleClassName); moduleClasses.add(moduleClass); if (debug) log.debug("loaded module " + moduleClassName); } catch (ClassNotFoundException e) { if (debug) log.debug("module class not found: " + moduleClassName, e); } } return moduleClasses; }
private static List loadModuleClasses(String resource) { Properties properties = ClassLoaderUtil.getProperties(resource); List moduleClasses = new ArrayList(); Log log = LogFactory.getLog(ProcessDefinition.class); boolean debug = log.isDebugEnabled(); for (Iterator iter = properties.keySet().iterator(); iter.hasNext();) { String moduleClassName = (String) iter.next(); try { Class moduleClass = ClassLoaderUtil.classForName(moduleClassName); moduleClasses.add(moduleClass); if (debug) log.debug("loaded module " + moduleClassName); } catch (ClassNotFoundException e) { if (debug) log.debug("module class not found: " + moduleClassName, e); } } return moduleClasses; }
private static Map initialiseNodeTypes(String resource) { Map types = new HashMap(); InputStream nodeTypesStream = ClassLoaderUtil.getStream(resource); Element nodeTypesElement = XmlUtil.parseXmlInputStream(nodeTypesStream) .getDocumentElement(); for (Iterator iter = XmlUtil.elementIterator(nodeTypesElement, "node-type"); iter.hasNext();) { Element nodeTypeElement = (Element) iter.next(); String elementTag = nodeTypeElement.getAttribute("element"); String className = nodeTypeElement.getAttribute("class"); try { Class nodeClass = ClassLoaderUtil.classForName(className); types.put(elementTag, nodeClass); } catch (ClassNotFoundException e) { if (log.isDebugEnabled()) { log.debug("node '" + elementTag + "' will not be available, class not found: " + className); } } } return types; }
Class converterClass = ClassLoaderUtil.classForName(converterClassName);
Class converterClass = ClassLoaderUtil.classForName(converterClassName);
private static Map initialiseNodeTypes(String resource) { Map types = new HashMap(); InputStream nodeTypesStream = ClassLoaderUtil.getStream(resource); Element nodeTypesElement = XmlUtil.parseXmlInputStream(nodeTypesStream) .getDocumentElement(); for (Iterator iter = XmlUtil.elementIterator(nodeTypesElement, "node-type"); iter.hasNext();) { Element nodeTypeElement = (Element) iter.next(); String elementTag = nodeTypeElement.getAttribute("element"); String className = nodeTypeElement.getAttribute("class"); try { Class nodeClass = ClassLoaderUtil.classForName(className); types.put(elementTag, nodeClass); } catch (ClassNotFoundException e) { if (log.isDebugEnabled()) { log.debug("node '" + elementTag + "' will not be available, class not found: " + className); } } } return types; }
private static Map initialiseActionTypes(String resource) { Map types = new HashMap(); InputStream actionTypesStream = ClassLoaderUtil.getStream(resource); Element actionTypesElement = XmlUtil.parseXmlInputStream(actionTypesStream) .getDocumentElement(); for (Iterator iter = XmlUtil.elementIterator(actionTypesElement, "action-type"); iter.hasNext();) { Element actionTypeElement = (Element) iter.next(); String elementTag = actionTypeElement.getAttribute("element"); String className = actionTypeElement.getAttribute("class"); try { Class actionClass = ClassLoaderUtil.classForName(className); types.put(elementTag, actionClass); } catch (ClassNotFoundException e) { if (log.isDebugEnabled()) { log.debug("action '" + elementTag + "' will not be available, class not found: " + className); } } } return types; } }
private static Map initialiseActionTypes(String resource) { Map types = new HashMap(); InputStream actionTypesStream = ClassLoaderUtil.getStream(resource); Element actionTypesElement = XmlUtil.parseXmlInputStream(actionTypesStream) .getDocumentElement(); for (Iterator iter = XmlUtil.elementIterator(actionTypesElement, "action-type"); iter.hasNext();) { Element actionTypeElement = (Element) iter.next(); String elementTag = actionTypeElement.getAttribute("element"); String className = actionTypeElement.getAttribute("class"); try { Class actionClass = ClassLoaderUtil.classForName(className); types.put(elementTag, actionClass); } catch (ClassNotFoundException e) { if (log.isDebugEnabled()) { log.debug("action '" + elementTag + "' will not be available, class not found: " + className); } } } return types; } }
Class parserClass = ClassLoaderUtil.classForName(parserClassName);
Class parserClass = ClassLoaderUtil.classForName(parserClassName);
Class referencedClass; try { referencedClass = ClassLoaderUtil.classForName(variableInstanceClassName);
Class referencedClass; try { referencedClass = ClassLoaderUtil.classForName(variableInstanceClassName);