private Class<?> getGeneratedComponent(URLClassLoader loader) {
		try {
			StringBuilder s1 = generateSource();

			String digest = getDigest(s1.toString());
			String name = "Comp_" + digest;
			int indexOf = s1.indexOf("$$$");
			s1.replace(indexOf, indexOf + 3, name);

			String source = s1.toString();

      if (log.isDebugEnabled()) {
        log.debug("Generated Class :" + name);
        log.debug("Generated Source:\n" + source);
			}

			ModelCompiler mc = ModelCompiler.create(System
					.getProperty("oms.modelcompiler"));
			Class jc = mc.compile(loader, name, source);

			// TODO refactor for more generic use (internal, external compiler).
			// oms3.compiler.Compiler.compile1(log, name, source); // This is
			// external javac
			// Class jc = loader.loadClass(name);

			// oms3.compiler.Compiler tc =
			// oms3.compiler.Compiler.singleton(loader);
			// Class jc = tc.compileSource(name, source);
			return jc;
		} catch (Exception ex) {
			throw new RuntimeException(ex);
		}
	}