Commit cceeebb5 authored by Philippe Merle's avatar Philippe Merle
Browse files

Allowed to compile SCA composites containing <nuxeo:implementation.nuxeo> even...

Allowed to compile SCA composites containing <nuxeo:implementation.nuxeo> even when Nuxeo is not running.
Useful to pregenerate membranes at compile time.
parent b236297b
...@@ -32,6 +32,7 @@ import org.objectweb.fractal.api.Component; ...@@ -32,6 +32,7 @@ import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.type.ComponentType; import org.objectweb.fractal.api.type.ComponentType;
import org.ow2.frascati.assembly.factory.api.ProcessingContext; import org.ow2.frascati.assembly.factory.api.ProcessingContext;
import org.ow2.frascati.assembly.factory.api.ProcessingMode;
import org.ow2.frascati.assembly.factory.api.ProcessorException; import org.ow2.frascati.assembly.factory.api.ProcessorException;
import org.ow2.frascati.assembly.factory.processor.AbstractComponentFactoryBasedImplementationProcessor; import org.ow2.frascati.assembly.factory.processor.AbstractComponentFactoryBasedImplementationProcessor;
import org.ow2.frascati.component.factory.api.FactoryException; import org.ow2.frascati.component.factory.api.FactoryException;
...@@ -77,9 +78,14 @@ public class FrascatiImplementationNuxeoProcessor ...@@ -77,9 +78,14 @@ public class FrascatiImplementationNuxeoProcessor
if(isNullOrEmpty(nuxeoImplementationName)) { if(isNullOrEmpty(nuxeoImplementationName)) {
error(processingContext, nuxeoImplementation, "The attribute 'name' must be set"); error(processingContext, nuxeoImplementation, "The attribute 'name' must be set");
} else { } else {
Object nuxeoComponent = searchNuxeoComponent(nuxeoImplementation, processingContext); // When FraSCAti is launched as a compiler
if(nuxeoComponent == null) { // then don't check if the Nuxeo component exists
error(processingContext, nuxeoImplementation, "The Nuxeo component '" + nuxeoImplementationName + "' does not exist"); // because the Nuxeo Framework Runtime is not started!
if(processingContext.getProcessingMode() != ProcessingMode.compile) {
Object nuxeoComponent = searchNuxeoComponent(nuxeoImplementation, processingContext);
if(nuxeoComponent == null) {
error(processingContext, nuxeoImplementation, "The Nuxeo component '" + nuxeoImplementationName + "' does not exist");
}
} }
} }
...@@ -134,7 +140,7 @@ public class FrascatiImplementationNuxeoProcessor ...@@ -134,7 +140,7 @@ public class FrascatiImplementationNuxeoProcessor
private final Object searchNuxeoComponent(NuxeoImplementation nuxeoImplementation, ProcessingContext processingContext) private final Object searchNuxeoComponent(NuxeoImplementation nuxeoImplementation, ProcessingContext processingContext)
{ {
// Retrieve the Nuxeo component from the Nuxeo Runtime Framework. // Retrieve the Nuxeo component from the Nuxeo Runtime Framework.
return Framework.getRuntime().getComponent(nuxeoImplementation.getName()); return Framework.getRuntime().getComponent(nuxeoImplementation.getName());
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment