Top Description Fields Constructors Methods
org.python.core.packagecache

public Class SysPackageManager

extends PathPackageManager
Class Inheritance
Imports
org.python.core.Py, .PyJavaPackage, .PyList, .PySystemState, .RegistryKey, java.io.File, .IOException, java.net.URI, java.nio.file.FileSystem, .FileSystems, .FileVisitResult, .FileVisitor, .Files, .Path, .ProviderNotFoundException, .SimpleFileVisitor, java.nio.file.attribute.BasicFileAttributes, java.util.Properties, .Set, .StringTokenizer, java.util.logging.Level, .Logger

System package manager. Used by org.python.core.PySystemState.

Field Summary

Modifier and TypeField and Description
private static Logger
Inherited from org.python.core.packagecache.PathPackageManager:
searchPath

Constructor Summary

AccessConstructor and Description
public
SysPackageManager(File cachedir, Properties registry)

Method Summary

Modifier and TypeMethod and Description
public void
addJar(String
A directory name.
jarfile
,
boolean cache)

Implements abstract org.python.core.packagecache.PackageManager.addJar.

Append a jar file to the list of locations searched for java packages and java classes.

public void
addJarDir(String
A directory name.
jdir
,
boolean cache)

Implements abstract org.python.core.packagecache.PackageManager.addJarDir.

Append a directory to the list of directories searched for java packages and java classes.

private void
addJarDir(String
directory containing some JAR or ZIP files
jdir
,
boolean cache, boolean saveCache)

Index the contents of every JAR or ZIP in a directory.

private void
addJarPath(String path)

Scan a path that contains directory specifiers, and within each directory, find every JAR or ZIP archive and add it to the list of archives searched for packages.

private void
addModuleDir(final Path
directory containing some modules
moduleDir
)

Index the packages in every module in a directory.

protected void
comment(String
message template (see java.text.MessageFormat)
msg
,
Object...
parameters to insert
params
)

Overrides org.python.core.packagecache.CachedJarsPackageManager.comment.

Comment log method - hook.

protected void
debug(String
message template (see java.text.MessageFormat)
msg
,
Object...
parameters to insert
params
)

Overrides org.python.core.packagecache.CachedJarsPackageManager.debug.

Debug log method - hook.

public PyList
doDir(PyJavaPackage
queried package
jpkg
,
boolean
if true then instatiate reported names in package dict
instantiate
,
boolean
exclude packages (just when instantiate is false)
exclpkgs
)

Overrides org.python.core.packagecache.PathPackageManager.doDir.

Reports the specified package content names.

private void
findAllPackages(Properties
in practice, the Jython registry
registry
)

Walk the packages found in paths specified indirectly through the given Properties object.

public Class<T>
public Class<T>
protected void
message(String
message template (see java.text.MessageFormat)
msg
,
Object...
parameters to insert
params
)

Overrides org.python.core.packagecache.CachedJarsPackageManager.message.

Message log method - hook.

public void
public boolean
packageExists(String
parent pkg name
pkg
,
String
candidate name
name
)

Overrides org.python.core.packagecache.PathPackageManager.packageExists.

Dynamically check if pkg.name exists as java pkg in the controlled hierarchy.

protected void
warning(String
message template (see java.text.MessageFormat)
msg
,
Object...
parameters to insert
params
)

Overrides org.python.core.packagecache.CachedJarsPackageManager.warning.

Warning log method - hook.

Inherited from org.python.core.packagecache.PathPackageManager:
addClassPathaddDirectorydoDirpackageExists

Field Detail

pkglogback to summary
private static Logger pkglog

Constructor Detail

SysPackageManagerback to summary
public SysPackageManager(File cachedir, Properties registry)

Method Detail

addJarback to summary
public void addJar(String jarfile, boolean cache)

Implements abstract org.python.core.packagecache.PackageManager.addJar.

Doc from org.python.core.packagecache.PackageManager.addJar.

Append a jar file to the list of locations searched for java packages and java classes.

Parameters
jarfile:String

A directory name.

Annotations
@Override
addJarDirback to summary
public void addJarDir(String jdir, boolean cache)

Implements abstract org.python.core.packagecache.PackageManager.addJarDir.

Doc from org.python.core.packagecache.PackageManager.addJarDir.

