previous chapter table of contents next chapter

ServiceItemFilter Interface

Most methods of the client lookup manager require a ServiceItemFilter . This is a simple interface designed to be an additional filter on the client side to help in finding services. The primary way for a client to find a service is to ask for an instance of an interface, possibly with additional entry attributes. This matching is performed on the lookup service, and it only involves a form of exact pattern matching. It allows the client to ask for a toaster that will handle two slices of toast exactly, but not for one that will toast two or more.

Performing arbitrary Boolean matching on the lookup service raises a security issue as it would involve running some code from the client or service in the lookup service, and it also raises a possible performance issue for the lookup service. This means that enhancing the matching process in the lookup service is unlikely to ever occur, so any more sophisticated matching must be done by the client. The ServiceItemFilter allows additional Boolean filtering to be performed on the client side, by client code, so these issues are local to the client only.

The ServiceItemFilter interface is as follows :

 package net.jini.lookup; public interface ServiceItemFilter {     boolean check(ServiceItem item); } 

A client filter will implement this interface to perform additional checking.

Client-side filtering will not solve all of the problems of locating the "best" service. Some situations will still require other services that know "local" information, such as distances in a building.


A Programmer[ap]s Guide to Jini Technology
A Programmer[ap]s Guide to Jini Technology
ISBN: 1893115801
Year: 2000
Pages: 189

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net