AdjunctSource source = new AdjunctSource.FromSourceModel(
SourceModel.FunctionDefn.Algebraic.make(adjunctUnqualifiedName, Scope.PUBLIC, null, funcExpr));
WorkspaceManager workspaceManager = leccCALServices.getWorkspaceManager();
CompilerMessageLogger logger = new MessageLogger();
// Compile the adjunct definition.
EntryPointSpec entryPointSpec = EntryPointSpec.make(qualifiedAdjunctName, new InputPolicy[0], OutputPolicy.DEFAULT_OUTPUT_POLICY);
workspaceManager.getCompiler().getEntryPoint (source, entryPointSpec, adjunctModuleName, logger);
if (logger.getMaxSeverity().compareTo(CompilerMessage.Severity.ERROR) >= 0) {
fail("Compilation failed: " + logger.getFirstError().getMessage());
}
// Get the classloader for module with the adjunct we compiled.
LECCModule module = (LECCModule)workspaceManager.getModuleTypeInfo(adjunctModuleName).getModule();
CALClassLoader adjunctModuleClassLoader = module.getClassLoader();
// Check that it's an adjunct classloader..
checkIsAdjunctClassLoader(adjunctModuleClassLoader);