protected Class findClass(String className) throws ClassNotFoundException { ProcessDefinition processDefinition = getProcessDefinition(); FileDefinition fileDefinition; if (processDefinition == null || (fileDefinition = processDefinition.getFileDefinition()) == null) { throw new ClassNotFoundException(className); } // look in the classes directory of the file module definition String fileName = "classes/" + className.replace('.', '/') + ".class"; byte[] classBytes = fileDefinition.getBytes(fileName); if (classBytes == null) throw new ClassNotFoundException(className); // if the class is in a package int packageIndex = className.lastIndexOf('.'); if (packageIndex != -1) { // check whether this class loader (or any ancestor) defined the package already String packageName = className.substring(0, packageIndex); if (getPackage(packageName) == null) { // define the package prior to defining the class // see https://jira.jboss.org/jira/browse/JBPM-1404 definePackage(packageName, null, null, null, processDefinition.getName(), Integer.toString(processDefinition.getVersion()), null, null); } } return defineClass(className, classBytes, 0, classBytes.length); } }
protected Class findClass(String className) throws ClassNotFoundException { ProcessDefinition processDefinition = getProcessDefinition(); FileDefinition fileDefinition; if (processDefinition == null || (fileDefinition = processDefinition.getFileDefinition()) == null) { throw new ClassNotFoundException(className); } // look in the classes directory of the file module definition String fileName = "classes/" + className.replace('.', '/') + ".class"; byte[] classBytes = fileDefinition.getBytes(fileName); if (classBytes == null) throw new ClassNotFoundException(className); // if the class is in a package int packageIndex = className.lastIndexOf('.'); if (packageIndex != -1) { // check whether this class loader (or any ancestor) defined the package already String packageName = className.substring(0, packageIndex); if (getPackage(packageName) == null) { // define the package prior to defining the class // see https://jira.jboss.org/jira/browse/JBPM-1404 definePackage(packageName, null, null, null, processDefinition.getName(), Integer.toString(processDefinition.getVersion()), null, null); } } return defineClass(className, classBytes, 0, classBytes.length); } }