Top Inners Fields Constructors Methods
org.aspectj.weaver.bcel

public Class ClassPathManager

extends Object
Class Inheritance
Imports
java.io.ByteArrayInputStream, .File, .FileInputStream, .FileNotFoundException, .IOException, .InputStream, java.net.MalformedURLException, .URI, .URL, .URLClassLoader, java.nio.file.FileSystem, .FileSystems, .FileVisitResult, .Files, .Path, .SimpleFileVisitor, java.nio.file.attribute.BasicFileAttributes, java.util.ArrayList, .Enumeration, .HashMap, .Iterator, .List, .Map, java.util.zip.ZipEntry, .ZipFile, org.aspectj.bridge.IMessageHandler, .MessageUtil, org.aspectj.util.LangUtil, .SoftHashMap, org.aspectj.weaver.BCException, .UnresolvedType, .WeaverMessages, org.aspectj.weaver.tools.Trace, .TraceFactory

Authors
Andy Clement, Mario Ivankovits

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
public abstract static class
pack-priv class
pack-priv abstract static class
pack-priv static class
pack-priv static class
ClassPathManager.JImageEntry

Maintains a shared package cache for java runtime image.

pack-priv static class
pack-priv class

Field Summary

Modifier and TypeField and Description
private List<ClassPathManager.Entry>
private static URI
private static final int
private static int
private List<ZipFile>
private static Trace

Constructor Summary

AccessConstructor and Description
public
protected

Method Summary

Modifier and TypeMethod and Description
public void
public void
public ClassPathManager.ClassFile
public List<ClassPathManager.Entry>
private static String
pack-priv static boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

entriesback to summary
private List<ClassPathManager.Entry> entries
JRT_URIback to summary
private static URI JRT_URI
MAXOPEN_DEFAULTback to summary
private static final int MAXOPEN_DEFAULT
maxOpenArchivesback to summary
private static int maxOpenArchives
openArchivesback to summary
private List<ZipFile> openArchives
traceback to summary
private static Trace trace

Constructor Detail

ClassPathManagerback to summary
public ClassPathManager(List<String> classpath, IMessageHandler handler)
ClassPathManagerback to summary
protected ClassPathManager()

Method Detail

addPathback to summary
public void addPath(String name, IMessageHandler handler)
closeArchivesback to summary
public void closeArchives()
findback to summary
public ClassPathManager.ClassFile find(UnresolvedType type)
getEntriesback to summary
public List<ClassPathManager.Entry> getEntries()
getSystemPropertyWithoutSecurityExceptionback to summary
private static String getSystemPropertyWithoutSecurityException(String aPropertyName, String aDefaultValue)
hasClassExtensionback to summary
pack-priv static boolean hasClassExtension(String name)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.aspectj.weaver.bcel back to summary

pack-priv Class ClassPathManager.ByteBasedClassFile

extends ClassFile
Class Inheritance

Field Summary

Modifier and TypeField and Description
private ByteArrayInputStream
private byte[]
private String

Constructor Summary

AccessConstructor and Description
public
ByteBasedClassFile(byte[] bytes, String path)

Method Summary

Modifier and TypeMethod and Description
public void
public InputStream
public String

Field Detail

baisback to summary
private ByteArrayInputStream bais
bytesback to summary
private byte[] bytes
pathback to summary
private String path

Constructor Detail

ByteBasedClassFileback to summary
public ByteBasedClassFile(byte[] bytes, String path)

Method Detail

closeback to summary
public void close()

Implements abstract org.aspectj.weaver.bcel.ClassPathManager.ClassFile.close.

Annotations
@Override
getInputStreamback to summary
public InputStream getInputStream() throws IOException

Implements abstract org.aspectj.weaver.bcel.ClassPathManager.ClassFile.getInputStream.

Annotations
@Override
getPathback to summary
public String getPath()

