public interface SchedulingContext extends ProcessContext
Modifier and Type | Method and Description |
---|---|
void |
leaseControllerService(String identifier)
Indicates to the framework that the Controller Service with the given
identifier will be used by this Processor.
|
decrypt, encrypt, getAnnotationData, getAvailableRelationships, getControllerServiceLookup, getMaxConcurrentTasks, getProperties, getProperty, getProperty, newPropertyValue, yield
void leaseControllerService(String identifier)
Indicates to the framework that the Controller Service with the given identifier will be used by this Processor. This will prevent any Data Flow Manager from disabling the Controller Service while this Processor is still running.
Generally, a Controller Service is accessed by indicating in a
PropertyDescriptor
that the PropertyDescriptor identifies a
Controller Service via the
identifiesControllerService(Class)
method and then calling
ProcessContext.getProperty(PropertyDescriptor)
.asControllerService(Class)
.
In this case, it is not necessary to lease the Controller Service, as the
Framework will handle this.
There are, however, cases in which a Controller Service must be accessed
in a different way, via the ControllerServiceLookup
(accessed via
ProcessContext.getControllerServiceLookup()
). In this case, the
Controller Service that is obtained from the ControllerServiceLookup can
be disabled by a Data Flow Manager while it is still in use by a
Processor, causing IllegalStateException to be thrown whenever the
Processor attempts to interact with the service. This method provides a
mechanism by which a Processor is able to indicate that the Controller
Service with the given identifier should not be disabled while this
Processor is running.
For any Controller Service that is leased by calling this method, the lease will automatically be terminated, allowing the Controller Service to be disabled, whenever the Processor is stopped.
identifier
- IllegalArgumentException
- if no Controller Service exists with the
given identifierCopyright © 2015 Apache NiFi (incubating). All rights reserved.