public interface PackageManifestManager
Title: Service Event Fabric Core
Description: Defines a general Package Manifest Manager interface.
Copyright: Copyright (c) 2010
Company: StreamScape Technologies
Modifier and Type | Method and Description |
---|---|
void |
addPackage(PackageDescriptor descriptor)
Adds the specified package descriptor at the end of the manifest.
|
void |
addPackageAt(int position,
PackageDescriptor descriptor)
Adds the specified package descriptor to the manifest at the specified position.
|
boolean |
existsPackage(java.lang.String name)
Checks if the specified package exists in the manifest.
|
com.streamscape.lib.loader.PackageLoaderRegistry |
getLoaderRegistry()
Returns a package loader registry associated of the manifest manager.
|
java.lang.ClassLoader |
getManifestClassLoader()
Returns the system class loader for this package manifest.
|
PackageDescriptor |
getPackage(java.lang.String name)
Returns a copy of the specified package descriptor.
|
PackageDescriptor |
getPackageByArchive(java.lang.String archiveName)
Returns a copy of the package descriptor that contains the specified archive.
|
PackageDescriptor |
getPackageBySemanticType(SemanticType type)
Finds and returns a copy of the package descriptor where the specified semantic type has been loaded.
|
int |
getPackagePosition(PackageDescriptor descriptor)
Returns the position of the specified package in the manifest.
|
int |
getPackagePosition(java.lang.String name)
Returns the position of the specified package in the manifest.
|
java.util.List |
getPackages()
Returns a list
copies of all packages descriptors in the manifest. |
boolean |
isPackageLoaded(java.lang.String name)
Checks if the specified package is loaded to the package loader registry.
|
java.util.List |
listLoadedPackages()
Returns a list of names of all packages loaded to the package loader registry.
|
java.util.List |
listPackages()
Returns a list of names of all packages in the manifest.
|
void |
loadPackage(java.lang.String name)
Invokes the
loadPackage(String, boolean) with the second argument set to true . |
void |
loadPackage(java.lang.String name,
boolean checkDependencies)
Loads the specified package to the package loader registry.
|
void |
removePackage(java.lang.String name)
Removes the specified package from the manifest.
|
void |
setPackageScope(java.lang.String name,
boolean global)
Sets a scope of the specified package (global packages are replicated across the Fabric).
|
void |
unloadPackage(java.lang.String name)
Invokes the
unloadPackage(String, boolean) with the second argument set to true . |
void |
unloadPackage(java.lang.String name,
boolean checkDependencies)
Unloads the specified package from the package loader registry.
|
void |
updatePackage(PackageDescriptor descriptor,
Package pkg)
Updates the existing package with the specified descriptor.
|
void |
updatePackageAt(int position,
PackageDescriptor descriptor,
Package pkg)
Updates the existing package with the specified descriptor and moves it to the specified position.
|
void |
validatePackage(java.lang.String name)
Checks all entities (semantic types, event prototypes etc) that depend on the specified package.
|
void addPackage(PackageDescriptor descriptor) throws PackageManifestException
descriptor.isAutoload() == true
this package will be automatically loaded
to the package loader registry.descriptor
- the package descriptor to be added.PackageManifestException
- if the specified package already exists.void addPackageAt(int position, PackageDescriptor descriptor) throws PackageManifestException
descriptor.isAutoload() == true
this package will be automatically loaded
to the package loader registry.position
- the position where the package will be added.descriptor
- the package descriptor to be added.PackageManifestException
- if the specified package already exists.void updatePackage(PackageDescriptor descriptor, Package pkg) throws PackageManifestException
pkg
is not null
it will be updated in the Repository.descriptor
- the package descriptor to be updated.pkg
- the package to be updated.PackageManifestException
- if some error occurs.void updatePackageAt(int position, PackageDescriptor descriptor, Package pkg) throws PackageManifestException
descriptor.isAutoload() == true
this package will be automatically loaded
to the package loader registry after update.
pkg
is not null
it will be updated in the Repository.position
- the position where the package will be moved.descriptor
- the package descriptor to be updated.pkg
- the package to be updated.PackageManifestException
- if some error occurs.void setPackageScope(java.lang.String name, boolean global) throws javax.naming.NamingException, PackageManifestException
sdo.TestPackage
).
This method is applicable only for sdo
or collection
packages.
name
- the name of package to be updated.global
- the scope to be set.javax.naming.NamingException
- if the specified name has invalid format.PackageManifestException
- if the specified package does not exist or
if some other error occurs.void removePackage(java.lang.String name) throws javax.naming.NamingException, PackageManifestException
sdo.TestPackage
).name
- the name of package to be removed.javax.naming.NamingException
- if the specified name has invalid format.PackageManifestException
- if the specified package does not exist or
if the specified package is loaded the package loader registry.PackageDescriptor getPackage(java.lang.String name) throws javax.naming.NamingException
sdo.TestPackage
).name
- the name of package to be returned.null
if this package does not exist.javax.naming.NamingException
- if the specified name has invalid format.PackageDescriptor getPackageByArchive(java.lang.String archiveName) throws PackageManifestException
archiveName
- the name of the archive.null
if the archive does not belong to any package.PackageManifestException
- if some error occurs.PackageDescriptor getPackageBySemanticType(SemanticType type)
type
- the specified semantic type.null
if the package is not found.int getPackagePosition(java.lang.String name) throws javax.naming.NamingException
sdo.TestPackage
).
-1
if the package does not exist.name
- the package name;-1
if the package does not exist.javax.naming.NamingException
- if the specified name has invalid format.int getPackagePosition(PackageDescriptor descriptor)
sdo.TestPackage
).
-1
if the package does not exist.descriptor
- the package descriptor;-1
if the package does not exist.boolean existsPackage(java.lang.String name) throws javax.naming.NamingException
sdo.TestPackage
).name
- the name of package to be checked.true
if the specified package exists, false
otherwise.javax.naming.NamingException
- if the specified name has invalid format.java.util.List listPackages()
sdo.TestPackage
).java.util.List getPackages()
copies
of all packages descriptors in the manifest.java.lang.ClassLoader getManifestClassLoader()
com.streamscape.lib.loader.PackageLoaderRegistry getLoaderRegistry()
void loadPackage(java.lang.String name) throws javax.naming.NamingException, PackageManifestException
loadPackage(String, boolean)
with the second argument set to true
.
name
- the name of package to be loaded.javax.naming.NamingException
- if the specified name has invalid format.PackageManifestException
- if the specified package does not exist in the manifest manager or
if some error occurs during this operation execution.void loadPackage(java.lang.String name, boolean checkDependencies) throws javax.naming.NamingException, PackageManifestException
sdo.TestPackage
).
If checkDependencies
is true
, all entities (semantic types and event prototypes)
depending on the package will be checked. They will be marked as valid if their classes are successfully loaded.
Setting this parameter to false
may allow to load the package faster. This can be important
in the case of a large package with many classes.
This method loads all JARs associated with the package to a new class loader. Depending on the package parameters, this class loader can be included to the class loaders chain of the registry and can be set as root of this chain.
name
- the name of package to be loaded.checkDependencies
- true
if the dependent entities will be checked after the package loading, false
otherwise.javax.naming.NamingException
- if the specified name has invalid format.PackageManifestException
- if the specified package does not exist in the manifest manager or
if some error occurs during this operation execution.void unloadPackage(java.lang.String name) throws javax.naming.NamingException, PackageManifestException
unloadPackage(String, boolean)
with the second argument set to true
.
name
- javax.naming.NamingException
PackageManifestException
void unloadPackage(java.lang.String name, boolean checkDependencies) throws javax.naming.NamingException, PackageManifestException
sdo.TestPackage
).
If checkDependencies
is true
, all entities (semantic types and event prototypes)
depending on the package will be checked. They will be marked as invalid after their classes are unloaded.
Setting this parameter to false
may allow to unload the package faster. This can be important
in the case of a large package with many classes.
This method tries to properly unload all JARs associated with the package and removes the corresponding class loader from the registry.
name
- the name of package to be unloaded.checkDependencies
- true
if the dependent entities will be checked after the package unloading, false
otherwise.javax.naming.NamingException
- if the specified name has invalid format.PackageManifestException
- if the specified package does not exist in the manifest manager or
if the specified package is not loaded to package loader registry or
if some error occurs during this operation execution.boolean isPackageLoaded(java.lang.String name)
sdo.TestPackage
).name
- name the name of package to be checked.true
if the specified package is loaded, false
otherwise.java.util.List listLoadedPackages()
sdo.TestPackage
).void validatePackage(java.lang.String name) throws javax.naming.NamingException, PackageManifestException
sdo.TestPackage
).name
- the name of package to be validated.javax.naming.NamingException
- if the specified name has invalid format.PackageManifestException
- if the specified package does not exist in the manifest manager or
if the specified package is not loaded to package loader registry or
if some error occurs during this operation execution.Copyright © 2015-2024 StreamScape Technologies. All rights reserved.