Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2011-03-18 11:11:50 -0400
committerGlyn Normington2011-03-18 11:11:50 -0400
commit0df420b848b33f89ceb6605171d55e9f7f6945ca (patch)
tree5a62fe4934f5fb1ed6f81553503e6af357846f22
parentff5330d917696874d2d6bf7b269b49cbdb59c63e (diff)
parentbcc2da9092984f181a6581356fc8f9b9a16f1ef5 (diff)
downloadorg.eclipse.virgo.kernel-0df420b848b33f89ceb6605171d55e9f7f6945ca.tar.gz
org.eclipse.virgo.kernel-0df420b848b33f89ceb6605171d55e9f7f6945ca.tar.xz
org.eclipse.virgo.kernel-0df420b848b33f89ceb6605171d55e9f7f6945ca.zip
Merge branch 'region_persistence' into tom
-rw-r--r--build.versions2
-rw-r--r--org.eclipse.virgo.kernel.artifact/.classpath2
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/.classpath2
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerIntegrationTests.java22
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/StubWatchableRepository.java31
-rw-r--r--org.eclipse.virgo.kernel.deployer.test/src/test/resources/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.virgo.kernel.deployer/.classpath2
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/DeployerLogEvents.java5
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/PipelinedApplicationDeployer.java46
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/resources/EventLogMessages.properties3
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/resources/META-INF/spring/deployer-context.xml1
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/PipelinedApplicationDeployerTests.java22
-rw-r--r--org.eclipse.virgo.kernel.osgi/.classpath2
-rw-r--r--org.eclipse.virgo.kernel.services/.classpath2
-rw-r--r--org.eclipse.virgo.kernel.shell/.classpath2
-rw-r--r--org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/model/helper/StandardRamAccessorHelperTests.java1
-rw-r--r--org.eclipse.virgo.kernel.userregion/.classpath2
17 files changed, 123 insertions, 25 deletions
diff --git a/build.versions b/build.versions
index d582a22c..94755545 100644
--- a/build.versions
+++ b/build.versions
@@ -8,7 +8,7 @@ org.aspectj=1.6.6.RELEASE
org.eclipse.osgi=3.7.0.v20110224
org.eclipse.virgo.medic=3.0.0.M02
org.eclipse.virgo.osgi=3.0.0.M02
-org.eclipse.virgo.repository=3.0.0.D-20110309170144
+org.eclipse.virgo.repository=3.0.0.D-20110315153749
org.eclipse.virgo.util=3.0.0.M02
org.slf4j=1.6.1
org.slf4j.spi=1.6.1
diff --git a/org.eclipse.virgo.kernel.artifact/.classpath b/org.eclipse.virgo.kernel.artifact/.classpath
index 84a7dce8..d41602b8 100644
--- a/org.eclipse.virgo.kernel.artifact/.classpath
+++ b/org.eclipse.virgo.kernel.artifact/.classpath
@@ -22,7 +22,7 @@
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-4.7.0.jar" sourcepath="/KERNEL_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-sources-4.7.0.jar"/>
- <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110309170144/org.eclipse.virgo.repository-3.0.0.D-20110309170144.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110309170144/org.eclipse.virgo.repository-sources-3.0.0.D-20110309170144.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110315153749/org.eclipse.virgo.repository-3.0.0.D-20110315153749.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110315153749/org.eclipse.virgo.repository-sources-3.0.0.D-20110315153749.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.io/3.0.0.M02/org.eclipse.virgo.util.io-3.0.0.M02.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.io/3.0.0.M02/org.eclipse.virgo.util.io-sources-3.0.0.M02.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.osgi/3.0.0.M02/org.eclipse.virgo.util.osgi-3.0.0.M02.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.osgi/3.0.0.M02/org.eclipse.virgo.util.osgi-sources-3.0.0.M02.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.parser.manifest/3.0.0.M02/org.eclipse.virgo.util.parser.manifest-3.0.0.M02.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.parser.manifest/3.0.0.M02/org.eclipse.virgo.util.parser.manifest-sources-3.0.0.M02.jar"/>
diff --git a/org.eclipse.virgo.kernel.deployer.test/.classpath b/org.eclipse.virgo.kernel.deployer.test/.classpath
index 638548c6..b2295714 100644
--- a/org.eclipse.virgo.kernel.deployer.test/.classpath
+++ b/org.eclipse.virgo.kernel.deployer.test/.classpath
@@ -32,7 +32,7 @@
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.math/3.0.0.M02/org.eclipse.virgo.util.math-3.0.0.M02.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.math/3.0.0.M02/org.eclipse.virgo.util.math-sources-3.0.0.M02.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.0.v20110224/org.eclipse.osgi-3.7.0.v20110224.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.0.v20110224/org.eclipse.osgi-sources-3.7.0.v20110224.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/javax.transaction/com.springsource.javax.transaction/1.1.0/com.springsource.javax.transaction-1.1.0.jar"/>
- <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110309170144/org.eclipse.virgo.repository-3.0.0.D-20110309170144.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110309170144/org.eclipse.virgo.repository-sources-3.0.0.D-20110309170144.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110315153749/org.eclipse.virgo.repository-3.0.0.D-20110315153749.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110315153749/org.eclipse.virgo.repository-sources-3.0.0.D-20110315153749.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.common/3.0.0.M02/org.eclipse.virgo.util.common-3.0.0.M02.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.common/3.0.0.M02/org.eclipse.virgo.util.common-sources-3.0.0.M02.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.virgo.kernel.osgi"/>
<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.virgo.kernel.core"/>
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerIntegrationTests.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerIntegrationTests.java
index 03de2e6f..882c42c7 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerIntegrationTests.java
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/PipelinedDeployerIntegrationTests.java
@@ -13,6 +13,7 @@ package org.eclipse.virgo.kernel.deployer.test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
import java.io.File;
import java.lang.management.ManagementFactory;
@@ -30,6 +31,7 @@ import org.eclipse.virgo.kernel.install.artifact.InstallArtifactLifecycleListene
import org.eclipse.virgo.kernel.deployer.core.DeploymentException;
import org.eclipse.virgo.kernel.deployer.core.DeploymentIdentity;
import org.eclipse.virgo.kernel.deployer.core.DeploymentOptions;
+import org.eclipse.virgo.repository.WatchableRepository;
import org.eclipse.virgo.util.io.FileCopyUtils;
import org.eclipse.virgo.util.io.FileSystemUtils;
import org.eclipse.virgo.util.io.PathReference;
@@ -51,8 +53,12 @@ public class PipelinedDeployerIntegrationTests extends AbstractDeployerIntegrati
private ServiceRegistration<InstallArtifactLifecycleListener> lifecycleListenerRegistration;
- private DeploymentIdentity deploymentIdentity;
+ private StubWatchableRepository watchableRepository;
+
+ private ServiceRegistration<WatchableRepository> watchableRepositoryRegistration;
+ private DeploymentIdentity deploymentIdentity;
+
@Before
public void setUp() throws Exception {
PathReference pr = new PathReference("./target/deployer");
@@ -63,6 +69,9 @@ public class PipelinedDeployerIntegrationTests extends AbstractDeployerIntegrati
this.lifecycleListener = new StubInstallArtifactLifecycleListener();
this.lifecycleListenerRegistration = this.kernelContext.registerService(InstallArtifactLifecycleListener.class, this.lifecycleListener, null);
+
+ this.watchableRepository = new StubWatchableRepository();
+ this.watchableRepositoryRegistration = this.kernelContext.registerService(WatchableRepository.class, this.watchableRepository, null);
}
private void clearPickup() {
@@ -78,6 +87,9 @@ public class PipelinedDeployerIntegrationTests extends AbstractDeployerIntegrati
if (this.lifecycleListenerRegistration != null) {
this.lifecycleListenerRegistration.unregister();
}
+ if (this.watchableRepository != null) {
+ this.watchableRepositoryRegistration.unregister();
+ }
}
private void undeploy() throws DeploymentException {
@@ -103,6 +115,7 @@ public class PipelinedDeployerIntegrationTests extends AbstractDeployerIntegrati
this.deployer.undeploy(this.deploymentIdentity);
this.deploymentIdentity = null;
this.lifecycleListener.assertLifecycleCounts(1, 1, 1, 1);
+ assertEquals(1, this.watchableRepository.getCheckCount());
}
@Test
@@ -116,6 +129,7 @@ public class PipelinedDeployerIntegrationTests extends AbstractDeployerIntegrati
File workDir = new File("target/work/org.eclipse.virgo.kernel/Module/dummy.jar-0");
assertFalse(workDir.exists());
+ assertEquals(1, this.watchableRepository.getCheckCount());
}
@Test
@@ -124,6 +138,7 @@ public class PipelinedDeployerIntegrationTests extends AbstractDeployerIntegrati
ObjectName objectName = ObjectName.getInstance("org.eclipse.virgo.kernel:category=Control,type=RecoveryMonitor");
assertTrue(server.isRegistered(objectName));
assertTrue((Boolean) server.getAttribute(objectName, "RecoveryComplete"));
+ assertEquals(0, this.watchableRepository.getCheckCount());
}
@Test
@@ -138,6 +153,7 @@ public class PipelinedDeployerIntegrationTests extends AbstractDeployerIntegrati
this.lifecycleListener.assertLifecycleCounts(2, 2, 1, 1);
undeploy();
this.lifecycleListener.assertLifecycleCounts(2, 2, 2, 2);
+ assertEquals(2, this.watchableRepository.getCheckCount());
}
@Test
@@ -150,6 +166,7 @@ public class PipelinedDeployerIntegrationTests extends AbstractDeployerIntegrati
this.lifecycleListener.assertLifecycleCounts(2, 2, 1, 1);
undeploy();
this.lifecycleListener.assertLifecycleCounts(2, 2, 2, 2);
+ assertEquals(1, this.watchableRepository.getCheckCount());
}
@Test
@@ -160,6 +177,7 @@ public class PipelinedDeployerIntegrationTests extends AbstractDeployerIntegrati
assertLifecycleCountsAfterWait(1, 1, 0, 0, 10000);
deployed.delete();
assertLifecycleCountsAfterWait(1, 1, 1, 1, 6000);
+ assertEquals(1, this.watchableRepository.getCheckCount());
}
private void assertLifecycleCountsAfterWait(int starting, int started, int stopping, int stopped, long waitMillis) throws InterruptedException {
@@ -200,6 +218,7 @@ public class PipelinedDeployerIntegrationTests extends AbstractDeployerIntegrati
undeploy(true);
assertTrue(copy.exists());
copy.delete();
+ assertEquals(3, this.watchableRepository.getCheckCount());
}
@Test
@@ -228,5 +247,6 @@ public class PipelinedDeployerIntegrationTests extends AbstractDeployerIntegrati
undeploy();
this.lifecycleListener.assertLifecycleCounts(2, 2, 2, 2);
assertFalse(copy.exists());
+ assertEquals(2, this.watchableRepository.getCheckCount());
}
}
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/StubWatchableRepository.java b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/StubWatchableRepository.java
new file mode 100644
index 00000000..179643be
--- /dev/null
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/java/org/eclipse/virgo/kernel/deployer/test/StubWatchableRepository.java
@@ -0,0 +1,31 @@
+package org.eclipse.virgo.kernel.deployer.test;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.virgo.repository.WatchableRepository;
+
+
+public class StubWatchableRepository implements WatchableRepository {
+
+ private int checkCount = 0;
+
+ @Override
+ public Set<String> getArtifactLocations(String filename) {
+ return new HashSet<String>();
+ }
+
+ @Override
+ public void forceCheck() throws Exception {
+ this.checkCount++;
+ }
+
+ public void resetCheckCount(){
+ this.checkCount = 0;
+ }
+
+ public int getCheckCount(){
+ return this.checkCount;
+ }
+
+}
diff --git a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/META-INF/MANIFEST.MF b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/META-INF/MANIFEST.MF
index 326a811f..0b1fae6b 100644
--- a/org.eclipse.virgo.kernel.deployer.test/src/test/resources/META-INF/MANIFEST.MF
+++ b/org.eclipse.virgo.kernel.deployer.test/src/test/resources/META-INF/MANIFEST.MF
@@ -16,6 +16,7 @@ Import-Package: org.eclipse.virgo.kernel.core,
org.eclipse.virgo.kernel.services.work,
org.eclipse.virgo.util.io,
org.eclipse.virgo.util.math,
+ org.eclipse.virgo.repository,
javax.management,
org.eclipse.osgi.service.resolver,
org.junit,
diff --git a/org.eclipse.virgo.kernel.deployer/.classpath b/org.eclipse.virgo.kernel.deployer/.classpath
index b66d1af6..4fe2cfce 100644
--- a/org.eclipse.virgo.kernel.deployer/.classpath
+++ b/org.eclipse.virgo.kernel.deployer/.classpath
@@ -36,7 +36,7 @@
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.springframework/org.springframework.context/3.0.0.RELEASE/org.springframework.context-3.0.0.RELEASE.jar" sourcepath="/KERNEL_IVY_CACHE/org.springframework/org.springframework.context/3.0.0.RELEASE/org.springframework.context-sources-3.0.0.RELEASE.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.springframework.osgi/org.springframework.osgi.extender/1.2.1/org.springframework.osgi.extender-1.2.1.jar" sourcepath="/DEV_DIR/external-artifacts/non-spring-build/org.springframework.osgi/org.springframework.osgi.extender/1.2.1.RC1-SFW3/org.springframework.osgi.extender-sources.jar"/>
<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.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110309170144/org.eclipse.virgo.repository-3.0.0.D-20110309170144.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110309170144/org.eclipse.virgo.repository-sources-3.0.0.D-20110309170144.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110315153749/org.eclipse.virgo.repository-3.0.0.D-20110315153749.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110315153749/org.eclipse.virgo.repository-sources-3.0.0.D-20110315153749.jar"/>
<classpathentry kind="con" path="org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.medic/org.eclipse.virgo.medic/3.0.0.M02/org.eclipse.virgo.medic-3.0.0.M02.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.medic/org.eclipse.virgo.medic/3.0.0.M02/org.eclipse.virgo.medic-sources-3.0.0.M02.jar">
<attributes>
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/DeployerLogEvents.java b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/DeployerLogEvents.java
index e5f21e36..2ee88a5a 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/DeployerLogEvents.java
+++ b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/DeployerLogEvents.java
@@ -48,8 +48,11 @@ public enum DeployerLogEvents implements LogEvent {
CANNOT_REFRESH_BUNDLE_IDENTITY_CHANGED(70, Level.WARNING), //
CANNOT_REFRESH_BUNDLE_AS_SCOPED_AND_EXPORTS_CHANGED(71, Level.WARNING),
-
+
INSTALL_ARTIFACT_DAG_NOT_SUPPORTED(80, Level.ERROR), //
+
+ WATCHED_REPOSITORY_REFRESH_FAILED(90, Level.WARNING), //
+ WATCHED_REPOSITORIES_REFRESH_FAILED(91, Level.WARNING), //
RECOVERY_FAILED(200, Level.ERROR), //
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/PipelinedApplicationDeployer.java b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/PipelinedApplicationDeployer.java
index b3498220..d9edd42c 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/PipelinedApplicationDeployer.java
+++ b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/core/internal/PipelinedApplicationDeployer.java
@@ -13,14 +13,10 @@ package org.eclipse.virgo.kernel.deployer.core.internal;
import java.io.File;
import java.net.URI;
+import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-import org.osgi.framework.Version;
-
-import org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException;
-import org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyDependenciesException;
-
import org.eclipse.virgo.kernel.core.KernelException;
import org.eclipse.virgo.kernel.deployer.core.ApplicationDeployer;
import org.eclipse.virgo.kernel.deployer.core.DeployUriNormaliser;
@@ -41,9 +37,17 @@ import org.eclipse.virgo.kernel.install.artifact.PlanInstallArtifact;
import org.eclipse.virgo.kernel.install.environment.InstallEnvironment;
import org.eclipse.virgo.kernel.install.environment.InstallEnvironmentFactory;
import org.eclipse.virgo.kernel.install.pipeline.Pipeline;
+import org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException;
+import org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyDependenciesException;
import org.eclipse.virgo.medic.eventlog.EventLogger;
+import org.eclipse.virgo.repository.Repository;
+import org.eclipse.virgo.repository.WatchableRepository;
import org.eclipse.virgo.util.common.Tree;
import org.eclipse.virgo.util.io.PathReference;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Version;
/**
* {@link PipelinedApplicationDeployer} is an implementation of {@link ApplicationDeployer} which creates a {@link Tree}
@@ -80,6 +84,8 @@ final class PipelinedApplicationDeployer implements ApplicationDeployer, Applica
private final int deployerConfiguredTimeoutInSeconds;
+ private final BundleContext bundleContext;
+
public PipelinedApplicationDeployer(Pipeline pipeline,
InstallArtifactTreeInclosure installArtifactTreeInclosure,
InstallEnvironmentFactory installEnvironmentFactory,
@@ -87,14 +93,15 @@ final class PipelinedApplicationDeployer implements ApplicationDeployer, Applica
DeploymentListener deploymentListener,
EventLogger eventLogger,
DeployUriNormaliser normaliser,
- DeployerConfiguration deployerConfiguration) {
+ DeployerConfiguration deployerConfiguration,
+ BundleContext bundleContext){
this.eventLogger = eventLogger;
this.installArtifactTreeInclosure = installArtifactTreeInclosure;
this.installEnvironmentFactory = installEnvironmentFactory;
this.ram = ram;
this.deploymentListener = deploymentListener;
this.deployUriNormaliser = normaliser;
-
+ this.bundleContext = bundleContext;
this.pipeline = pipeline;
this.deployerConfiguredTimeoutInSeconds = deployerConfiguration.getDeploymentTimeoutSeconds();
}
@@ -271,6 +278,7 @@ final class PipelinedApplicationDeployer implements ApplicationDeployer, Applica
private void driveInstallPipeline(URI uri, Tree<InstallArtifact> installTree) throws DeploymentException {
+ refreshWatchedRepositories();
InstallEnvironment installEnvironment = this.installEnvironmentFactory.createInstallEnvironment(installTree.getValue());
try {
@@ -558,4 +566,28 @@ final class PipelinedApplicationDeployer implements ApplicationDeployer, Applica
installArtifact.uninstall();
}
+ private void refreshWatchedRepositories() {
+ try {
+ Collection<ServiceReference<WatchableRepository>> references = this.bundleContext.getServiceReferences(WatchableRepository.class, null);
+ for(ServiceReference<WatchableRepository> reference : references){
+ WatchableRepository watchableRepository = this.bundleContext.getService(reference);
+ try {
+ watchableRepository.forceCheck();
+ } catch (Exception e) {
+ String name;
+ if(watchableRepository instanceof Repository){
+ name = ((Repository)watchableRepository).getName();
+ } else {
+ name = "unknown repository type";
+ }
+ this.eventLogger.log(DeployerLogEvents.WATCHED_REPOSITORY_REFRESH_FAILED, name);
+ }
+ this.bundleContext.ungetService(reference);
+ }
+ } catch (InvalidSyntaxException e) {
+ this.eventLogger.log(DeployerLogEvents.WATCHED_REPOSITORIES_REFRESH_FAILED);
+ }
+
+ }
+
}
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/resources/EventLogMessages.properties b/org.eclipse.virgo.kernel.deployer/src/main/resources/EventLogMessages.properties
index cfde7036..4022e4bf 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/resources/EventLogMessages.properties
+++ b/org.eclipse.virgo.kernel.deployer/src/main/resources/EventLogMessages.properties
@@ -25,6 +25,9 @@ DE0071W = Cannot refresh bundle '{}' version '{}' as it is scoped and refreshing
DE0080E = Cannot install {} '{}' version '{}' as it was installed when {} '{}' version '{}' was installed.
+DE0090W = Watched repository '{}' could not be refreshed prior to bundle install.
+DE0091W = Unable to refresh any watched repositories prior to bundle install .
+
DE0200E = Recovery of artifact from URI '{}' failed.
DE0300E = Scope '{}' version '{}' exports package '{}' from more than one bundle: {}.
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/resources/META-INF/spring/deployer-context.xml b/org.eclipse.virgo.kernel.deployer/src/main/resources/META-INF/spring/deployer-context.xml
index b8fbd6c7..64cdbac7 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/resources/META-INF/spring/deployer-context.xml
+++ b/org.eclipse.virgo.kernel.deployer/src/main/resources/META-INF/spring/deployer-context.xml
@@ -125,6 +125,7 @@
<beans:constructor-arg ref="eventLogger" />
<beans:constructor-arg ref="uriNormaliser" />
<beans:constructor-arg ref="deployerConfig" />
+ <beans:constructor-arg ref="bundleContext" />
</beans:bean>
<beans:bean id="stateCleanupListener"
diff --git a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/PipelinedApplicationDeployerTests.java b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/PipelinedApplicationDeployerTests.java
index d2c3d23d..6bae2502 100644
--- a/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/PipelinedApplicationDeployerTests.java
+++ b/org.eclipse.virgo.kernel.deployer/src/test/java/org/eclipse/virgo/kernel/deployer/core/internal/PipelinedApplicationDeployerTests.java
@@ -10,6 +10,15 @@
*******************************************************************************/
package org.eclipse.virgo.kernel.deployer.core.internal;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.reset;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
import java.net.URI;
import java.net.URISyntaxException;
@@ -23,13 +32,11 @@ import org.eclipse.virgo.kernel.install.artifact.InstallArtifactTreeInclosure;
import org.eclipse.virgo.kernel.install.environment.InstallEnvironmentFactory;
import org.eclipse.virgo.kernel.install.pipeline.Pipeline;
import org.eclipse.virgo.medic.eventlog.EventLogger;
+import org.eclipse.virgo.teststubs.osgi.framework.StubBundleContext;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
-
public class PipelinedApplicationDeployerTests {
private PipelinedApplicationDeployer pipelinedApplicationDeployer;
@@ -42,6 +49,7 @@ public class PipelinedApplicationDeployerTests {
private DeployUriNormaliser normaliser;
private DeployerConfiguration deployerConfiguration;
private InstallArtifact installArtifact;
+ private StubBundleContext stubBundleContext = new StubBundleContext();
@Before
public void setup() {
@@ -54,7 +62,6 @@ public class PipelinedApplicationDeployerTests {
normaliser = createMock(DeployUriNormaliser.class);
deployerConfiguration = createMock(DeployerConfiguration.class);
installArtifact = createMock(InstallArtifact.class);
-
expect(this.deployerConfiguration.getDeploymentTimeoutSeconds()).andReturn(5);
}
@@ -65,7 +72,7 @@ public class PipelinedApplicationDeployerTests {
private void startTests() {
replay(this.pipeline, this.installArtifactTreeInclosure, this.installEnvironmentFactory, this.ram, this.deploymentListener, this.eventLogger, this.normaliser, this.deployerConfiguration, this.installArtifact);
- this.pipelinedApplicationDeployer = new PipelinedApplicationDeployer(pipeline, installArtifactTreeInclosure, installEnvironmentFactory, ram, deploymentListener, eventLogger, normaliser, deployerConfiguration);
+ this.pipelinedApplicationDeployer = new PipelinedApplicationDeployer(pipeline, installArtifactTreeInclosure, installEnvironmentFactory, ram, deploymentListener, eventLogger, normaliser, deployerConfiguration, stubBundleContext);
}
private void verifyMocks() {
@@ -98,7 +105,7 @@ public class PipelinedApplicationDeployerTests {
}
@Test
- public void testIsdeployedSucsess() throws URISyntaxException, DeploymentException {
+ public void testIsdeployedSucsess() throws Exception {
URI testURI = new URI("foo");
expect(this.normaliser.normalise(testURI)).andReturn(testURI);
expect(this.ram.get(testURI)).andReturn(this.installArtifact);
@@ -106,7 +113,8 @@ public class PipelinedApplicationDeployerTests {
boolean result = this.pipelinedApplicationDeployer.isDeployed(testURI);
this.verifyMocks();
assertTrue(result);
- }
+ }
+
@Test
public void testIsdeployedFail() throws URISyntaxException, DeploymentException {
diff --git a/org.eclipse.virgo.kernel.osgi/.classpath b/org.eclipse.virgo.kernel.osgi/.classpath
index 47331690..51106e09 100644
--- a/org.eclipse.virgo.kernel.osgi/.classpath
+++ b/org.eclipse.virgo.kernel.osgi/.classpath
@@ -28,7 +28,7 @@
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.slf4j/com.springsource.slf4j.nop/1.6.1/com.springsource.slf4j.nop-1.6.1.jar" sourcepath="/KERNEL_IVY_CACHE/org.slf4j/com.springsource.slf4j.nop/1.6.1/com.springsource.slf4j.nop-sources-1.6.1.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.aspectj/com.springsource.org.aspectj.runtime/1.6.6.RELEASE/com.springsource.org.aspectj.runtime-1.6.6.RELEASE.jar" sourcepath="/KERNEL_IVY_CACHE/org.aspectj/com.springsource.org.aspectj.runtime/1.6.6.RELEASE/com.springsource.org.aspectj.runtime-1.6.6.RELEASE.jar"/>
<classpathentry kind="con" path="org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"/>
- <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110309170144/org.eclipse.virgo.repository-3.0.0.D-20110309170144.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110309170144/org.eclipse.virgo.repository-sources-3.0.0.D-20110309170144.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110315153749/org.eclipse.virgo.repository-3.0.0.D-20110315153749.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110315153749/org.eclipse.virgo.repository-sources-3.0.0.D-20110315153749.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.osgi/3.0.0.M02/org.eclipse.virgo.util.osgi-3.0.0.M02.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.osgi/3.0.0.M02/org.eclipse.virgo.util.osgi-sources-3.0.0.M02.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.common/3.0.0.M02/org.eclipse.virgo.util.common-3.0.0.M02.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.common/3.0.0.M02/org.eclipse.virgo.util.common-sources-3.0.0.M02.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.math/3.0.0.M02/org.eclipse.virgo.util.math-3.0.0.M02.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.math/3.0.0.M02/org.eclipse.virgo.util.math-sources-3.0.0.M02.jar"/>
diff --git a/org.eclipse.virgo.kernel.services/.classpath b/org.eclipse.virgo.kernel.services/.classpath
index fefe6aa9..819ea6ff 100644
--- a/org.eclipse.virgo.kernel.services/.classpath
+++ b/org.eclipse.virgo.kernel.services/.classpath
@@ -30,7 +30,7 @@
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.springframework/org.springframework.beans/3.0.0.RELEASE/org.springframework.beans-3.0.0.RELEASE.jar" sourcepath="/KERNEL_IVY_CACHE/org.springframework/org.springframework.beans/3.0.0.RELEASE/org.springframework.beans-sources-3.0.0.RELEASE.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.springframework/org.springframework.core/3.0.0.RELEASE/org.springframework.core-3.0.0.RELEASE.jar" sourcepath="/KERNEL_IVY_CACHE/org.springframework/org.springframework.core/3.0.0.RELEASE/org.springframework.core-sources-3.0.0.RELEASE.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.springframework/org.springframework.context/3.0.0.RELEASE/org.springframework.context-3.0.0.RELEASE.jar" sourcepath="/KERNEL_IVY_CACHE/org.springframework/org.springframework.context/3.0.0.RELEASE/org.springframework.context-sources-3.0.0.RELEASE.jar"/>
- <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110309170144/org.eclipse.virgo.repository-3.0.0.D-20110309170144.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110309170144/org.eclipse.virgo.repository-sources-3.0.0.D-20110309170144.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110315153749/org.eclipse.virgo.repository-3.0.0.D-20110315153749.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110315153749/org.eclipse.virgo.repository-sources-3.0.0.D-20110315153749.jar"/>
<classpathentry kind="con" path="org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.medic/org.eclipse.virgo.medic/3.0.0.M02/org.eclipse.virgo.medic-3.0.0.M02.jar">
<attributes>
diff --git a/org.eclipse.virgo.kernel.shell/.classpath b/org.eclipse.virgo.kernel.shell/.classpath
index d67fb596..c3d4f279 100644
--- a/org.eclipse.virgo.kernel.shell/.classpath
+++ b/org.eclipse.virgo.kernel.shell/.classpath
@@ -44,7 +44,7 @@
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.io/3.0.0.M02/org.eclipse.virgo.util.io-3.0.0.M02.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.io/3.0.0.M02/org.eclipse.virgo.util.io-sources-3.0.0.M02.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.medic/org.eclipse.virgo.medic.test/3.0.0.M02/org.eclipse.virgo.medic.test-3.0.0.M02.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.medic/org.eclipse.virgo.medic.test/3.0.0.M02/org.eclipse.virgo.medic.test-sources-3.0.0.M02.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.virgo.kernel.deployer"/>
- <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110309170144/org.eclipse.virgo.repository-3.0.0.D-20110309170144.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110309170144/org.eclipse.virgo.repository-sources-3.0.0.D-20110309170144.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110315153749/org.eclipse.virgo.repository-3.0.0.D-20110315153749.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110315153749/org.eclipse.virgo.repository-sources-3.0.0.D-20110315153749.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.virgo.kernel.model"/>
<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="output" path="target/classes"/>
diff --git a/org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/model/helper/StandardRamAccessorHelperTests.java b/org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/model/helper/StandardRamAccessorHelperTests.java
index 8d76e533..e49f14e0 100644
--- a/org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/model/helper/StandardRamAccessorHelperTests.java
+++ b/org.eclipse.virgo.kernel.shell/src/test/java/org/eclipse/virgo/kernel/shell/model/helper/StandardRamAccessorHelperTests.java
@@ -13,7 +13,6 @@ package org.eclipse.virgo.kernel.shell.model.helper;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.lang.management.ManagementFactory;
diff --git a/org.eclipse.virgo.kernel.userregion/.classpath b/org.eclipse.virgo.kernel.userregion/.classpath
index 3d671b2d..13ea09f8 100644
--- a/org.eclipse.virgo.kernel.userregion/.classpath
+++ b/org.eclipse.virgo.kernel.userregion/.classpath
@@ -27,7 +27,7 @@
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-1.6.1.jar" sourcepath="/KERNEL_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-sources-1.6.1.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.slf4j/com.springsource.slf4j.nop/1.6.1/com.springsource.slf4j.nop-1.6.1.jar" sourcepath="/KERNEL_IVY_CACHE/org.slf4j/com.springsource.slf4j.nop/1.6.1/com.springsource.slf4j.nop-sources-1.6.1.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.aspectj/com.springsource.org.aspectj.runtime/1.6.6.RELEASE/com.springsource.org.aspectj.runtime-1.6.6.RELEASE.jar" sourcepath="/KERNEL_IVY_CACHE/org.aspectj/com.springsource.org.aspectj.runtime/1.6.6.RELEASE/com.springsource.org.aspectj.runtime-1.6.6.RELEASE.jar"/>
- <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110309170144/org.eclipse.virgo.repository-3.0.0.D-20110309170144.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110309170144/org.eclipse.virgo.repository-sources-3.0.0.D-20110309170144.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110315153749/org.eclipse.virgo.repository-3.0.0.D-20110315153749.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.repository/org.eclipse.virgo.repository/3.0.0.D-20110315153749/org.eclipse.virgo.repository-sources-3.0.0.D-20110315153749.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.osgi/3.0.0.M02/org.eclipse.virgo.util.osgi-3.0.0.M02.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.osgi/3.0.0.M02/org.eclipse.virgo.util.osgi-sources-3.0.0.M02.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.common/3.0.0.M02/org.eclipse.virgo.util.common-3.0.0.M02.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.common/3.0.0.M02/org.eclipse.virgo.util.common-sources-3.0.0.M02.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.math/3.0.0.M02/org.eclipse.virgo.util.math-3.0.0.M02.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.math/3.0.0.M02/org.eclipse.virgo.util.math-sources-3.0.0.M02.jar"/>

Back to the top