org.apache.commons.discovery.resource.names
Class NameDiscoverers

java.lang.Object
  extended by org.apache.commons.discovery.resource.names.ResourceNameDiscoverImpl
      extended by org.apache.commons.discovery.resource.names.NameDiscoverers
All Implemented Interfaces:
ResourceNameDiscover

public class NameDiscoverers
extends ResourceNameDiscoverImpl
implements ResourceNameDiscover

Holder for multiple ResourceNameDiscover instances. The result is the union of the results from each (not a chained sequence, where results feed the next in line.


Constructor Summary
NameDiscoverers()
          Construct a new resource name discoverer
 
Method Summary
 void addResourceNameDiscover(ResourceNameDiscover discover)
          Specify an discover to be used in searching.
 ResourceNameIterator findResourceNames(String resourceName)
          Locate names of resources that are bound to resourceName.
protected  ResourceNameDiscover getResourceNameDiscover(int idx)
          Retrieve the discover positioned at the given index.
static void setLog(org.apache.commons.logging.Log _log)
          Deprecated. This method is not thread-safe
protected  int size()
          Returns the current size of set discovers.
 
Methods inherited from class org.apache.commons.discovery.resource.names.ResourceNameDiscoverImpl
findResourceNames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.discovery.ResourceNameDiscover
findResourceNames
 

Constructor Detail

NameDiscoverers

public NameDiscoverers()
Construct a new resource name discoverer

Method Detail

setLog

@Deprecated
public static void setLog(org.apache.commons.logging.Log _log)
Deprecated. This method is not thread-safe

Sets the Log for this class.

Parameters:
_log - This class Log

addResourceNameDiscover

public void addResourceNameDiscover(ResourceNameDiscover discover)
Specify an discover to be used in searching. The order of discover determines the order of the result. It is recommended to add the most specific discover first.

Parameters:
discover - The discover to be added

getResourceNameDiscover

protected ResourceNameDiscover getResourceNameDiscover(int idx)
Retrieve the discover positioned at the given index.

Parameters:
idx - The discover index position client is requiring
Returns:
The discover positioned at the input index

size

protected int size()
Returns the current size of set discovers.

Returns:
The current size of set discovers

findResourceNames

public ResourceNameIterator findResourceNames(String resourceName)
Locate names of resources that are bound to resourceName.

Specified by:
findResourceNames in interface ResourceNameDiscover
Specified by:
findResourceNames in class ResourceNameDiscoverImpl
Parameters:
resourceName - The resource name to locate
Returns:
A new ResourceNameIterator


Copyright © 2002-2011 The Apache Software Foundation. All Rights Reserved.