Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2010-12-16 06:40:02 -0500
committerChristopher Frost2010-12-16 06:40:02 -0500
commit892e3980a65bae61af53606aa61a8c474654f6e9 (patch)
tree15ce3f520acab906fdea8b42187de5accad2b5a5
parentc294d87b552e1c7a6219cccbff27c6cac8704f60 (diff)
downloadorg.eclipse.virgo.medic-892e3980a65bae61af53606aa61a8c474654f6e9.tar.gz
org.eclipse.virgo.medic-892e3980a65bae61af53606aa61a8c474654f6e9.tar.xz
org.eclipse.virgo.medic-892e3980a65bae61af53606aa61a8c474654f6e9.zip
328123 Removed the LogDumpContributor and all references
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/DumpContributorPublisher.java14
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/StandardDumpGenerator.java6
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java5
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/MedicActivatorTests.java2
-rw-r--r--org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/dump/test/DumpIntegrationTests.java18
5 files changed, 14 insertions, 31 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 230e28f..4584b91 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
@@ -16,14 +16,11 @@ import java.util.List;
import org.eclipse.virgo.medic.dump.DumpContributor;
import org.eclipse.virgo.medic.dump.impl.heap.HeapDumpContributor;
-import org.eclipse.virgo.medic.dump.impl.logback.LogDumpContributor;
import org.eclipse.virgo.medic.dump.impl.summary.SummaryDumpContributor;
import org.eclipse.virgo.medic.dump.impl.thread.ThreadDumpContributor;
-import org.eclipse.virgo.medic.impl.config.ConfigurationProvider;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
-
public final class DumpContributorPublisher {
private static final String SUPPRESS_HEAP_DUMPS = "org.eclipse.virgo.suppress.heap.dumps";
@@ -31,15 +28,9 @@ public final class DumpContributorPublisher {
private final List<ServiceRegistration<DumpContributor>> contributorRegistrations = new ArrayList<ServiceRegistration<DumpContributor>>();
private final BundleContext bundleContext;
-
- private final ConfigurationProvider configurationProvider;
-
- private final LogDumpContributor logDumpContributor;
- public DumpContributorPublisher(BundleContext bundleContext, ConfigurationProvider configurationProvider) {
+ public DumpContributorPublisher(BundleContext bundleContext) {
this.bundleContext = bundleContext;
- this.configurationProvider = configurationProvider;
- this.logDumpContributor = new LogDumpContributor(this.configurationProvider);
}
public void publishDumpContributors() {
@@ -48,7 +39,6 @@ public final class DumpContributorPublisher {
publishDumpContributor(new HeapDumpContributor());
}
publishDumpContributor(new ThreadDumpContributor());
- publishDumpContributor(this.logDumpContributor);
}
@SuppressWarnings("unchecked")
@@ -62,8 +52,6 @@ public final class DumpContributorPublisher {
registration.unregister();
}
- this.logDumpContributor.clear();
-
this.contributorRegistrations.clear();
}
}
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/StandardDumpGenerator.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/StandardDumpGenerator.java
index 13cbe68..91d8d5e 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/StandardDumpGenerator.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/dump/impl/StandardDumpGenerator.java
@@ -90,9 +90,8 @@ public final class StandardDumpGenerator implements DumpGenerator {
return new StandardDump(cause, timestamp, context, throwables, dumpDirectory);
}
- @SuppressWarnings("unchecked")
private List<DumpContributor> getDumpContributors(String cause) {
- Dictionary configuration = this.configurationProvider.getConfiguration();
+ Dictionary<?, ?> configuration = this.configurationProvider.getConfiguration();
String excludedContributorsProperty = (String) configuration.get("dump.exclusions." + cause);
List<String> excludedContributors = toList(excludedContributorsProperty);
excludedContributorsProperty = (String) configuration.get("dump.exclusions.*");
@@ -153,9 +152,8 @@ public final class StandardDumpGenerator implements DumpGenerator {
return dumpDirectory;
}
- @SuppressWarnings("unchecked")
private String getRootDumpDirectory() {
- Dictionary configuration = this.configurationProvider.getConfiguration();
+ Dictionary<?, ?> configuration = this.configurationProvider.getConfiguration();
return (String) configuration.get(ConfigurationProvider.KEY_DUMP_ROOT_DIRECTORY);
}
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
index 81ae897..3249227 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
@@ -115,11 +115,10 @@ public final class MedicActivator implements BundleActivator {
private void dumpStart(BundleContext context, ConfigurationProvider configurationProvider) {
- this.dumpGenerator = new StandardDumpGenerator(new StandardDumpContributorResolver(context), configurationProvider,
- this.eventLoggerFactory.createEventLogger(context.getBundle()));
+ this.dumpGenerator = new StandardDumpGenerator(new StandardDumpContributorResolver(context), configurationProvider, this.eventLoggerFactory.createEventLogger(context.getBundle()));
this.registrationTracker.track(context.registerService(DumpGenerator.class.getName(), this.dumpGenerator, null));
- this.dumpContributorPublisher = new DumpContributorPublisher(context, configurationProvider);
+ this.dumpContributorPublisher = new DumpContributorPublisher(context);
this.dumpContributorPublisher.publishDumpContributors();
}
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 0ce052b..66b644e 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
@@ -55,7 +55,7 @@ public class MedicActivatorTests {
bundleActivator.start(bundleContext);
assertServiceListenerCount(bundleContext, 1);
assertServiceRegistrationCount(bundleContext, DumpGenerator.class, 1);
- assertServiceRegistrationCount(bundleContext, DumpContributor.class, 4);
+ assertServiceRegistrationCount(bundleContext, DumpContributor.class, 3);
assertServiceRegistrationCount(bundleContext, EventLoggerFactory.class, 1);
assertServiceRegistrationCount(bundleContext, EventLogger.class, 1);
assertServiceRegistrationCount(bundleContext, LoggingConfigurationPublisher.class, 1);
diff --git a/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/dump/test/DumpIntegrationTests.java b/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/dump/test/DumpIntegrationTests.java
index 5b84fd2..37c195c 100644
--- a/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/dump/test/DumpIntegrationTests.java
+++ b/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/dump/test/DumpIntegrationTests.java
@@ -70,19 +70,18 @@ public class DumpIntegrationTests {
}
@Test
- @SuppressWarnings("unchecked")
public void dumpDirectoryConfiguration() throws IOException, InterruptedException {
Configuration configuration = getConfiguration("org.eclipse.virgo.medic");
assertNotNull(configuration);
- Dictionary properties = new Hashtable<String, String>();
+ Dictionary<String, String> properties = new Hashtable<String, String>();
properties.put("dump.root.directory", "target/dumps/1");
configuration.update(properties);
Thread.sleep(2000);
- ServiceReference serviceReference = this.bundleContext.getServiceReference(DumpGenerator.class.getName());
+ ServiceReference<?> serviceReference = this.bundleContext.getServiceReference(DumpGenerator.class.getName());
DumpGenerator dumpGenerator = (DumpGenerator)this.bundleContext.getService(serviceReference);
dumpGenerator.generateDump("bleurgh");
@@ -115,12 +114,11 @@ public class DumpIntegrationTests {
}
@Test
- @SuppressWarnings("unchecked")
public void exclusionConfiguration() throws IOException, InterruptedException {
Configuration configuration = getConfiguration("org.eclipse.virgo.medic");
assertNotNull(configuration);
- Dictionary properties = new Hashtable<String, String>();
+ Dictionary<String, String> properties = new Hashtable<String, String>();
properties.put("dump.root.directory", "target/dumps/1");
properties.put("dump.exclusions.bleurgh", "heap");
@@ -128,7 +126,7 @@ public class DumpIntegrationTests {
Thread.sleep(2000);
- ServiceReference serviceReference = this.bundleContext.getServiceReference(DumpGenerator.class.getName());
+ ServiceReference<?> serviceReference = this.bundleContext.getServiceReference(DumpGenerator.class.getName());
DumpGenerator dumpGenerator = (DumpGenerator)this.bundleContext.getService(serviceReference);
dumpGenerator.generateDump("bleurgh");
@@ -142,8 +140,8 @@ public class DumpIntegrationTests {
}
- @SuppressWarnings("unchecked")
@Test
+ @SuppressWarnings("unchecked")
public void logDumpEnabled() throws IOException, InterruptedException {
Configuration configuration = getConfiguration("org.eclipse.virgo.medic");
assertNotNull(configuration);
@@ -167,9 +165,9 @@ public class DumpIntegrationTests {
assertNotNull(file.list());
assertEquals(1, file.list().length);
- assertDumpContributionsNumberOf(file.listFiles()[0], 4);
- assertDumpContributionsEssential(file.listFiles()[0], "summary.txt", "thread.txt", "log.log");
- assertDumpContributionsAllowable(file.listFiles()[0], "heap.out", "heap.err", "summary.txt", "thread.txt", "log.log");
+ assertDumpContributionsNumberOf(file.listFiles()[0], 3);
+ assertDumpContributionsEssential(file.listFiles()[0], "summary.txt", "thread.txt");
+ assertDumpContributionsAllowable(file.listFiles()[0], "heap.out", "heap.err", "summary.txt", "thread.txt");
}
private Configuration getConfiguration(String pid) throws IOException {

Back to the top