com.sun.jersey.core.spi.scanning
Class PackageNamesScanner

java.lang.Object
  extended by com.sun.jersey.core.spi.scanning.PackageNamesScanner
All Implemented Interfaces:
Scanner

public class PackageNamesScanner
extends java.lang.Object
implements Scanner

A scanner that recursively scans URI-based resources present in a set of package names, and sub-package names of that set.

The URIs for a package name are obtained by invoking ClassLoader.getResources(java.lang.String) with the parameter that is the package name with "." replaced by "/".

Each URI is then scanned using a registered UriSchemeScanner that supports the URI scheme.

The following are registered. The FileSchemeScanner for "file" URI schemes. The JarZipSchemeScanner for "jar" or "zip" URI schemes to jar resources. The VfsSchemeScanner for the JBoss-based "vfsfile" and "vfszip" URI schemes.

If a URI scheme is not supported a ScannerException will be thrown and package scanning deployment will fail.

Author:
Paul.Sandoz@Sun.Com

Constructor Summary
PackageNamesScanner(java.lang.ClassLoader classloader, java.lang.String[] packages)
          Scan from a set of packages using declared class loader.
PackageNamesScanner(java.lang.String[] packages)
          Scan from a set of packages using the context class loader.
 
Method Summary
 void scan(ScannerListener cfl)
          Perform a scan and report resources to a scanning listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PackageNamesScanner

public PackageNamesScanner(java.lang.String[] packages)
Scan from a set of packages using the context class loader.

Parameters:
packages - an array of package names.

PackageNamesScanner

public PackageNamesScanner(java.lang.ClassLoader classloader,
                           java.lang.String[] packages)
Scan from a set of packages using declared class loader.

Parameters:
classloader - the class loader to load classes from.
packages - an array of package names.
Method Detail

scan

public void scan(ScannerListener cfl)
Description copied from interface: Scanner
Perform a scan and report resources to a scanning listener.

Specified by:
scan in interface Scanner
Parameters:
cfl - the scanning listener to report entries.


Copyright © 2011 Sun Microsystems, Inc. All Rights Reserved.