|
Qwylt | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.module.spi.SharedState
public abstract class SharedState
A holder for state that is shared by a set of archives that must
share a ClassLoader.
| Constructor Summary | |
|---|---|
protected |
SharedState(java.util.List<? extends ModuleArchive> compositeMembers)
Constructs an instance for the specified composite members. |
protected |
SharedState(ModuleRepository repository)
Constructs an empty instance on which load() should be called. |
| Method Summary | |
|---|---|
protected abstract java.lang.ClassLoader |
createLoader(ClassSpace imports,
java.util.List<? extends ModuleArchive> members)
Creates a ClassLoader to be shared by the composite members. |
java.lang.ClassLoader |
getClassLoader()
Returns the ClassLoader that should be shared by all
composite members. |
java.util.List<? extends ModuleArchive> |
getCompositeMembers()
Returns the composite members. |
java.util.Set<java.lang.String> |
getExports()
Returns the combined exports of the composite members. |
java.util.Set<ModuleArchive> |
getImported(ModuleArchive importer)
Returns the imported and member archives. |
ImportSpace |
getImports()
Returns the combined imports of the composite members. |
ModuleArchive |
getRootMember()
Returns the root member. |
boolean |
load(Streams.In in)
Load this instance from the specified stream. |
protected java.util.Set<java.lang.String> |
mergeExports(java.util.List<? extends ModuleArchive> members)
Merges the exports of the composite members. |
protected ImportSpace |
mergeImports(java.util.List<? extends ModuleArchive> members)
Merges the imports of the composite members. |
void |
store(Streams.Out out)
Store this instance into the specified stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected SharedState(ModuleRepository repository)
protected SharedState(java.util.List<? extends ModuleArchive> compositeMembers)
compositeMembers - The set of composite members.
java.lang.IllegalStateException - if the set is empty or if any
of the members are not composites.| Method Detail |
|---|
public ModuleArchive getRootMember()
public java.util.List<? extends ModuleArchive> getCompositeMembers()
public ImportSpace getImports()
java.lang.IllegalStateException - if this instance is not connected.public java.util.Set<java.lang.String> getExports()
java.lang.IllegalStateException - if this instance is not connected.public java.lang.ClassLoader getClassLoader()
ClassLoader that should be shared by all
composite members.
public java.util.Set<ModuleArchive> getImported(ModuleArchive importer)
importer - The importer to filter out of the result.
public void store(Streams.Out out)
throws java.io.IOException
out - The stream.
java.io.IOException - If a failure occurs.
public boolean load(Streams.In in)
throws java.io.IOException
in - The stream.
true if result is valid, false if the data is out of sync.
java.io.IOException - If a failure occurs.protected ImportSpace mergeImports(java.util.List<? extends ModuleArchive> members)
union of the imports
of all members; subclasses may override to change this behavior.
members - The composite members.
protected java.util.Set<java.lang.String> mergeExports(java.util.List<? extends ModuleArchive> members)
members - The composite members.
protected abstract java.lang.ClassLoader createLoader(ClassSpace imports,
java.util.List<? extends ModuleArchive> members)
ClassLoader to be shared by the composite members.
imports - The merged imports.members - The composite members.
|
Qwylt | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||