Implements abstract org.aspectj.weaver.bcel.ClassPathManager.ClassFile.getPath.

Annotations
@Override
org.aspectj.weaver.bcel back to summary

public abstract Class ClassPathManager.ClassFile

extends Object
Class Inheritance
Known Direct Subclasses
org.aspectj.weaver.bcel.ClassPathManager.ByteBasedClassFile, org.aspectj.weaver.bcel.ClassPathManager.FileClassFile, org.aspectj.weaver.bcel.ClassPathManager.ZipEntryClassFile

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract void
public abstract InputStream
public abstract String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ClassFileback to summary
public ClassFile()

Method Detail

closeback to summary
public abstract void close()
getInputStreamback to summary
public abstract InputStream getInputStream() throws IOException
getPathback to summary
public abstract String getPath()
org.aspectj.weaver.bcel back to summary

pack-priv Class ClassPathManager.DirEntry

extends Entry
Class Inheritance

Field Summary

Modifier and TypeField and Description
private String

Constructor Summary

AccessConstructor and Description
public
public
DirEntry(String dirPath)

Method Summary

Modifier and TypeMethod and Description
public ClassPathManager.ClassFile
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Field Detail

dirPathback to summary
private String dirPath

Constructor Detail

DirEntryback to summary
public DirEntry(File dir)
DirEntryback to summary
public DirEntry(String dirPath)

Method Detail

findback to summary
public ClassPathManager.ClassFile find(String name)

Implements abstract org.aspectj.weaver.bcel.ClassPathManager.Entry.find.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.aspectj.weaver.bcel back to summary

pack-priv abstract Class ClassPathManager.Entry

extends Object
Class Inheritance
Known Direct Subclasses
org.aspectj.weaver.bcel.ClassPathManager.DirEntry, org.aspectj.weaver.bcel.ClassPathManager.JImageEntry, org.aspectj.weaver.bcel.ClassPathManager.ZipFileEntry

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public abstract ClassPathManager.ClassFile
find(String name)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Entryback to summary
pack-priv Entry()

Method Detail

findback to summary
public abstract ClassPathManager.ClassFile find(String name) throws IOException
org.aspectj.weaver.bcel back to summary

pack-priv Class ClassPathManager.FileClassFile

extends ClassFile
Class Inheritance

Field Summary

Modifier and TypeField and Description
private File
private FileInputStream

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public InputStream
public String

Field Detail

fileback to summary
private File file
fisback to summary
private FileInputStream fis

Constructor Detail

FileClassFileback to summary
public FileClassFile(File file)

Method Detail

closeback to summary
public void close()

Implements abstract org.aspectj.weaver.bcel.ClassPathManager.ClassFile.close.

Annotations
@Override
getInputStreamback to summary
public InputStream getInputStream() throws IOException

Implements abstract org.aspectj.weaver.bcel.ClassPathManager.ClassFile.getInputStream.

Annotations
@Override
getPathback to summary
public String getPath()

Implements abstract org.aspectj.weaver.bcel.ClassPathManager.ClassFile.getPath.

Annotations
@Override
org.aspectj.weaver.bcel back to summary

pack-priv Class ClassPathManager.JImageEntry

extends Entry
Class Inheritance

Maintains a shared package cache for java runtime image. This maps packages (for example: java/lang) to a starting root position in the filesystem (for example: /modules/java.base/java/lang). When searching for a type we work out the package name, use it to find where in the filesystem to start looking then run from there. Once found we do cache what we learn to make subsequent lookups of that type even faster. Maintaining just a package cache rather than complete type cache helps reduce memory usage but still gives reasonably fast lookup performance.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv class
pack-priv class

Field Summary

Modifier and TypeField and Description
private ClassPathManager.JImageEntry.JImageState
private static Map<String, ClassPathManager.JImageEntry.JImageState>

Constructor Summary

AccessConstructor and Description
public
JImageEntry(String jrtFsPath)

Method Summary

