Search in sources :

Example 1 with Contextualizable

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);
}
Also used : ComponentFactoryManager(org.codehaus.plexus.component.factory.ComponentFactoryManager) Contextualizable(org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable) ContextException(org.codehaus.plexus.context.ContextException)

Aggregations

ComponentFactoryManager (org.codehaus.plexus.component.factory.ComponentFactoryManager)1 ContextException (org.codehaus.plexus.context.ContextException)1 Contextualizable (org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable)1