[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Does ScopeKey need to maintain a sorted (in ScopeLevel.l
smarlow@redhat.com
do-not-reply at jboss.com
Tue Aug 18 12:25:51 EDT 2009
Updates to ScopeKey are here http://pastebin.com/m2fc19bab
UnmodifiableScopeKey is here http://pastebin.com/m19feda54
Perhaps we could make further MDR changes to reduce the number of times that ScopeKey.equals is called during AS startup. The above changes shouldn't break any existing API and we still pass the serialization ScopeKey unit test. If we agree on making these changes, I'll add unit tests for UnmodifiableScopeKey.
Other changes:
Index: src/main/java/org/jboss/metadata/plugins/repository/basic/BasicMetaDataRepository.java
===================================================================
--- src/main/java/org/jboss/metadata/plugins/repository/basic/BasicMetaDataRepository.java (revision 92394)
+++ src/main/java/org/jboss/metadata/plugins/repository/basic/BasicMetaDataRepository.java (working copy)
@@ -108,8 +108,9 @@
{
if (retrieval == null)
throw new IllegalArgumentException("Null retrieval");
- ScopeKey key = retrieval.getScope();
+ ScopeKey key = retrieval.getScope().getOptimizedKey();
key.freeze();
return retrievals.put(key, retrieval);
}
Index: src/main/java/org/jboss/metadata/plugins/context/AbstractMetaDataContext.java
===================================================================
--- src/main/java/org/jboss/metadata/plugins/context/AbstractMetaDataContext.java (revision 92394)
+++ src/main/java/org/jboss/metadata/plugins/context/AbstractMetaDataContext.java (working copy)
@@ -114,7 +114,8 @@
for (Scope scope : scopes)
key.addScope(scope);
}
- scopeKey = key;
+ scopeKey = key.getOptimizedKey();
}
return scopeKey;
}
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250232#4250232
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250232
More information about the jboss-dev-forums
mailing list