org.openide.util
Class Lookup

java.lang.Object
  |
  +--org.openide.util.Lookup

public abstract class Lookup
extends Object

This is abstract interfaces to give us access to lookup capabilities.

I admit that the class is inspirated by JINI(tm). The difference is that methods are not allowed to throw exceptions and also the license. Also we are mostly concentrated on the lookup, not on the registration. And last difference that comes to my mind is that our classes are not serializable (we are not distributed).


Inner Class Summary
static class Lookup.Result
          Result of a lookup request.
static class Lookup.Template
          Template to define pattern of object to look for.
 
Constructor Summary
Lookup()
           
 
Method Summary
static Lookup getDefault()
          Static method to obtain the global lookup in the whole system.
abstract  Object lookup(Class clazz)
          Lookups an object of given interface.
abstract  Lookup.Result lookup(Lookup.Template template)
          The general lookup method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lookup

public Lookup()
Method Detail

getDefault

public static Lookup getDefault()
Static method to obtain the global lookup in the whole system.
Returns:
the global lookup in the system

lookup

public abstract Object lookup(Class clazz)
Lookups an object of given interface. This is the simplest method for the lookuping, if more registered objects implement the given class any of them can be returned.
Parameters:
clazz - class of the object we are searching for
Returns:
the object implementing given class or null if no such has been found

lookup

public abstract Lookup.Result lookup(Lookup.Template template)
The general lookup method.
Parameters:
template - the template describing the services we are looking for
Returns:
object containing the results


Built on February 22 2001.  |  Portions Copyright 1997-2000 Sun Microsystems, Inc. All rights reserved.