Skip to main content

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

Hi Remy,

Remy Chi Jian Suen wrote:
Hi all,

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

public synchronized void dispose() {
	if (channel != null) {
		adapter.removeChannel(channel.getID());
		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 think the channel container should call IChannel.dispose() upon removeChannel...but you are correct that the implementation based upon the shared object API (org.eclipse.ecf.provider.datashare) does not. I would consider this a bug...and I'll assign to myself and fix it for that implementation.

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?

The current lifecycle of shares is not very clearly defined (as you point out). I would recommend replacing the notion of AbstractShare/DocShare classes which create/dispose an IChannel instance with some other management of the creation/destruction of IChannels and remove the creation/deletion of IChannels from the share classes completely (or rather replace them with something else). The current approach (i.e. limited to one IChannel per 'Share'...which represents a two-way active docshare 'session') should probably be replace with something that has e.g. an IChannel for 'control'...i.e. starting/stopping individual resource sharing...or editor sharing, etc...with the use/creation of other IChannel specific protocols (e.g. shared editing of a single resource with cola/sync API-based synchronization).

Thanks,

Scott



Regards,
Remy
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev



Back to the top