[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ecf-dev] AbstractShare and IChannel clean-up...

Hi all,

AbstractShare's dispose() implement currently asks the channel
container adapter to remove the channel.

public synchronized void dispose() {
	if (channel != null) {
		channel = null;
		adapter = null;

However, the channel is not actually disposed. I noticed this when I
realized that one of my threads was still running despite the fact
that I had disconnected. I cleaned up my other IChannel
implementations but since this one had been removed from my channel
container, I had no references to it and it never got disposed. Is the
channel container supposed to dispose of the channel when a remove has
been requested or is this a bug on the AbstractShare side?

I also noticed that AbstractShare's constructor creates a channel if
one isn't immediately available. However, when it is disposed, it asks
the channel container to remove the channel. This seems a little weird
because if it was previously available, then it retrieves this
presumably shared channel, but when the share is disposed, it asks the
channel container to remove that channel which seems like it will
prevent future clients from sharing that same channel). What is the
life cycle of shares and how is it supposed to interact with its
underlying channel?