Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Kapukaranov2011-01-31 04:45:35 -0500
committerBorislav Kapukaranov2011-01-31 04:45:35 -0500
commitf3f5b0eab786298320e9115a8595ea335f0c622e (patch)
treef2d532cbff54c36ec568ea7326c14840b28e19b2 /org.eclipse.virgo.kernel.agent.dm
parent612d0d71fe0477a64809a3006ab44627bb02701d (diff)
downloadorg.eclipse.virgo.kernel-f3f5b0eab786298320e9115a8595ea335f0c622e.tar.gz
org.eclipse.virgo.kernel-f3f5b0eab786298320e9115a8595ea335f0c622e.tar.xz
org.eclipse.virgo.kernel-f3f5b0eab786298320e9115a8595ea335f0c622e.zip
bug333474 Remove fixed startup order in the user region and refactored the current implementation of the startup order fix
Diffstat (limited to 'org.eclipse.virgo.kernel.agent.dm')
-rw-r--r--org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/AgentDMStartTracker.java24
-rw-r--r--org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/StandardAgentDMStartTracker.java16
-rw-r--r--org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/internal/AgentActivator.java2
-rw-r--r--org.eclipse.virgo.kernel.agent.dm/src/main/resources/OSGI-INF/agentdm_start_tracker.xml7
-rw-r--r--org.eclipse.virgo.kernel.agent.dm/template.mf2
5 files changed, 50 insertions, 1 deletions
diff --git a/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/AgentDMStartTracker.java b/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/AgentDMStartTracker.java
new file mode 100644
index 00000000..ba0f987d
--- /dev/null
+++ b/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/AgentDMStartTracker.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 SAP AG
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * SAP AG - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.agent.dm;
+
+/**
+ *
+ * This interface is registered as a service that is enable only when the agent DM is started successfully
+ * <p />
+ *
+ * <strong>Concurrent Semantics</strong><br />
+ * Thread safe.
+ */
+public interface AgentDMStartTracker {
+
+}
diff --git a/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/StandardAgentDMStartTracker.java b/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/StandardAgentDMStartTracker.java
new file mode 100644
index 00000000..8b0a33b7
--- /dev/null
+++ b/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/StandardAgentDMStartTracker.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 SAP AG
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * SAP AG - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.agent.dm;
+
+public class StandardAgentDMStartTracker implements AgentDMStartTracker {
+
+}
diff --git a/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/internal/AgentActivator.java b/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/internal/AgentActivator.java
index b2de9403..4e1bcc03 100644
--- a/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/internal/AgentActivator.java
+++ b/org.eclipse.virgo.kernel.agent.dm/src/main/java/org/eclipse/virgo/kernel/agent/dm/internal/AgentActivator.java
@@ -37,6 +37,7 @@ import org.springframework.osgi.context.event.OsgiBundleApplicationContextListen
*/
public final class AgentActivator {
+ private static final String AGENT_DM_START_TRACKER = "agentDMStartTracker";
private final ServiceRegistrationTracker registrationTracker = new ServiceRegistrationTracker();
/**
@@ -44,6 +45,7 @@ public final class AgentActivator {
*/
public void activate(ComponentContext context) {
registerSpringDmToBlueprintEventAdapter(context.getBundleContext());
+ context.enableComponent(AGENT_DM_START_TRACKER);
}
private void registerSpringDmToBlueprintEventAdapter(BundleContext context) {
diff --git a/org.eclipse.virgo.kernel.agent.dm/src/main/resources/OSGI-INF/agentdm_start_tracker.xml b/org.eclipse.virgo.kernel.agent.dm/src/main/resources/OSGI-INF/agentdm_start_tracker.xml
new file mode 100644
index 00000000..2e7d9f5c
--- /dev/null
+++ b/org.eclipse.virgo.kernel.agent.dm/src/main/resources/OSGI-INF/agentdm_start_tracker.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component name="agentDMStartTracker" enabled="false" xmlns:src="http://www.osgi.org/xmlns/src/v1.1.0">
+ <implementation class="org.eclipse.virgo.kernel.agent.dm.StandardAgentDMStartTracker"/>
+ <service>
+ <provide interface="org.eclipse.virgo.kernel.agent.dm.AgentDMStartTracker"/>
+ </service>
+</component> \ No newline at end of file
diff --git a/org.eclipse.virgo.kernel.agent.dm/template.mf b/org.eclipse.virgo.kernel.agent.dm/template.mf
index f8472b5f..717f6297 100644
--- a/org.eclipse.virgo.kernel.agent.dm/template.mf
+++ b/org.eclipse.virgo.kernel.agent.dm/template.mf
@@ -14,5 +14,5 @@ Import-Template:
org.eclipse.virgo.medic.*;version="${org.eclipse.virgo.medic:[=.=.=, =.+1)}",
org.springframework.*;version="${org.springframework:[2.5.6, =.+1)}",
org.springframework.osgi.*;version="${org.springframework.osgi:[=.=.=, +1)}"
-Service-Component: OSGI-INF/dm_agent.xml
+Service-Component: OSGI-INF/dm_agent.xml, OSGI-INF/agentdm_start_tracker.xml
\ No newline at end of file

Back to the top