Class ModuleScanner<T>
- java.lang.Object
-
- org.glassfish.apf.impl.JavaEEScanner
-
- com.sun.enterprise.deployment.annotation.impl.ModuleScanner<T>
-
- All Implemented Interfaces:
Scanner<T>
- Direct Known Subclasses:
AppClientScanner
,EjbJarScanner
,RarScanner
,WarScanner
public abstract class ModuleScanner<T> extends JavaEEScanner implements Scanner<T>
This is an abstract class of the Scanner interface for J2EE module.- Author:
- Shing Wai Chan
-
-
Field Summary
Fields Modifier and Type Field Description protected File
archiveFile
protected ClassLoader
classLoader
protected org.glassfish.hk2.classmodel.reflect.Parser
classParser
static Logger
deplLogger
-
Constructor Summary
Constructors Constructor Description ModuleScanner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addLibraryJars(T bundleDesc, ReadableArchive moduleArchive)
protected void
addScanClassName(String className)
This add extra className to be scanned.protected void
addScanDirectory(File directory)
This will include all class in directory to be scanned.protected void
addScanJar(File jarFile)
This add all classes in given jarFile to be scanned.protected void
addScanURI(URI jarURI)
This add all classes in given jarFile to be scanned.protected void
calculateResults(T bundleDesc)
protected void
completeProcess(T bundleDescr, ReadableArchive archive)
Performs all additional work after the "process" method has finished.ClassLoader
getClassLoader()
Returns a ClassLoader capable of loading classes from the underlying mediumSet<Class>
getElements()
Return a complete set of classes available from this location.Set<Class>
getElements(Set<String> classNames)
Return a class instance available from this location from class name.org.glassfish.hk2.classmodel.reflect.Types
getTypes()
Return the types information for this modulevoid
process(ReadableArchive archiveFile, T bundleDesc, ClassLoader classLoader, org.glassfish.hk2.classmodel.reflect.Parser parser)
protected void
setParser(org.glassfish.hk2.classmodel.reflect.Parser parser)
-
Methods inherited from class org.glassfish.apf.impl.JavaEEScanner
getComponentInfo, initTypes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.glassfish.apf.Scanner
getComponentInfo, process
-
-
-
-
Field Detail
-
archiveFile
protected File archiveFile
-
classLoader
protected ClassLoader classLoader
-
classParser
protected org.glassfish.hk2.classmodel.reflect.Parser classParser
-
deplLogger
public static final Logger deplLogger
-
-
Method Detail
-
process
public void process(ReadableArchive archiveFile, T bundleDesc, ClassLoader classLoader, org.glassfish.hk2.classmodel.reflect.Parser parser) throws IOException
- Throws:
IOException
-
completeProcess
protected void completeProcess(T bundleDescr, ReadableArchive archive) throws IOException
Performs all additional work after the "process" method has finished.This is a separate method from "process" so that the app client scanner can invoke it from its overriding process method. All post-processing logic needs to be collected in this one place.
- Parameters:
bundleDescr
-archive
-- Throws:
IOException
-
calculateResults
protected void calculateResults(T bundleDesc)
-
addScanClassName
protected void addScanClassName(String className)
This add extra className to be scanned.- Parameters:
className
-
-
addScanJar
protected void addScanJar(File jarFile) throws IOException
This add all classes in given jarFile to be scanned.- Parameters:
jarFile
-- Throws:
IOException
-
addScanURI
protected void addScanURI(URI jarURI) throws IOException
This add all classes in given jarFile to be scanned.- Parameters:
jarURI
-- Throws:
IOException
-
addScanDirectory
protected void addScanDirectory(File directory) throws IOException
This will include all class in directory to be scanned.- Parameters:
directory
-- Throws:
IOException
-
getClassLoader
public ClassLoader getClassLoader()
Description copied from interface:Scanner
Returns a ClassLoader capable of loading classes from the underlying medium- Specified by:
getClassLoader
in interfaceScanner<T>
- Returns:
- a class loader capable of loading the classes
-
getElements
public Set<Class> getElements()
Description copied from interface:Scanner
Return a complete set of classes available from this location.- Specified by:
getElements
in interfaceScanner<T>
- Returns:
- the complete set of classes
-
getElements
public Set<Class> getElements(Set<String> classNames)
Description copied from interface:Scanner
Return a class instance available from this location from class name.- Specified by:
getElements
in interfaceScanner<T>
- Parameters:
classNames
- the list of class name- Returns:
- the set of classes for given names
-
addLibraryJars
protected void addLibraryJars(T bundleDesc, ReadableArchive moduleArchive)
- Parameters:
bundleDesc
-moduleArchive
-
-
getTypes
public org.glassfish.hk2.classmodel.reflect.Types getTypes()
Description copied from interface:Scanner
Return the types information for this module- Specified by:
getTypes
in interfaceScanner<T>
- Overrides:
getTypes
in classJavaEEScanner
- Returns:
- types the archive resulting types
-
setParser
protected void setParser(org.glassfish.hk2.classmodel.reflect.Parser parser)
-
-