Article View: borland.public.jbuilder.java.language
Article #18231Re: Detecting InfoBus members
From: William Yu
Date: Mon, 20 Jul 1998 00:00
Date: Mon, 20 Jul 1998 00:00
25 lines
1736 bytes
1736 bytes
William Yu wrote: > > I can think of one detection hack -- if the corresponding > dataItemRequested() in the producer does not execute, that means target > consumer never answered. With this, I could set up a flag, launch a > thread to wait 5 seconds and so on. > > But obviously, I'd like to implement a more elegant method. Is there > something in the API I'm missing? Has anyone else had to deal with this > issue? Answering my own question here. From looking through the Infobus API, I find I can use the DataController interface to detect members joining and leaving an Infobus. Unfortunately, it's not one simple API call. You have to implement a class to maintain the bookkeeping yourself -- straightforward for the purpose of detecting members, somewhat more complicated if you want to implement "controller" functionality and what not for performance reasons. (By default, all DataConsumers are activated when a Producer calls InfoBus' fireItemAvailable() and all DataProducers are activated when a Consumer calles InfoBus' findItemAvailable() -- a DataController can act like a matchmaking so only the needed producers & consumers are involved.)
Technical Details
Message-ID:
<35B39874.3F41BD66@Bigfoot.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<35AFD257.8711D8E3@Bigfoot.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,72299139e551aa87 X-Google-Attributes: gidf74b3,public From: William Yu <William_Yu@Bigfoot.com> Subject: Re: Detecting InfoBus members Date: 1998/07/20 Message-ID: <35B39874.3F41BD66@Bigfoot.com> X-Deja-AN: 373254868 Content-Transfer-Encoding: 7bit References: <35AFD257.8711D8E3@Bigfoot.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: American All-Risk Group (AARG) Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language