Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2011-05-16 12:40:08 -0400
committerChristopher Frost2011-05-16 12:40:08 -0400
commitc49e3b97c47845ef85181dc1771dedfd08c254fa (patch)
tree7a2d98b37a17dfe2fc8822625a8a3ff59d643f06 /org.eclipse.virgo.kernel.model
parent1a4dd76abce9a5dd2b5ed0817e9b73a12c561cf6 (diff)
downloadorg.eclipse.virgo.kernel-c49e3b97c47845ef85181dc1771dedfd08c254fa.tar.gz
org.eclipse.virgo.kernel-c49e3b97c47845ef85181dc1771dedfd08c254fa.tar.xz
org.eclipse.virgo.kernel-c49e3b97c47845ef85181dc1771dedfd08c254fa.zip
344672 Ensuring returned child artifacts in the model report the object name for the correct MBean
Diffstat (limited to 'org.eclipse.virgo.kernel.model')
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifact.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifact.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifact.java
index b89e32ab..aa8f6e9e 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifact.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DelegatingManageableArtifact.java
@@ -36,6 +36,10 @@ import org.eclipse.virgo.kernel.serviceability.NonNull;
*/
class DelegatingManageableArtifact implements ManageableArtifact {
+ private static final String USER_REGION_NAME = "org.eclipse.virgo.region.user";
+
+ private static final String GLOBAL_REGION_NAME = "global";
+
private final RuntimeArtifactModelObjectNameCreator artifactObjectNameCreator;
private final Artifact artifact;
@@ -133,8 +137,10 @@ class DelegatingManageableArtifact implements ManageableArtifact {
*/
protected final ObjectName[] convertToObjectNames(Set<Artifact> artifacts) {
Set<ObjectName> objectNames = new HashSet<ObjectName>(artifacts.size());
+ String regionName;
for (Artifact artifact : artifacts) {
- if(newModel){
+ regionName = artifact.getRegion().getName();
+ if(newModel || (!USER_REGION_NAME.equals(regionName) && GLOBAL_REGION_NAME.equals(regionName)) ){
objectNames.add(artifactObjectNameCreator.createArtifactModel(artifact));
} else {
objectNames.add(artifactObjectNameCreator.createModel(artifact));

Back to the top