Hi!
I am running into a situation where, what I think is happening is:
Component A gets instantiated
Component B
- references A
- gets satisfied once A is satisfied
- kicks off a long-running process when one of its methods are called
- the long-running process is run in a different thread, with a Promise
Component A is no longer satisfied
But
- the long-running process is still running
- the long-running process now references an invalid Component A
- the long-running thread fails because of the invalid state of Component A
Component B is no longer satisfied
So, the long-running component messes things up, but its component has not yet
shut down even though its process is still happily running in another thread.
I can think of two possible solutions, but not sure which is best and not sure
how to implement:
1) Figure out a way to share an ExecutorService between “related” components
so that when one component
shuts down it will signal to the other related components that their
threads are now interrupted
2) In the long-running process, determine if the component that provides the
required service
is still active before continuing with the havoc-wreaking process
Does this sound about right?
How would I actually accomplish either of these?
Thanks!
=David
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev