Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHristo Iliev2011-05-11 10:00:03 -0400
committerHristo Iliev2011-05-11 10:00:03 -0400
commit6931054248ac7d70e6dad3c2710e00c91fe781c2 (patch)
tree0b113f91a2e727c16a43724cccc2bf0828c6a303 /org.eclipse.virgo.kernel.model
parent331673bae173c07d938a423ce8febb631652688e (diff)
downloadorg.eclipse.virgo.kernel-6931054248ac7d70e6dad3c2710e00c91fe781c2.tar.gz
org.eclipse.virgo.kernel-6931054248ac7d70e6dad3c2710e00c91fe781c2.tar.xz
org.eclipse.virgo.kernel-6931054248ac7d70e6dad3c2710e00c91fe781c2.zip
bug 344660: Runtime model mBeans for kernel are unregistered
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/RuntimeArtifactModelObjectNameCreator.java12
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DefaultRuntimeArtifactModelObjectNameCreator.java9
-rw-r--r--org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/JmxArtifactRepositoryListener.java2
3 files changed, 20 insertions, 3 deletions
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/RuntimeArtifactModelObjectNameCreator.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/RuntimeArtifactModelObjectNameCreator.java
index 19358ecd..5ef83b1a 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/RuntimeArtifactModelObjectNameCreator.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/RuntimeArtifactModelObjectNameCreator.java
@@ -60,14 +60,22 @@ public interface RuntimeArtifactModelObjectNameCreator {
ObjectName create(String type, String name, Version version, Region region);
/**
- * Creates a query {@link ObjectName} that can be used to enumerate all of the artifacts in the runtime artifact
- * model
+ * Creates a query {@link ObjectName} that can be used to enumerate all of the user region artifacts in the runtime
+ * artifact model
*
* @return An {@link ObjectName} that can be used for querying
*/
ObjectName createArtifactsQuery();
/**
+ * Creates a query {@link ObjectName} that can be used to enumerate all of the artifacts in the runtime artifact models
+ * for both user and kernel regions
+ *
+ * @return An {@link ObjectName} that can be used for querying
+ */
+ ObjectName createAllArtifactsQuery();
+
+ /**
* Creates a query {@link ObjectName} that can be used to enumerate all of the artifacts of a given type in the
* runtime artifact model
*
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DefaultRuntimeArtifactModelObjectNameCreator.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DefaultRuntimeArtifactModelObjectNameCreator.java
index e3105e05..49ff319e 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DefaultRuntimeArtifactModelObjectNameCreator.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/DefaultRuntimeArtifactModelObjectNameCreator.java
@@ -37,6 +37,8 @@ public final class DefaultRuntimeArtifactModelObjectNameCreator implements Runti
private static final String ARTIFACTS_FORMAT = "%s:type=Model,*";
+ private static final String ALL_ARTIFACTS_FORMAT = "%s:type=*Model,*";
+
private static final String ARTIFACTS_OF_TYPE_FORMAT = "%s:type=Model,artifact-type=%s,*";
private static final String ARTIFACTS_OF_TYPE_AND_NAME_FORMAT = "%s:type=Model,artifact-type=%s,name=%s,*";
@@ -108,6 +110,13 @@ public final class DefaultRuntimeArtifactModelObjectNameCreator implements Runti
/**
* {@inheritDoc}
*/
+ public ObjectName createAllArtifactsQuery() {
+ return createObjectName(String.format(ALL_ARTIFACTS_FORMAT, this.domain));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public String getType(ObjectName objectName) {
return objectName.getKeyProperty(KEY_TYPE);
}
diff --git a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/JmxArtifactRepositoryListener.java b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/JmxArtifactRepositoryListener.java
index 5765a3c7..8ad46e48 100644
--- a/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/JmxArtifactRepositoryListener.java
+++ b/org.eclipse.virgo.kernel.model/src/main/java/org/eclipse/virgo/kernel/model/management/internal/JmxArtifactRepositoryListener.java
@@ -94,7 +94,7 @@ public class JmxArtifactRepositoryListener implements ArtifactRepositoryListener
}
public void destroy() {
- Set<ObjectName> objectNames = this.server.queryNames(this.artifactObjectNameCreator.createArtifactsQuery(), null);
+ Set<ObjectName> objectNames = this.server.queryNames(this.artifactObjectNameCreator.createAllArtifactsQuery(), null);
for (ObjectName objectName : objectNames) {
try {
this.server.unregisterMBean(objectName);

Back to the top