Modifier and TypeMethod and Description
private synchronized void
buildPackageMap()

Create a map from package names to the specific directory of the package members in the filesystem.

public ClassPathManager.ClassFile
pack-priv Map<String, Path>
pack-priv Map<String, Path>
private Path
searchForFileAndCache(final Path startPath, final String name)

Field Detail

stateback to summary
private ClassPathManager.JImageEntry.JImageState state
statesback to summary
private static Map<String, ClassPathManager.JImageEntry.JImageState> states

Constructor Detail

JImageEntryback to summary
public JImageEntry(String jrtFsPath)

Method Detail

buildPackageMapback to summary
private synchronized void buildPackageMap()

Create a map from package names to the specific directory of the package members in the filesystem.

findback to summary
public ClassPathManager.ClassFile find(String name) throws IOException

Implements abstract org.aspectj.weaver.bcel.ClassPathManager.Entry.find.

Annotations
@Override
getFileCacheback to summary
pack-priv Map<String, Path> getFileCache()
getPackageCacheback to summary
pack-priv Map<String, Path> getPackageCache()
searchForFileAndCacheback to summary
private Path searchForFileAndCache(final Path startPath, final String name)
org.aspectj.weaver.bcel back to summary

pack-priv Class ClassPathManager.JImageEntry.JImageState

extends Object
Class Inheritance
  • java.lang.Object
  • org.aspectj.weaver.bcel.ClassPathManager.JImageEntry.JImageState

Field Summary

Modifier and TypeField and Description
pack-priv Map<String, Path>
private final FileSystem
private final String
pack-priv Map<String, Path>
pack-priv boolean

Constructor Summary

AccessConstructor and Description
public
JImageState(String jrtFsPath, FileSystem fs)

Field Detail

fileCacheback to summary
pack-priv Map<String, Path> fileCache
fsback to summary
private final FileSystem fs
jrtFsPathback to summary
private final String jrtFsPath
packageCacheback to summary
pack-priv Map<String, Path> packageCache
packageCacheInitializedback to summary
pack-priv boolean packageCacheInitialized

Constructor Detail

JImageStateback to summary
public JImageState(String jrtFsPath, FileSystem fs)
org.aspectj.weaver.bcel back to summary

pack-priv Class ClassPathManager.JImageEntry.PackageCacheBuilderVisitor

extends SimpleFileVisitor<Path>
Class Inheritance

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public FileVisitResult
visitFile(Path
a reference to the file
file
,
BasicFileAttributes
the file's basic attributes
attrs
)

Overrides java.nio.file.SimpleFileVisitor.visitFile.

Implements java.nio.file.FileVisitor.visitFile.

Invoked for a file in a directory.
Inherited from java.nio.file.SimpleFileVisitor:
postVisitDirectorypreVisitDirectoryvisitFileFailed

Constructor Detail

PackageCacheBuilderVisitorback to summary
pack-priv PackageCacheBuilderVisitor()

Method Detail

visitFileback to summary
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException

Overrides java.nio.file.SimpleFileVisitor.visitFile.

Implements java.nio.file.FileVisitor.visitFile.

Doc from java.nio.file.SimpleFileVisitor.visitFile.

Invoked for a file in a directory.

Unless overridden, this method returns CONTINUE.

Parameters
file:Path

Doc from java.nio.file.FileVisitor.visitFile.

a reference to the file

attrs:BasicFileAttributes

Doc from java.nio.file.FileVisitor.visitFile.

the file's basic attributes

Returns:FileVisitResult

Doc from java.nio.file.FileVisitor.visitFile.

the visit result

Annotations
@Override
Exceptions
IOException:

Doc from java.nio.file.FileVisitor.visitFile.

if an I/O error occurs

org.aspectj.weaver.bcel back to summary

pack-priv Class ClassPathManager.JImageEntry.TypeIdentifier

