Search in sources :

Example 1 with MockProcessorInitializationContext

use of org.apache.nifi.mock.MockProcessorInitializationContext in project nifi by apache.

the class ProcessorInitializer method initialize.

@Override
public void initialize(ConfigurableComponent component) {
    Processor processor = (Processor) component;
    ProcessorInitializationContext initializationContext = new MockProcessorInitializationContext();
    try (NarCloseable narCloseable = NarCloseable.withComponentNarLoader(component.getClass(), initializationContext.getIdentifier())) {
        processor.initialize(initializationContext);
    }
}
Also used : NarCloseable(org.apache.nifi.nar.NarCloseable) Processor(org.apache.nifi.processor.Processor) MockProcessorInitializationContext(org.apache.nifi.mock.MockProcessorInitializationContext) MockProcessorInitializationContext(org.apache.nifi.mock.MockProcessorInitializationContext) ProcessorInitializationContext(org.apache.nifi.processor.ProcessorInitializationContext)

Example 2 with MockProcessorInitializationContext

use of org.apache.nifi.mock.MockProcessorInitializationContext in project nifi-minifi by apache.

the class ProcessorInitializer method initialize.

@Override
public void initialize(ConfigurableComponent component) {
    Processor processor = (Processor) component;
    ProcessorInitializationContext initializationContext = new MockProcessorInitializationContext();
    try (NarCloseable narCloseable = NarCloseable.withComponentNarLoader(component.getClass(), initializationContext.getIdentifier())) {
        processor.initialize(initializationContext);
    }
}
Also used : NarCloseable(org.apache.nifi.nar.NarCloseable) Processor(org.apache.nifi.processor.Processor) MockProcessorInitializationContext(org.apache.nifi.mock.MockProcessorInitializationContext) MockProcessorInitializationContext(org.apache.nifi.mock.MockProcessorInitializationContext) ProcessorInitializationContext(org.apache.nifi.processor.ProcessorInitializationContext)

Aggregations

MockProcessorInitializationContext (org.apache.nifi.mock.MockProcessorInitializationContext)2 NarCloseable (org.apache.nifi.nar.NarCloseable)2 Processor (org.apache.nifi.processor.Processor)2 ProcessorInitializationContext (org.apache.nifi.processor.ProcessorInitializationContext)2