Here is a first pullrequest for less states. Reasoning behind everthing:
There is not only one context which keeps state of everything, because you may only want to have one or the other state for testing (output table service for example, but no node ExecutionContext).
Instead there is a KNIMEScijavaContext which is inspired by OpService in that it has getter methods to access all KNIME related services and therefore acts as this "central service holding masterclass".
The state is now held outside of all services, with WeakReferences to them inside the service itself. This ensures that all the state information can be garbage collected with the NodeModel and NodeDialog.
Why are the services not completely stateless? - This allows us to pass the states to the pre- and postpostprocessors.
I hope you are fairly content with the solution I came up with. Further work can be done later, but finishing the ScriptingNode has greater priority.
Hi @dietzc !
Here is a first pullrequest for less states. Reasoning behind everthing:
KNIMEScijavaContext
which is inspired byOpService
in that it has getter methods to access all KNIME related services and therefore acts as this "central service holding masterclass".WeakReferences
to them inside the service itself. This ensures that all the state information can be garbage collected with the NodeModel and NodeDialog.I hope you are fairly content with the solution I came up with. Further work can be done later, but finishing the ScriptingNode has greater priority.
Greetings, Jonathan