extends SimpleFileVisitor<Path>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public int
public Path
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public FileVisitResult
visitFile(Path
a reference to the file
file
,
BasicFileAttributes
the file's basic attributes
attrs
)

Overrides java.nio.file.SimpleFileVisitor.visitFile.

Implements java.nio.file.FileVisitor.visitFile.

Invoked for a file in a directory.
Inherited from java.nio.file.SimpleFileVisitor:
postVisitDirectorypreVisitDirectoryvisitFileFailed

Field Detail

filesSearchedCountback to summary
public int filesSearchedCount
foundback to summary
public Path found
nameback to summary
private String name

Constructor Detail

TypeIdentifierback to summary
public TypeIdentifier(String name)

Method Detail

visitFileback to summary
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException

Overrides java.nio.file.SimpleFileVisitor.visitFile.

Implements java.nio.file.FileVisitor.visitFile.

Doc from java.nio.file.SimpleFileVisitor.visitFile.

Invoked for a file in a directory.

Unless overridden, this method returns CONTINUE.

Parameters
file:Path

Doc from java.nio.file.FileVisitor.visitFile.

a reference to the file

attrs:BasicFileAttributes

Doc from java.nio.file.FileVisitor.visitFile.

the file's basic attributes

Returns:FileVisitResult

Doc from java.nio.file.FileVisitor.visitFile.

the visit result

Annotations
@Override
Exceptions
IOException:

Doc from java.nio.file.FileVisitor.visitFile.

if an I/O error occurs

org.aspectj.weaver.bcel back to summary

pack-priv Class ClassPathManager.ZipEntryClassFile

extends ClassFile
Class Inheritance

Field Summary

Modifier and TypeField and Description
private ZipEntry
private InputStream
private ClassPathManager.ZipFileEntry

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public InputStream
public String

Field Detail

entryback to summary
private ZipEntry entry
isback to summary
private InputStream is
zipFileback to summary
private ClassPathManager.ZipFileEntry zipFile

Constructor Detail

ZipEntryClassFileback to summary
public ZipEntryClassFile(ClassPathManager.ZipFileEntry zipFile, ZipEntry entry)

Method Detail

closeback to summary
public void close()

Implements abstract org.aspectj.weaver.bcel.ClassPathManager.ClassFile.close.

Annotations
@Override
getInputStreamback to summary
public InputStream getInputStream() throws IOException

Implements abstract org.aspectj.weaver.bcel.ClassPathManager.ClassFile.getInputStream.

Annotations
@Override
getPathback to summary
public String getPath()

Implements abstract org.aspectj.weaver.bcel.ClassPathManager.ClassFile.getPath.

Annotations
@Override
org.aspectj.weaver.bcel back to summary

pack-priv Class ClassPathManager.ZipFileEntry

extends Entry
Class Inheritance

Field Summary

Modifier and TypeField and Description
private File
private ZipFile

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
private void
public ClassPathManager.ClassFile
public List<ClassPathManager.ZipEntryClassFile>
public ZipFile
private boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Field Detail

fileback to summary
private File file
zipFileback to summary
private ZipFile zipFile

Constructor Detail

ZipFileEntryback to summary
public ZipFileEntry(File file) throws IOException
ZipFileEntryback to summary
public ZipFileEntry(ZipFile zipFile)

Method Detail

closeback to summary
public void close()
closeSomeArchivesback to summary
public void closeSomeArchives(int n)
ensureOpenback to summary
private void ensureOpen() throws IOException
findback to summary
public ClassPathManager.ClassFile find(String name) throws IOException

Implements abstract org.aspectj.weaver.bcel.ClassPathManager.Entry.find.

Annotations
@Override
getAllClassFilesback to summary
public List<ClassPathManager.ZipEntryClassFile> getAllClassFiles() throws IOException
getZipFileback to summary
public ZipFile getZipFile()
isReallyOpenback to summary
private boolean isReallyOpen()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override