Re: LookupCache, ServiceDiscoveryListener and discard guarantees
Gregg Wonderly <[email protected]>
| Newsgroups | gmane.comp.java.sun.jini |
|---|---|
| Message-ID | <[email protected]> |
Mark Brouwer wrote:
> > deregistrations though, so I don't drop services explicitly. Rather the
> > "cache" reflects what is currently visible.
>
> Ok I see Gregg, I take "remote events and the fact that they might not
> be delivered" as that some infrastructural components may be in your way
> that prevent from events being delivered. If you mean a random event
> being missed or out of sync the SDM knows how to recover from that by
> performing a complete lookup at the ServiceRegistrar so that is not
> something to worry about with SDM [1].
One of the other issues, is that I need to know about the existance of N
singleton services. I.e. there are several services implementing the same
interface, but which I need to access separately to administer, or configure
explicitly. The SDM doesn't really allow me to find these and enumerate them
without having advanced knowledge of how to enumerate each instance (using
ServiceID or specified Entry values). My caching is based on Maps of the form
Map<ServiceID,List<ServiceRegistrar>> idToRegs;
Map<ServiceRegistrar,List<ServiceItem>> regToSvcs;
List<ServiceItem> svcs;
So, I keep these views, in sync through any received notifications, as well as
through periodic lookups. This allows me to find all matched services.
In particular, the typical ServiceTemplate that I am using is of the form
new ServiceTemplate( null, null, new Entry[]{ UIDescriptor.class } );
so that I just want to know which services are managable through ServiceUI.
However, I also might run a second look up with
new ServiceTemplate( null, new Class[]{ Adminstrable.class }, null )
so that I can find Administrables without UIDescriptor Entrys on them, and
attach one of my AdminDescriptor UIDescriptors to the service so that it can
be administered without an explicit ServiceUI configured.
Gregg Wonderly
--------------------------------------------------------------------------
Getting Started: http://www.jini.org/wiki/Category:Getting_Started
Community Web Site: http://jini.org
jini-users Archive: http://archives.java.sun.com/archives/jini-users.html
Unsubscribing: email "signoff JINI-USERS" to [email protected]