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

java.lang.Object
  extended by org.apache.commons.discovery.resource.names.ResourceNameDiscoverImpl
      extended by org.apache.commons.discovery.resource.names.DiscoverNamesInFile
All Implemented Interfaces:
ResourceNameDiscover
Direct Known Subclasses:
DiscoverServiceNames

public class DiscoverNamesInFile
extends ResourceNameDiscoverImpl
implements ResourceNameDiscover

Discover ALL files of a given name, and return resource names contained within the set of files:

Default discoverer is DiscoverClassLoaderResources, but it can be set to any other.


Constructor Summary
DiscoverNamesInFile()
          Construct a new resource discoverer.
DiscoverNamesInFile(ClassLoaders loaders)
          Construct a new resource discoverer.
DiscoverNamesInFile(ClassLoaders loaders, String prefix, String suffix)
          Construct a new resource discoverer.
DiscoverNamesInFile(ResourceDiscover discoverer)
          Construct a new resource discoverer.
DiscoverNamesInFile(ResourceDiscover discoverer, String prefix, String suffix)
          Construct a new resource discoverer.
DiscoverNamesInFile(String prefix, String suffix)
          Construct a new resource discoverer.
 
Method Summary
 ResourceNameIterator findResourceNames(String serviceName)
          Locate names of resources that are bound to resourceName.
 ResourceDiscover getDiscover()
          Return the discoverer to resolve resources.
 void setDiscoverer(ResourceDiscover discover)
          Set the discoverer to resolve resources.
static void setLog(org.apache.commons.logging.Log _log)
          Deprecated. This method is not thread-safe
 
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

DiscoverNamesInFile

public DiscoverNamesInFile()
Construct a new resource discoverer.


DiscoverNamesInFile

public DiscoverNamesInFile(String prefix,
                           String suffix)
Construct a new resource discoverer.

Parameters:
prefix - The resource name prefix
suffix - The resource name suffix

DiscoverNamesInFile

public DiscoverNamesInFile(ClassLoaders loaders)
Construct a new resource discoverer.

Parameters:
loaders - The class loaders holder

DiscoverNamesInFile

public DiscoverNamesInFile(ClassLoaders loaders,
                           String prefix,
                           String suffix)
Construct a new resource discoverer.

Parameters:
loaders - The class loaders holder
prefix - The resource name prefix
suffix - The resource name suffix

DiscoverNamesInFile

public DiscoverNamesInFile(ResourceDiscover discoverer)
Construct a new resource discoverer.

Parameters:
discoverer - The discoverer to resolve resources

DiscoverNamesInFile

public DiscoverNamesInFile(ResourceDiscover discoverer,
                           String prefix,
                           String suffix)
Construct a new resource discoverer.

Parameters:
discoverer - The discoverer to resolve resources
prefix - The resource name prefix
suffix - The resource name suffix
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

setDiscoverer

public void setDiscoverer(ResourceDiscover discover)
Set the discoverer to resolve resources.

Parameters:
discover - The discoverer to resolve resources

getDiscover

public ResourceDiscover getDiscover()
Return the discoverer to resolve resources. To be used by downstream elements...

Returns:
The discoverer to resolve resources

findResourceNames

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

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


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