use of org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable in project plexus-containers by codehaus-plexus.
the class InitializeComponentFactoryManagerPhase method initializeCoreComponent.
public void initializeCoreComponent(ContainerInitializationContext context) throws ContainerInitializationException {
ComponentFactoryManager componentFactoryManager = context.getContainerConfiguration().getComponentFactoryManager();
if (componentFactoryManager instanceof Contextualizable) {
// TODO: this is wrong here jvz.
context.getContainer().getContext().put(PlexusConstants.PLEXUS_KEY, context.getContainer());
try {
((Contextualizable) componentFactoryManager).contextualize(context.getContainer().getContext());
} catch (ContextException e) {
throw new ContainerInitializationException("Error contextualization component factory manager.", e);
}
}
context.getContainer().setComponentFactoryManager(componentFactoryManager);
}
Aggregations