Append a directory to the list of directories searched for java packages and java classes.

Parameters
jdir:String

A directory name.

Annotations
@Override
addJarDirback to summary
private void addJarDir(String jdir, boolean cache, boolean saveCache)

Index the contents of every JAR or ZIP in a directory.

Parameters
jdir:String

directory containing some JAR or ZIP files

addJarPathback to summary
private void addJarPath(String path)

Scan a path that contains directory specifiers, and within each directory, find every JAR or ZIP archive and add it to the list of archives searched for packages. (This means, index it.) Non-directory entries are ignored.

addModuleDirback to summary
private void addModuleDir(final Path moduleDir)

Index the packages in every module in a directory. Entries in the directory that are not modules (do not contain a module-info.class) are ignored. Only modules exploded on the file system of this path are (currently) supported, and at the time of writing, we only use this method on the jrt: file system.

Parameters
moduleDir:Path

directory containing some modules

commentback to summary
protected void comment(String msg, Object... params)

Overrides org.python.core.packagecache.CachedJarsPackageManager.comment.

Doc from org.python.core.packagecache.CachedJarsPackageManager.comment.

Comment log method - hook. This default implementation does nothing.

Parameters
msg:String

message template (see java.text.MessageFormat)

params:Object[]

parameters to insert

Annotations
@Override
debugback to summary
protected void debug(String msg, Object... params)

Overrides org.python.core.packagecache.CachedJarsPackageManager.debug.

Doc from org.python.core.packagecache.CachedJarsPackageManager.debug.

Debug log method - hook. This default implementation does nothing.

Parameters
msg:String

message template (see java.text.MessageFormat)

params:Object[]

parameters to insert

Annotations
@Override
doDirback to summary
public PyList doDir(PyJavaPackage jpkg, boolean instantiate, boolean exclpkgs)

Overrides org.python.core.packagecache.PathPackageManager.doDir.

Doc from org.python.core.packagecache.PackageManager.doDir.

Reports the specified package content names. Should be overridden. Used by PyJavaPackage#__dir__ and PyJavaPackage#fillDir.

Parameters
jpkg:PyJavaPackage

queried package

instantiate:boolean

if true then instatiate reported names in package dict

exclpkgs:boolean

exclude packages (just when instantiate is false)

Returns:PyList

resulting list of names (PyList of PyString)

Annotations
@Override

findAllPackagesback to summary
private void findAllPackages(Properties registry)

Walk the packages found in paths specified indirectly through the given Properties object.

Parameters
registry:Properties

in practice, the Jython registry

findClassback to summary
public Class<T> findClass(String pkg, String name)

Overrides org.python.core.packagecache.PackageManager.findClass.

Annotations
@Override
findClassback to summary
public Class<T> findClass(String pkg, String name, String reason)

Implements abstract org.python.core.packagecache.PackageManager.findClass.

Annotations
@Override
messageback to summary
protected void message(String msg, Object... params)

Overrides org.python.core.packagecache.CachedJarsPackageManager.message.

Doc from org.python.core.packagecache.CachedJarsPackageManager.message.

Message log method - hook. This default implementation does nothing.

Parameters
msg:String

message template (see java.text.MessageFormat)

params:Object[]

parameters to insert

Annotations
@Override
notifyPackageImportback to summary
public void notifyPackageImport(String pkg, String name)

Overrides org.python.core.packagecache.PackageManager.notifyPackageImport.

Annotations
@Override
packageExistsback to summary
public boolean packageExists(String pkg, String name)

Overrides org.python.core.packagecache.PathPackageManager.packageExists.

Doc from org.python.core.packagecache.PackageManager.packageExists.

Dynamically check if pkg.name exists as java pkg in the controlled hierarchy. Should be overridden.

Parameters
pkg:String

parent pkg name

name:String

candidate name

Returns:boolean

true if pkg exists

Annotations
@Override

warningback to summary
protected void warning(String msg, Object... params)

Overrides org.python.core.packagecache.CachedJarsPackageManager.warning.

Doc from org.python.core.packagecache.CachedJarsPackageManager.warning.

Warning log method - hook. This default implementation does nothing.

Parameters
msg:String

message template (see java.text.MessageFormat)

params:Object[]

parameters to insert

Annotations
@Override