Hi,
Nifi developer guide:
@OnRemoved
The @OnRemoved annotation causes a method to be invoked before a component
is removed from the flow. This allows resources to be cleaned up before
removing a component. Methods with this annotation must take zero arguments.
If a method with this annotation throws an Exception, the component will
still be removed.
But
/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetJMSTopic.java
@OnRemoved
public void onRemoved(final ProcessContext context) throws IOException,
JMSException {
// unsubscribe from the old subscription.
unsubscribe(context);
}
Can onRemoved and onAdded methods take arguments?
Actually I think ProcessContext context is useful onRemoved and onAdded.
And org.apache.nifi.processor.annotation.OnRemoved states
* If any method annotated with this annotation throws, the processor will
not
be removed from the graph.
But guide says 'throws an Exception, the component will still be removed.'
toivo
--
View this message in context:
http://apache-nifi-incubating-developer-list.39713.n7.nabble.com/onRemoved-and-onAdded-methods-signature-and-behaviour-tp683.html
Sent from the Apache NiFi (incubating) Developer List mailing list archive at
Nabble.com.