M
- The resolved dependency classR
- The repositories classpublic abstract class Container<M extends Module,R extends Repositories> extends RootDirectory
Sincerity
class.
While strictly speaking it is a singleton, several Container instances may
coexist via the Bootstrap
mechanism. This is in order to allow
Sincerity to "reboot" itself using a new classpath in case the
Container
is changed. See Sincerity.reboot()
.
Because the set of plugins in a container depends on its classpath, this is
also where you can access them, via getPlugins()
.
Modifier and Type | Field and Description |
---|---|
static String |
ARTIFACTS_CONF |
static String |
DEPENDENCIES_CONF |
static String |
IVY_CONF |
static String |
REPOSITORIES_CONF |
static String |
SHORTCUTS_CONF |
static String |
SINCERITY_DIR |
Constructor and Description |
---|
Container(Sincerity sincerity,
File root,
int debugLevel)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addInstallation()
Increase the number of installations by one.
|
Bootstrap |
createBootstrap()
Creates a new bootstrap based on the classpath.
|
PackagingContext |
createPackagingContext()
Creates a packaging context for the container.
|
Bootstrap |
getBootstrap()
The cached bootstrap.
|
Bootstrap |
getBootstrap(boolean forceCreate)
The bootstrap, whether cached or explicitly (re)created.
|
File |
getCacheFile(String... parts)
Constructs an absolute path from the "cache" subdirectory.
|
File |
getConfigurationFile(String... parts)
Constructs an absolute path from the "configuration" subdirectory.
|
abstract Dependencies<M> |
getDependencies()
The specified and resolved dependencies.
|
File |
getExecutablesFile(String... parts)
Constructs an absolute path from the "executables" subdirectory.
|
int |
getInstallations() |
LanguageManager |
getLanguageManager()
The cached Scripturian language manager, based on the current bootstrap.
|
File |
getLibrariesFile(String... parts)
Constructs an absolute path from the "libraries" subdirectory.
|
File |
getLogsFile(String... parts)
Constructs an absolute path from the "logs" subdirectory.
|
ParserManager |
getParserManager()
The cached Scripturian parser manager, based on the current bootstrap.
|
Plugins |
getPlugins()
The cached plugins, based on the current bootstrap.
|
List<String> |
getPrograms()
The names of all files under the "programs" subdirectory without their
extensions.
|
File |
getProgramsFile(String... parts)
Constructs an absolute path from the "programs" subdirectory.
|
abstract R |
getRepositories()
The specified repositories.
|
Shortcuts |
getShortcuts()
The shortcuts.
|
Sincerity |
getSincerity()
The Sincerity instance.
|
File |
getSincerityFile(String... parts)
Constructs an absolute path from the Sincerity root directory.
|
boolean |
hasChanged() |
boolean |
hasFinishedInstalling() |
void |
initializeProgress()
Sets
setChanged(boolean) to false and
setHasFinishedInstalling(boolean) to true. |
void |
setChanged(boolean hasChanged)
True if the dependencies have been changed, requiring a new bootstrap.
|
void |
setHasFinishedInstalling(boolean hasFinishedInstalling)
True if dependencies have finished installing.
|
void |
setInstallations(int installations)
The number of installation attempts for this root directory.
|
void |
transferProgress(org.apache.ivy.plugins.repository.TransferEvent event) |
void |
updateBootstrap()
Recreates and caches the bootstrap.
|
getAbsoluteFile, getFile, getRelativeFile, getRelativePath, getRelativePath, getRoot
public static final String SINCERITY_DIR
public static final String IVY_CONF
public static final String REPOSITORIES_CONF
public static final String DEPENDENCIES_CONF
public static final String ARTIFACTS_CONF
public static final String SHORTCUTS_CONF
public Container(Sincerity sincerity, File root, int debugLevel) throws SincerityException
sincerity
- The Sincerity instanceroot
- The container root directorydebugLevel
- The Ivy debug levelSincerityException
- In case of an errorDefaultMessageLogger
public Sincerity getSincerity()
public abstract Dependencies<M> getDependencies()
public abstract R getRepositories()
public Shortcuts getShortcuts()
public Plugins getPlugins() throws SincerityException
SincerityException
- In case of an errorpublic Bootstrap getBootstrap() throws SincerityException
SincerityException
- In case of an errorpublic Bootstrap getBootstrap(boolean forceCreate) throws SincerityException
forceCreate
- True to ignore cached value and force creationSincerityException
- In case of an errorcreateBootstrap()
public LanguageManager getLanguageManager() throws SincerityException
Contains explicit support for Python and Velocity.
SincerityException
- In case of an errorpublic ParserManager getParserManager() throws SincerityException
SincerityException
- In case of an errorpublic PackagingContext createPackagingContext() throws SincerityException
SincerityException
- In case of an errorpublic File getSincerityFile(String... parts)
parts
- The path partspublic File getConfigurationFile(String... parts)
parts
- The path partspublic File getLogsFile(String... parts)
parts
- The path partspublic File getCacheFile(String... parts)
parts
- The path partspublic File getLibrariesFile(String... parts)
parts
- The path partspublic File getProgramsFile(String... parts)
parts
- The path partspublic File getExecutablesFile(String... parts)
parts
- The path partspublic List<String> getPrograms() throws SincerityException
SincerityException
- In case of an errorpublic boolean hasChanged()
setChanged(boolean)
public void setChanged(boolean hasChanged)
hasChanged
- True if changedpublic boolean hasFinishedInstalling()
setHasFinishedInstalling(boolean)
public void setHasFinishedInstalling(boolean hasFinishedInstalling)
hasFinishedInstalling
- True if finished installingpublic int getInstallations()
setInstallations(int)
public void setInstallations(int installations)
Note that this value will persist even if this class is re-instantiated.
installations
- The number of installationsaddInstallation()
public void addInstallation()
setInstallations(int)
public void initializeProgress()
setChanged(boolean)
to false and
setHasFinishedInstalling(boolean)
to true.public Bootstrap createBootstrap() throws SincerityException
SincerityException
- In case of an errorpublic void updateBootstrap() throws SincerityException
SincerityException
- In case of an errorgetBootstrap(boolean)
public void transferProgress(org.apache.ivy.plugins.repository.TransferEvent event)
Copyright © 2011-2016 Three Crickets LLC.