Bug #1576
Applications using the socket transport do not terminate correctly
Status: | Resolved | Start date: | 07/26/2013 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | J. Wienke | % Done: | 100% | |
Category: | Java | |||
Target version: | rsb-0.9 |
Description
Applications using the socket transport in java do not terminate correctly. The problem is that due to the BusServer and BusClient caching, the connectors cannot directly deactivate their contained Bus instance, as it might be shared with other connectors.
One solution I can think of is to use a ReferenceCounting facade around BusServer and BusClient instances, which counts the calls to activate
and deactivate
and only deactivates the underlying BusServer or BusClient once the same number of deactivations was received as activations were received.
Associated revisions
fixes #1576: Implement Bus reference counting
Use reference counting for cached Bus instances to ensure that they are
properly deconstructed.
- Bus.java: Make Bus an interface
- BusBase.java: New file with existing implementation from Bus.java
- BusClient.java: Adapted to BusBase
- BusServer.java: likewise
- RefCountingBus.java: A decorator for Bus instances performing
reference counting using the activate and deactivate methods - SocketConnectorUtility.java: Use reference counting
- BusCacheTest.java: Adapted to BusBase
History
#1 Updated by J. Moringen almost 11 years ago
The other implementations use reference counting for this.
#2 Updated by J. Wienke almost 11 years ago
- Status changed from New to In Progress
Ok, then I will also follow this approach.
#3 Updated by J. Wienke almost 11 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Applied in changeset rsb-java|commit:f1d87e6239d71cb30e6f7cdd5c3663544de29291.