Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2010-08-20 12:01:22 +0000
committerChristopher Frost2010-08-20 12:01:22 +0000
commit7473e5e21d06e5271c054039f44fdb481711dccc (patch)
tree0abe5e3c4be3a964ece8ad0e93c4902e790dd498
parent00dd34dd0262d8128946da6ecec2e277e8799ee0 (diff)
downloadorg.eclipse.virgo.medic-7473e5e21d06e5271c054039f44fdb481711dccc.tar.gz
org.eclipse.virgo.medic-7473e5e21d06e5271c054039f44fdb481711dccc.tar.xz
org.eclipse.virgo.medic-7473e5e21d06e5271c054039f44fdb481711dccc.zip
[DMS-2717] heap dump contributor will only be contributed if the framework property is set to false
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorPublisher.java6
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java1
-rw-r--r--org.eclipse.virgo.medic.integrationtest/src/test/resources/META-INF/test.config.properties2
3 files changed, 8 insertions, 1 deletions
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorPublisher.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorPublisher.java
index 1ab4254..b8194ef 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorPublisher.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorPublisher.java
@@ -26,6 +26,8 @@ import org.osgi.framework.ServiceRegistration;
public final class DumpContributorPublisher {
+ private static final String SUPPRESS_HEAP_DUMPS = "org.eclipse.virgo.suppress.heap.dumps";
+
private final List<ServiceRegistration> contributorRegistrations = new ArrayList<ServiceRegistration>();
private final BundleContext bundleContext;
@@ -42,7 +44,9 @@ public final class DumpContributorPublisher {
public void publishDumpContributors() {
publishDumpContributor(new SummaryDumpContributor());
- publishDumpContributor(new HeapDumpContributor());
+ if("false".equalsIgnoreCase(this.bundleContext.getProperty(SUPPRESS_HEAP_DUMPS))){
+ publishDumpContributor(new HeapDumpContributor());
+ }
publishDumpContributor(new ThreadDumpContributor());
publishDumpContributor(this.logDumpContributor);
}
diff --git a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java
index 0711ef8..0ecec87 100644
--- a/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java
+++ b/org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java
@@ -44,6 +44,7 @@ public class MedicActivatorTests {
public void startAndStop() throws Exception {
BundleActivator bundleActivator = new MedicActivator();
StubBundleContext bundleContext = new StubBundleContext().addFilter(new ObjectClassFilter(DumpContributor.class));
+ bundleContext.addProperty("org.eclipse.virgo.suppress.heap.dumps", "false");
PackageAdmin packageAdmin = createNiceMock(PackageAdmin.class);
replay(packageAdmin);
diff --git a/org.eclipse.virgo.medic.integrationtest/src/test/resources/META-INF/test.config.properties b/org.eclipse.virgo.medic.integrationtest/src/test/resources/META-INF/test.config.properties
index ac5988c..d225755 100644
--- a/org.eclipse.virgo.medic.integrationtest/src/test/resources/META-INF/test.config.properties
+++ b/org.eclipse.virgo.medic.integrationtest/src/test/resources/META-INF/test.config.properties
@@ -10,6 +10,8 @@ file:../org.eclipse.virgo.medic.core/target/artifacts/org.eclipse.virgo.medic.co
file:src/test/resources/config-fragment,\
file:src/test/resources/appender-fragment
+org.eclipse.virgo.suppress.heap.dumps=false
+
osgi.java.profile.bootdelegation=override
osgi.parentClassloader=fwk
osgi.context.bootdelegation=false

Back to the top