jgroup.jini
Class LookupManager

java.lang.Object
  extended by jgroup.jini.LookupManager
All Implemented Interfaces:
java.util.EventListener, net.jini.discovery.DiscoveryListener

public class LookupManager
extends java.lang.Object
implements net.jini.discovery.DiscoveryListener

The LookupManager class can be used to interrogate a lookup service in order to obtain a proxy for a service. LookupManager is only a convenience class, which invokes the discovery protocol in order to obtain a proxy for the lookup service and then interrogate it opportunely. The Jgroup programmer can use different techniques to perform the lookup, as illustrated in the Jini specification.

In order to search for a group which has joined the Jini federation, a GroupEntry entry containing the group name must be included in the template.

Since:
Jgroup 1.1
Author:
Alberto Montresor, Rohnny Moland

Method Summary
 void discarded(net.jini.discovery.DiscoveryEvent ev)
           
 void discovered(net.jini.discovery.DiscoveryEvent ev)
           
static java.lang.Object lookup(net.jini.lookup.entry.Name name)
          Perform a lookup for the given Name.
static java.lang.Object lookup(net.jini.core.lookup.ServiceTemplate template)
          Perform a lookup in the lookup service, searching for the specified object with the specified attributes.
static java.lang.Object lookup(net.jini.core.lookup.ServiceTemplate template, int timeout)
          Perform a lookup in the lookup service, searching for the specified object with the specified attributes.
static java.lang.Object lookup(java.lang.String serviceName)
          Perform a lookup in the lookup service, searching for the given service name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

lookup

public static java.lang.Object lookup(net.jini.core.lookup.ServiceTemplate template)
                               throws java.io.IOException
Perform a lookup in the lookup service, searching for the specified object with the specified attributes.

Parameters:
template - template of the service to be searched
Returns:
a proxy for the service, or null is no service can be found with the specified template
Throws:
java.io.IOException - an error occurred in doing lookup

lookup

public static java.lang.Object lookup(net.jini.core.lookup.ServiceTemplate template,
                                      int timeout)
                               throws java.io.IOException
Perform a lookup in the lookup service, searching for the specified object with the specified attributes.

Parameters:
template - template of the service to be searched
timeout - maximum time allowed for the lookup operation
Returns:
a proxy for the service, or null is no service can be found with the specified template
Throws:
java.io.IOException - an error occurred in doing lookup

lookup

public static java.lang.Object lookup(java.lang.String serviceName)
                               throws java.io.IOException
Perform a lookup in the lookup service, searching for the given service name.

Parameters:
serviceName - the service name to lookup
Returns:
the proxy for the service
Throws:
java.io.IOException

lookup

public static java.lang.Object lookup(net.jini.lookup.entry.Name name)
                               throws java.io.IOException
Perform a lookup for the given Name.

Parameters:
name - attribute name to lookup
Returns:
the proxy for the service
Throws:
java.io.IOException

discovered

public void discovered(net.jini.discovery.DiscoveryEvent ev)
Specified by:
discovered in interface net.jini.discovery.DiscoveryListener

discarded

public void discarded(net.jini.discovery.DiscoveryEvent ev)
Specified by:
discarded in interface net.jini.discovery.DiscoveryListener


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.