|
Qwylt | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.module.spi.PackageConnection
public class PackageConnection
This class represents the connection between a package consumer and a ClassSpace
that will satisfy it for a specific package name.
archives added to it have already met the constraints expressed by an
Import for a given package.
Once fully populated, constraints are applied by the owning
ImportSpace, potentially reducing the set of candidates in the domain and
failing if the set reduces to zero.
Once committed, the getConnection() method can be
called to convert one or more candidates into a ClassSpace
that meets all applicable constraints, and is a suitable replacement for an
import. Normally, only one candidate will be selected, and this implementation
simply chooses the first one in the domain; however, subclasses are free to make
a different choice. For example, in the OSGi split-package case, multiple candidates
may be "merged" under a facade ClassSpace instance.
| Nested Class Summary | |
|---|---|
static class |
PackageConnection.ConnectionType
|
| Constructor Summary | |
|---|---|
PackageConnection(PackageConnection.ConnectionType type,
java.lang.String packageName,
java.util.List<? extends ModuleArchive> domain,
boolean check)
Constructs an instance. |
|
PackageConnection(PackageConnection.ConnectionType type,
java.lang.String packageName,
ModuleArchive domain)
Constructs an instance. |
|
| Method Summary | |
|---|---|
protected void |
commitDomain()
Commit the domain, ensuring that only the selected candidate(s) remain. |
boolean |
contains(ModuleArchive candidate)
Returns true if the domain contains the specified candidate. |
ClassSpace |
getClassSpace()
Returns the ClassSpace that is the endpoint of
this connection. |
protected ClassSpace |
getConnection()
Returns a ClassSpace to use for this connection. |
ModuleArchive |
getCurrentCandidate()
Returns the current domain candidate. |
java.util.List<? extends ModuleArchive> |
getDomain()
Returns the modifiable domain for this instance. |
java.lang.String |
getPackageName()
Returns the package name provided by this connection. |
PackageConnection.ConnectionType |
getType()
Returns the connection type. |
boolean |
isCommitted()
Returns true if this connection has been committed. |
boolean |
isReExported()
Returns whether or not the package should be re-exported. |
java.util.Iterator<ModuleArchive> |
iterator()
Returns an iterator over the domain. |
void |
setConnectTo(ModuleArchive candidate)
Set the candidate to which to connect. |
void |
setFirstCandidate()
Sets the domain to use the first candidate. |
boolean |
setNextCandidate()
Sets the domain to the next candidate, if any. |
java.lang.String |
toString()
Returns a string representation of this instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PackageConnection(PackageConnection.ConnectionType type,
java.lang.String packageName,
ModuleArchive domain)
type - The connection type.packageName - The package provided by the connection.domain - The candidate for the specified package.
public PackageConnection(PackageConnection.ConnectionType type,
java.lang.String packageName,
java.util.List<? extends ModuleArchive> domain,
boolean check)
type - The connection type.packageName - The package provided by the connection.domain - The set of candidates for the specified package.check - true if should validate that candidate exports package.| Method Detail |
|---|
public PackageConnection.ConnectionType getType()
public java.lang.String getPackageName()
public java.util.Iterator<ModuleArchive> iterator()
iterator in interface java.lang.Iterable<ModuleArchive>public java.util.List<? extends ModuleArchive> getDomain()
java.lang.IllegalStateException - If this connection is committed.public boolean isReExported()
true if the package should be re-exported; false otherwise.public void setFirstCandidate()
public boolean setNextCandidate()
true if there is another candidate, false otherwise.public ModuleArchive getCurrentCandidate()
public boolean isCommitted()
true if this connection has been committed.
true if this connection is shared; false
otherwise.public void setConnectTo(ModuleArchive candidate)
candidate - The archive, which must already be in this domain.
java.lang.IllegalStateException - If the archive is not already present.public boolean contains(ModuleArchive candidate)
true if the domain contains the specified candidate.
candidate - The candidate.
true if the domain contains the specified candidate;
false otherwise.public ClassSpace getClassSpace()
ClassSpace that is the endpoint of
this connection.
ClassSpace.public java.lang.String toString()
toString in class java.lang.Objectprotected void commitDomain()
protected ClassSpace getConnection()
ClassSpace to use for this connection.
This implementation returns the Module instance
from the current candidate in the domain. Subclasses may override to return
a different ClassSpace; for example, an OSGi implementation might
return a virtual class space for a split package.
ClassSpace of the first candidate.
|
Qwylt | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||