|
JBoss MetaData Repository 2.2.0.SP1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.metadata.spi.scope.ScopeKey
public class ScopeKey
The ScopeKey represents a path which is made up of the path entries. Elements may be added dynamically until the ScopeKey is frozen. If you want to add more elements to a frozen ScopeKey, clone it (cloned objects are not frozen). To use the ScopeKey as a key object, use the UnmodifiableScopeKey returned from getOptimizedKey(). UnmodifiableScopeKey's are immutable and suitable for use as a key (also thread-safe with no object lock contention). The ScopeKey (Server=Bob,Deployment=Foo.war,Class=Bar) is the child of (Server=Bob,Deployment=Foo.war), which is the child of (Server=Bob). Think about this statement in terms of a path relationship. The server (Bob) contains a deployment (Foo.war) and the deployment contains a class (Bar). See historical design notes http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3972233#3972233 http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4013747#4013747 Thread Safety: This class is thread safe. Warning: This class is (delicately) extended by UnmodifiableScopeKey. Since there is no common interface class between the two classes, there are risks to be aware of. If a new method is added to ScopeKey and not to UnmodifiableScopeKey, undesireable behavior will occur when that UnmodifiableScopeKey.method is invoked (ScopeKey's member variables will be null).
Field Summary | |
---|---|
static ScopeKey |
DEFAULT_SCOPE
The default scope |
Constructor Summary | |
---|---|
ScopeKey()
Create a new ScopeKey. |
|
ScopeKey(Collection<Scope> scopes)
Create a new ScopeKey. |
|
ScopeKey(Scope scope)
Create a new ScopeKey. |
|
ScopeKey(Scope[] scopes)
Create a new ScopeKey. |
|
ScopeKey(ScopeLevel level,
Object qualifier)
Create a new ScopeKey. |
Method Summary | |
---|---|
Scope |
addScope(Scope scope)
Add a scope |
Scope |
addScope(ScopeLevel level,
Object qualifier)
Add a scope |
ScopeKey |
clone()
Clone a ScopeKey instance. |
protected static int |
computeHashCode(Iterable<Scope> scopeCollection)
|
protected static int |
computeHashCode(Scope[] scopeArray)
|
boolean |
equals(Object object)
|
void |
freeze()
Set to frozen. |
protected Scope[] |
getArray()
|
ScopeLevel |
getMaxScopeLevel()
Get the maximum scope level |
ScopeKey |
getOptimizedKey()
The returned ScopeKey is immutable and optimized for use at runtime. |
ScopeKey |
getParent()
Get the parent scope key |
Scope |
getScope(ScopeLevel level)
Get a scope |
Scope |
getScopeLevel(ScopeLevel scopeLevel)
Get a scope level |
Collection<Scope> |
getScopes()
Get the scopes |
protected Collection<Scope> |
getScopesCollection()
|
int |
hashCode()
|
boolean |
isFrozen()
Get the frozen. |
boolean |
isParent(ScopeKey key)
Is this parent of key parameter. |
Scope |
removeScope(Scope scope)
Remove a scope |
Scope |
removeScopeLevel(ScopeLevel scopeLevel)
Remove a scope level |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ScopeKey DEFAULT_SCOPE
Constructor Detail |
---|
public ScopeKey()
public ScopeKey(Scope scope)
scope
- the scopepublic ScopeKey(ScopeLevel level, Object qualifier)
level
- the scope levelqualifier
- the scope qualifierpublic ScopeKey(Collection<Scope> scopes)
scopes
- is a collection of Scope instances that make up the represented path
IllegalArgumentException
- if parameter scopes is nullpublic ScopeKey(Scope[] scopes)
scopes
- is zero or more Scope instances that make up the represented path
IllegalArgumentException
- if parameter scopes is nullMethod Detail |
---|
public boolean isFrozen()
public void freeze()
IllegalArgumentException
- if there are no Scope entries added.public ScopeKey getOptimizedKey()
public Collection<Scope> getScopes()
public Scope getScope(ScopeLevel level)
level
- the scope level
IllegalArgumentException
- if level is null.public ScopeLevel getMaxScopeLevel()
public ScopeKey getParent()
public boolean isParent(ScopeKey key)
key
- the key parameter
IllegalArgumentException
- if parameter key is nullpublic Scope addScope(Scope scope)
scope
- the scope
IllegalArgumentException
- if scope is null.
IllegalStateException
- if frozenpublic Scope addScope(ScopeLevel level, Object qualifier)
level
- the scope levelqualifier
- the scope qualifier
public Scope removeScope(Scope scope)
scope
- the scope
public Scope getScopeLevel(ScopeLevel scopeLevel)
scopeLevel
- the scope level
IllegalArgumentException
- if parameter key is nullpublic Scope removeScopeLevel(ScopeLevel scopeLevel)
scopeLevel
- the scope level
public String toString()
toString
in class Object
public boolean equals(Object object)
equals
in class Object
public int hashCode()
hashCode
in class Object
public ScopeKey clone()
clone
in class Object
protected Scope[] getArray()
protected Collection<Scope> getScopesCollection()
protected static int computeHashCode(Scope[] scopeArray)
protected static int computeHashCode(Iterable<Scope> scopeCollection)
|
JBoss MetaData Repository 2.2.0.SP1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |