[jgroups-dev] New JChannel.getState() signature
Bela Ban <[email protected]> Mon, 20 Jun 2011 11:24:13 +0200
| Newsgroups | gmane.comp.java.javagroups.devel |
|---|---|
| Message-ID | <[email protected]> |
I started work on [1] (changes to JChannel.getState()) and wanted to solicit some feedback. The main reason we wanted to change getState() is to be able to learn what exactly went wrong when a state transfer fails, and to possibly retry programmatically. The changes I want to implement are: - No timeout. A timeout can always be either too low, or to high. No timeout means getState() blocks until the state has been fully received, period. - Return value: - True: the state was transferred successfully - False: the member is the only member in the cluster, or the target member == self. NOTE: false does *not* mean the state could not be marshalled, or any other failure ! - As mentioned above, a failure in state transfer is thrown as a StateTransferException (or subclass), STE is a subclass of ChannelException - Failures could be (1) marshalling failures at the state provider or requester - Communication failures (e.g. state provider crashed or left half-way through the state transfer) I'm not sure whether the boolean return value of getState() makes sense, should I make getState() return void ? Then if the state provider == state requester, or if the state requester is the only cludter member, we'd return immediately. Note that getState() returns only after the state has been transferred completely, ie. the setState(byte[]) method returned, or the setState(InputStream) method closed the input stream. Opinions, feedback ? [1] https://issues.jboss.org/browse/JGRP-619 -- Bela Ban Lead JGroups / Clustering Team JBoss ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ Javagroups-development mailing list