Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.virgo.kernel.core/.classpath1
-rw-r--r--org.eclipse.virgo.kernel.core/ivy.xml1
-rw-r--r--org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/core/internal/CoreBundleActivator.java10
-rw-r--r--org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/RegionDigraphDumpContributor.java (renamed from org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/RegionDigraphDumpContributor.java)2
-rw-r--r--org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/ResolutionDumpContributor.java (renamed from org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/ResolutionDumpContributor.java)7
-rw-r--r--org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/ResolutionStateDumper.java (renamed from org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/ResolutionStateDumper.java)2
-rw-r--r--org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/StandardStateWriter.java (renamed from org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/StandardStateWriter.java)2
-rw-r--r--org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/StandardSystemStateAccessor.java (renamed from org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/StandardSystemStateAccessor.java)2
-rw-r--r--org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/StateWriter.java (renamed from org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/StateWriter.java)2
-rw-r--r--org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/SystemStateAccessor.java (renamed from org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/SystemStateAccessor.java)2
-rw-r--r--org.eclipse.virgo.kernel.core/src/test/java/org/eclipse/virgo/kernel/core/internal/CoreBundleActivatorTests.java11
-rw-r--r--org.eclipse.virgo.kernel.core/src/test/java/org/eclipse/virgo/kernel/serviceability/dump/internal/ResolutionStateDumperTests.java (renamed from org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/equinox/ResolutionStateDumperTests.java)8
-rw-r--r--org.eclipse.virgo.kernel.core/template.mf1
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/Activator.java17
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/ServiceScopingRegistryHook.java5
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/DependencyCalculator.java6
-rw-r--r--org.eclipse.virgo.kernel.userregionfactory/src/main/java/org/eclipse/virgo/kernel/userregionfactory/Activator.java5
17 files changed, 39 insertions, 45 deletions
diff --git a/org.eclipse.virgo.kernel.core/.classpath b/org.eclipse.virgo.kernel.core/.classpath
index 1c1f7554..b1642620 100644
--- a/org.eclipse.virgo.kernel.core/.classpath
+++ b/org.eclipse.virgo.kernel.core/.classpath
@@ -46,5 +46,6 @@
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.springframework.osgi/org.springframework.osgi.core/1.2.1/org.springframework.osgi.core-1.2.1.jar" sourcepath="/KERNEL_IVY_CACHE/org.springframework.osgi/org.springframework.osgi.core/1.2.1/org.springframework.osgi.core-sources-1.2.1.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.apache.commons/com.springsource.org.apache.commons.logging/1.1.1/com.springsource.org.apache.commons.logging-1.1.1.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.osgi/org.eclipse.equinox.event/1.2.100.v20110110/org.eclipse.equinox.event-1.2.100.v20110110.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.osgi/org.eclipse.equinox.region/1.0.0.v20110503/org.eclipse.equinox.region-1.0.0.v20110503.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
diff --git a/org.eclipse.virgo.kernel.core/ivy.xml b/org.eclipse.virgo.kernel.core/ivy.xml
index c828c5fd..b1c84c3e 100644
--- a/org.eclipse.virgo.kernel.core/ivy.xml
+++ b/org.eclipse.virgo.kernel.core/ivy.xml
@@ -22,6 +22,7 @@
<dependency org="org.eclipse.osgi" name="org.eclipse.osgi.services" rev="${org.eclipse.osgi.services}" conf="compile->runtime"/>
<dependency org="org.eclipse.osgi" name="org.eclipse.equinox.cm" rev="${org.eclipse.equinox.cm}" conf="compile->runtime"/>
<dependency org="org.eclipse.osgi" name="org.eclipse.equinox.event" rev="${org.eclipse.equinox.event}" conf="compile->runtime"/>
+ <dependency org="org.eclipse.osgi" name="org.eclipse.equinox.region" rev="${org.eclipse.equinox.region}" conf="compile->compile"/>
<dependency name='org.eclipse.virgo.util.io' rev='${org.eclipse.virgo.util}' org='org.eclipse.virgo.util' conf='compile->compile'/>
<dependency name='org.eclipse.virgo.util.jmx' rev='${org.eclipse.virgo.util}' org='org.eclipse.virgo.util' conf='aspects->runtime'/>
diff --git a/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/core/internal/CoreBundleActivator.java b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/core/internal/CoreBundleActivator.java
index e4503438..833ee2b8 100644
--- a/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/core/internal/CoreBundleActivator.java
+++ b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/core/internal/CoreBundleActivator.java
@@ -31,10 +31,13 @@ import org.eclipse.virgo.kernel.config.internal.KernelConfiguration;
import org.eclipse.virgo.kernel.core.BundleStarter;
import org.eclipse.virgo.kernel.core.Shutdown;
import org.eclipse.virgo.kernel.core.internal.blueprint.ApplicationContextDependencyMonitor;
+import org.eclipse.virgo.kernel.serviceability.dump.internal.RegionDigraphDumpContributor;
+import org.eclipse.virgo.kernel.serviceability.dump.internal.ResolutionDumpContributor;
import org.eclipse.virgo.kernel.shim.scope.ScopeFactory;
import org.eclipse.virgo.kernel.shim.scope.internal.StandardScopeFactory;
import org.eclipse.virgo.kernel.shim.serviceability.TracingService;
import org.eclipse.virgo.kernel.shim.serviceability.internal.Slf4jTracingService;
+import org.eclipse.virgo.medic.dump.DumpContributor;
import org.eclipse.virgo.medic.dump.DumpGenerator;
import org.eclipse.virgo.medic.eventlog.EventLogger;
import org.eclipse.virgo.util.osgi.ServiceRegistrationTracker;
@@ -96,12 +99,19 @@ public class CoreBundleActivator {
DumpGenerator dumpGenerator = getRequiredService(context, DumpGenerator.class);
+ createAndRegisterStateDumpContributors(context);
+
this.startupTracker = new StartupTracker(context, configuration, configuration.getStartupWaitLimit(), bundleStartTracker, shutdown, dumpGenerator);
this.startupTracker.start();
initShimServices(context, eventLogger);
}
+ private void createAndRegisterStateDumpContributors(BundleContext context) {
+ this.tracker.track(context.registerService(DumpContributor.class, new ResolutionDumpContributor(context), null));
+ this.tracker.track(context.registerService(DumpContributor.class, new RegionDigraphDumpContributor(context), null));
+ }
+
private ApplicationContextDependencyMonitor createAndRegisterApplicationContextDependencyMonitor(BundleContext context, EventLogger eventLogger) {
ScheduledExecutorService scheduledExecutor = Executors.newScheduledThreadPool(1, new ThreadFactory() {
private AtomicLong threadCount = new AtomicLong(1);
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/RegionDigraphDumpContributor.java b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/RegionDigraphDumpContributor.java
index 0fbf2b88..ec5f1179 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/RegionDigraphDumpContributor.java
+++ b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/RegionDigraphDumpContributor.java
@@ -9,7 +9,7 @@
* VMware Inc. - initial contribution
*******************************************************************************/
-package org.eclipse.virgo.kernel.userregion.internal.equinox;
+package org.eclipse.virgo.kernel.serviceability.dump.internal;
import java.io.File;
import java.io.FileOutputStream;
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/ResolutionDumpContributor.java b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/ResolutionDumpContributor.java
index 84a9270b..5ddf5b8a 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/ResolutionDumpContributor.java
+++ b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/ResolutionDumpContributor.java
@@ -9,7 +9,7 @@
* VMware Inc. - initial contribution
*******************************************************************************/
-package org.eclipse.virgo.kernel.userregion.internal.equinox;
+package org.eclipse.virgo.kernel.serviceability.dump.internal;
import java.io.File;
@@ -17,7 +17,6 @@ import org.eclipse.osgi.service.resolver.PlatformAdmin;
import org.eclipse.osgi.service.resolver.State;
import org.osgi.framework.BundleContext;
-import org.eclipse.virgo.kernel.osgi.framework.OsgiFrameworkUtils;
import org.eclipse.virgo.medic.dump.Dump;
import org.eclipse.virgo.medic.dump.DumpContributionFailedException;
import org.eclipse.virgo.medic.dump.DumpContributor;
@@ -33,12 +32,14 @@ import org.eclipse.virgo.medic.dump.DumpContributor;
*/
public class ResolutionDumpContributor implements DumpContributor {
+ // The following literal must match DependencyCalculator.RESOLUTION_STATE_KEY in the kernel userregion bundle.
public final static String RESOLUTION_STATE_KEY = "resolution.state";
private final ResolutionStateDumper resolutionStateDumper;
public ResolutionDumpContributor(BundleContext bundleContext) {
- PlatformAdmin platformAdmin = OsgiFrameworkUtils.getService(bundleContext, PlatformAdmin.class).getService();
+ PlatformAdmin platformAdmin = bundleContext.getService(bundleContext.getServiceReference(PlatformAdmin.class));
+ //OsgiFrameworkUtils.getService(bundleContext, PlatformAdmin.class).getService();
this.resolutionStateDumper = new ResolutionStateDumper(new StandardSystemStateAccessor(platformAdmin), new StandardStateWriter(platformAdmin.getFactory()));
}
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/ResolutionStateDumper.java b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/ResolutionStateDumper.java
index afdb4308..e52e303e 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/ResolutionStateDumper.java
+++ b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/ResolutionStateDumper.java
@@ -9,7 +9,7 @@
* VMware Inc. - initial contribution
*******************************************************************************/
-package org.eclipse.virgo.kernel.userregion.internal.equinox;
+package org.eclipse.virgo.kernel.serviceability.dump.internal;
import java.io.File;
import java.io.IOException;
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/StandardStateWriter.java b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/StandardStateWriter.java
index fb6148a0..221b07c8 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/StandardStateWriter.java
+++ b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/StandardStateWriter.java
@@ -9,7 +9,7 @@
* VMware Inc. - initial contribution
*******************************************************************************/
-package org.eclipse.virgo.kernel.userregion.internal.equinox;
+package org.eclipse.virgo.kernel.serviceability.dump.internal;
import java.io.File;
import java.io.IOException;
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/StandardSystemStateAccessor.java b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/StandardSystemStateAccessor.java
index 0b2740fa..9522640d 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/StandardSystemStateAccessor.java
+++ b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/StandardSystemStateAccessor.java
@@ -9,7 +9,7 @@
* VMware Inc. - initial contribution
*******************************************************************************/
-package org.eclipse.virgo.kernel.userregion.internal.equinox;
+package org.eclipse.virgo.kernel.serviceability.dump.internal;
import org.eclipse.osgi.internal.baseadaptor.StateManager;
import org.eclipse.osgi.service.resolver.PlatformAdmin;
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/StateWriter.java b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/StateWriter.java
index c0aa3a42..3f5502bc 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/StateWriter.java
+++ b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/StateWriter.java
@@ -9,7 +9,7 @@
* VMware Inc. - initial contribution
*******************************************************************************/
-package org.eclipse.virgo.kernel.userregion.internal.equinox;
+package org.eclipse.virgo.kernel.serviceability.dump.internal;
import java.io.File;
import java.io.IOException;
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/SystemStateAccessor.java b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/SystemStateAccessor.java
index 6f957f66..48209ad1 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/equinox/SystemStateAccessor.java
+++ b/org.eclipse.virgo.kernel.core/src/main/java/org/eclipse/virgo/kernel/serviceability/dump/internal/SystemStateAccessor.java
@@ -9,7 +9,7 @@
* VMware Inc. - initial contribution
*******************************************************************************/
-package org.eclipse.virgo.kernel.userregion.internal.equinox;
+package org.eclipse.virgo.kernel.serviceability.dump.internal;
import org.eclipse.osgi.service.resolver.State;
diff --git a/org.eclipse.virgo.kernel.core/src/test/java/org/eclipse/virgo/kernel/core/internal/CoreBundleActivatorTests.java b/org.eclipse.virgo.kernel.core/src/test/java/org/eclipse/virgo/kernel/core/internal/CoreBundleActivatorTests.java
index c3cbe70a..20e351da 100644
--- a/org.eclipse.virgo.kernel.core/src/test/java/org/eclipse/virgo/kernel/core/internal/CoreBundleActivatorTests.java
+++ b/org.eclipse.virgo.kernel.core/src/test/java/org/eclipse/virgo/kernel/core/internal/CoreBundleActivatorTests.java
@@ -22,6 +22,7 @@ import org.osgi.service.cm.ConfigurationAdmin;
import org.osgi.service.event.EventAdmin;
+import org.eclipse.osgi.service.resolver.PlatformAdmin;
import org.eclipse.virgo.kernel.StubConfigurationAdmin;
import org.eclipse.virgo.kernel.core.Shutdown;
import org.eclipse.virgo.kernel.core.internal.CoreBundleActivator;
@@ -53,11 +54,13 @@ public class CoreBundleActivatorTests {
StubBundleContext bundleContext = new StubBundleContext();
StubComponentContext componentContext = new StubComponentContext(bundleContext);
DumpGenerator dumpGenerator = createNiceMock(DumpGenerator.class);
+ PlatformAdmin platformAdmin = createNiceMock(PlatformAdmin.class);
bundleContext.addFilter(StartupTracker.APPLICATION_CONTEXT_FILTER, FrameworkUtil.createFilter(StartupTracker.APPLICATION_CONTEXT_FILTER));
- bundleContext.registerService(ConfigurationAdmin.class.getName(), new StubConfigurationAdmin(), null);
- bundleContext.registerService(EventLogger.class.getName(), new MockEventLogger(), null);
- bundleContext.registerService(EventAdmin.class.getName(), new StubEventAdmin(), null);
- bundleContext.registerService(DumpGenerator.class.getName(), dumpGenerator, null);
+ bundleContext.registerService(ConfigurationAdmin.class, new StubConfigurationAdmin(), null);
+ bundleContext.registerService(EventLogger.class, new MockEventLogger(), null);
+ bundleContext.registerService(EventAdmin.class, new StubEventAdmin(), null);
+ bundleContext.registerService(DumpGenerator.class, dumpGenerator, null);
+ bundleContext.registerService(PlatformAdmin.class, platformAdmin, null);
bundleContext.addProperty("org.eclipse.virgo.kernel.domain", "test");
bundleContext.addProperty("org.eclipse.virgo.kernel.home", new File(".").getAbsolutePath());
diff --git a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/equinox/ResolutionStateDumperTests.java b/org.eclipse.virgo.kernel.core/src/test/java/org/eclipse/virgo/kernel/serviceability/dump/internal/ResolutionStateDumperTests.java
index 7e801cd8..fc94b28d 100644
--- a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/equinox/ResolutionStateDumperTests.java
+++ b/org.eclipse.virgo.kernel.core/src/test/java/org/eclipse/virgo/kernel/serviceability/dump/internal/ResolutionStateDumperTests.java
@@ -9,7 +9,7 @@
* VMware Inc. - initial contribution
*******************************************************************************/
-package org.eclipse.virgo.kernel.userregion.internal.equinox;
+package org.eclipse.virgo.kernel.serviceability.dump.internal;
import static org.easymock.EasyMock.createNiceMock;
import static org.junit.Assert.assertArrayEquals;
@@ -24,13 +24,9 @@ import java.util.HashMap;
import java.util.Map;
import org.eclipse.osgi.service.resolver.State;
-import org.junit.Test;
-
-import org.eclipse.virgo.kernel.userregion.internal.equinox.ResolutionStateDumper;
-import org.eclipse.virgo.kernel.userregion.internal.equinox.StateWriter;
-import org.eclipse.virgo.kernel.userregion.internal.equinox.SystemStateAccessor;
import org.eclipse.virgo.util.io.PathReference;
import org.eclipse.virgo.util.io.ZipUtils;
+import org.junit.Test;
/**
*/
diff --git a/org.eclipse.virgo.kernel.core/template.mf b/org.eclipse.virgo.kernel.core/template.mf
index 8681c79d..19b968f6 100644
--- a/org.eclipse.virgo.kernel.core/template.mf
+++ b/org.eclipse.virgo.kernel.core/template.mf
@@ -15,6 +15,7 @@ Import-Template:
org.springframework.*;version="${org.springframework:[2.5.6, =.+1)}",
org.springframework.osgi.*;version="${org.springframework.osgi:[=.=.=, +1)}",
org.eclipse.osgi.*;version="0",
+ org.eclipse.equinox.region.*;version="${org.eclipse.equinox.region:[=.=.=, =.+1)}",
org.w3c.dom;version="0",
org.xml.sax;version="0"
Excluded-Exports:
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/Activator.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/Activator.java
index 280707cf..78691465 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/Activator.java
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/Activator.java
@@ -37,15 +37,12 @@ import org.eclipse.virgo.kernel.shim.scope.ScopeFactory;
import org.eclipse.virgo.kernel.userregion.internal.dump.StandardDumpExtractor;
import org.eclipse.virgo.kernel.userregion.internal.equinox.EquinoxHookRegistrar;
import org.eclipse.virgo.kernel.userregion.internal.equinox.EquinoxOsgiFramework;
-import org.eclipse.virgo.kernel.userregion.internal.equinox.RegionDigraphDumpContributor;
-import org.eclipse.virgo.kernel.userregion.internal.equinox.ResolutionDumpContributor;
import org.eclipse.virgo.kernel.userregion.internal.equinox.StandardPackageAdminUtil;
import org.eclipse.virgo.kernel.userregion.internal.equinox.TransformedManifestProvidingBundleFileWrapper;
import org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler;
import org.eclipse.virgo.kernel.userregion.internal.quasi.ResolutionFailureDetective;
import org.eclipse.virgo.kernel.userregion.internal.quasi.StandardQuasiFrameworkFactory;
import org.eclipse.virgo.kernel.userregion.internal.quasi.StandardResolutionFailureDetective;
-import org.eclipse.virgo.medic.dump.DumpContributor;
import org.eclipse.virgo.medic.eventlog.EventLogger;
import org.eclipse.virgo.medic.eventlog.EventLoggerFactory;
import org.eclipse.virgo.osgi.extensions.equinox.hooks.MetaInfResourceClassLoaderDelegateHook;
@@ -110,12 +107,6 @@ public class Activator implements BundleActivator {
OsgiFramework osgiFramework = createOsgiFramework(context, packageAdmin, bundleTransformerHandler);
this.registrationTracker.track(context.registerService(OsgiFramework.class.getName(), osgiFramework, null));
- DumpContributor resolutionDumpContributor = createResolutionDumpContributor(context);
- this.registrationTracker.track(context.registerService(DumpContributor.class.getName(), resolutionDumpContributor, null));
-
- DumpContributor regionDigraphDumpContributor = createRegionDigraphDumpContributor(context);
- this.registrationTracker.track(context.registerService(DumpContributor.class.getName(), regionDigraphDumpContributor, null));
-
DumpExtractor dumpExtractor = new StandardDumpExtractor(workArea);
QuasiFrameworkFactory quasiFrameworkFactory = createQuasiFrameworkFactory(context, rfd, repository, bundleTransformerHandler, regionDigraph, dumpExtractor);
this.registrationTracker.track(context.registerService(QuasiFrameworkFactory.class.getName(), quasiFrameworkFactory, null));
@@ -145,14 +136,6 @@ public class Activator implements BundleActivator {
TransformedManifestProvidingBundleFileWrapper bundleTransformerHandler) {
return new EquinoxOsgiFramework(context, packageAdmin, bundleTransformerHandler);
}
-
- private DumpContributor createResolutionDumpContributor(BundleContext bundleContext) {
- return new ResolutionDumpContributor(bundleContext);
- }
-
- private DumpContributor createRegionDigraphDumpContributor(BundleContext bundleContext) {
- return new RegionDigraphDumpContributor(bundleContext);
- }
private QuasiFrameworkFactory createQuasiFrameworkFactory(BundleContext bundleContext, ResolutionFailureDetective detective,
Repository repository, TransformedManifestProvidingBundleFileWrapper bundleTransformerHandler, RegionDigraph regionDigraph, DumpExtractor dumpExtractor) {
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/ServiceScopingRegistryHook.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/ServiceScopingRegistryHook.java
index 755a5fce..8b619198 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/ServiceScopingRegistryHook.java
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/ServiceScopingRegistryHook.java
@@ -28,6 +28,7 @@ import org.osgi.framework.hooks.service.FindHook;
* Threadsafe.
*
*/
+@SuppressWarnings("deprecation")
final class ServiceScopingRegistryHook implements FindHook, EventHook {
private final ServiceScopingStrategy serviceScopingStrategy;
@@ -37,11 +38,11 @@ final class ServiceScopingRegistryHook implements FindHook, EventHook {
}
@SuppressWarnings("unchecked")
- public void find(BundleContext context, String name, String filter, boolean allServices, Collection references) {
+ public void find(BundleContext context, String name, String filter, boolean allServices, @SuppressWarnings("rawtypes") Collection references) {
this.serviceScopingStrategy.scopeReferences(references, context, name, filter);
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
public void event(ServiceEvent event, Collection contexts) {
ServiceReference ref = event.getServiceReference();
for (Iterator iterator = contexts.iterator(); iterator.hasNext();) {
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/DependencyCalculator.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/DependencyCalculator.java
index 3fc1b44f..779d593a 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/DependencyCalculator.java
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/quasi/DependencyCalculator.java
@@ -43,7 +43,6 @@ import org.eclipse.osgi.service.resolver.VersionRange;
import org.eclipse.virgo.kernel.artifact.bundle.BundleBridge;
import org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException;
import org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyDependenciesException;
-import org.eclipse.virgo.kernel.userregion.internal.equinox.ResolutionDumpContributor;
import org.eclipse.virgo.kernel.userregion.internal.quasi.ResolutionFailureDetective.ResolverErrorsHolder;
import org.eclipse.virgo.medic.dump.DumpGenerator;
import org.eclipse.virgo.repository.ArtifactDescriptor;
@@ -67,6 +66,9 @@ import org.slf4j.LoggerFactory;
*/
public final class DependencyCalculator {
+ // The following literal must match ResolutionDumpContributor.RESOLUTION_STATE_KEY from kernel core.
+ private static final String RESOLUTION_STATE_KEY = "resolution.state";
+
private static final String REGION_LOCATION_DELIMITER = "@";
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@@ -392,7 +394,7 @@ public final class DependencyCalculator {
private void generateDump(State state) {
Map<String, Object> context = new HashMap<String, Object>();
- context.put(ResolutionDumpContributor.RESOLUTION_STATE_KEY, state);
+ context.put(RESOLUTION_STATE_KEY, state);
this.dumpGenerator.generateDump("resolutionFailure", context);
}
diff --git a/org.eclipse.virgo.kernel.userregionfactory/src/main/java/org/eclipse/virgo/kernel/userregionfactory/Activator.java b/org.eclipse.virgo.kernel.userregionfactory/src/main/java/org/eclipse/virgo/kernel/userregionfactory/Activator.java
index 32be193a..98ddd727 100644
--- a/org.eclipse.virgo.kernel.userregionfactory/src/main/java/org/eclipse/virgo/kernel/userregionfactory/Activator.java
+++ b/org.eclipse.virgo.kernel.userregionfactory/src/main/java/org/eclipse/virgo/kernel/userregionfactory/Activator.java
@@ -344,11 +344,6 @@ public final class Activator implements BundleActivator {
try {
bundle.start();
} catch (BundleException e) {
- // Give the resolution state dump contributor a chance to be registered.
- try {
- Thread.sleep(10000);
- } catch (InterruptedException _) {
- }
// Take state dump for diagnosis of resolution failures
this.dumpGenerator.generateDump("User region bundle failed to start", e);
throw new BundleException("Failed to start bundle " + bundle.getSymbolicName() + " " + bundle.getVersion(), e);

Back to the top