You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ace.apache.org by ma...@apache.org on 2013/04/04 11:43:37 UTC
svn commit: r1464402 [1/11] - in /ace/trunk: org.apache.ace.deployment.api/
org.apache.ace.deployment.deploymentadmin/ org.apache.ace.deployment.itest/
org.apache.ace.deployment.itest/src/org/apache/ace/it/deployment/
org.apache.ace.deployment.provider...
Author: marrs
Date: Thu Apr 4 09:43:34 2013
New Revision: 1464402
URL: http://svn.apache.org/r1464402
Log:
ACE-333 Merged deployment and verifier.
Added:
ace/trunk/org.apache.ace.deployment/
ace/trunk/org.apache.ace.deployment/.classpath
ace/trunk/org.apache.ace.deployment/.project
ace/trunk/org.apache.ace.deployment/.settings/
ace/trunk/org.apache.ace.deployment/.settings/org.eclipse.jdt.core.prefs
ace/trunk/org.apache.ace.deployment/api.bnd
ace/trunk/org.apache.ace.deployment/bnd.bnd
ace/trunk/org.apache.ace.deployment/build.xml
ace/trunk/org.apache.ace.deployment/deployment.repositorybased.bnd
ace/trunk/org.apache.ace.deployment/deploymentadmin.bnd
ace/trunk/org.apache.ace.deployment/provider.api.bnd
ace/trunk/org.apache.ace.deployment/provider.base.bnd
ace/trunk/org.apache.ace.deployment/provider.filebased.bnd
ace/trunk/org.apache.ace.deployment/servlet.bnd
ace/trunk/org.apache.ace.deployment/src/
ace/trunk/org.apache.ace.deployment/src/org/
ace/trunk/org.apache.ace.deployment/src/org/apache/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/Deployment.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/deploymentadmin/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/deploymentadmin/Activator.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/deploymentadmin/DeploymentAdminDeployer.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/packageinfo
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/processor/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/processor/DeploymentProcessor.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/processor/packageinfo
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/ArtifactData.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/DeploymentProvider.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/Activator.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/FileBasedProvider.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/impl/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/impl/ArtifactDataImpl.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/impl/packageinfo
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/packageinfo
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/Activator.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/BaseRepositoryHandler.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/DeploymentArtifactCollector.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/DeploymentPackageVersionCollector.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/LRUMap.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/RepositoryBasedProvider.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/service/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/service/DeploymentService.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/service/impl/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/service/impl/Activator.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/service/impl/DeploymentServiceImpl.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/service/packageinfo
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/servlet/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/servlet/AceRestException.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/servlet/Activator.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/servlet/DeploymentServlet.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/streamgenerator/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/streamgenerator/StreamGenerator.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/streamgenerator/impl/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/streamgenerator/impl/Activator.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/streamgenerator/impl/StreamGeneratorImpl.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/streamgenerator/packageinfo
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/task/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/task/Activator.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/task/DeploymentCheckTask.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/task/DeploymentUpdateTask.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/util/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/util/test/
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/util/test/BundleStreamGenerator.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/util/test/TestData.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/util/test/TestProvider.java
ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/util/test/packageinfo
ace/trunk/org.apache.ace.deployment/streamgenerator.bnd
ace/trunk/org.apache.ace.deployment/task.base.bnd
ace/trunk/org.apache.ace.deployment/task.bnd
ace/trunk/org.apache.ace.deployment/test/
ace/trunk/org.apache.ace.deployment/test/org/
ace/trunk/org.apache.ace.deployment/test/org/apache/
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/DeploymentTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/provider/
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/provider/filebased/
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/provider/filebased/FileBasedProviderTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/provider/repositorybased/
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/provider/repositorybased/BaseRepositoryHandlerTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/provider/repositorybased/CacheTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/provider/repositorybased/MockDeploymentRepository.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/provider/repositorybased/RepositoryBasedProviderPerformanceTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/provider/repositorybased/RepositoryBasedProviderTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/service/
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/service/impl/
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/service/impl/DeploymentServiceImplTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/servlet/
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/servlet/DeploymentServletTest.java
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/streamgenerator/
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/streamgenerator/impl/
ace/trunk/org.apache.ace.deployment/test/org/apache/ace/deployment/streamgenerator/impl/StreamTest.java
ace/trunk/org.apache.ace.deployment/util.test.bnd
ace/trunk/org.apache.ace.verifier/
ace/trunk/org.apache.ace.verifier/.classpath
ace/trunk/org.apache.ace.verifier/.project
ace/trunk/org.apache.ace.verifier/.settings/
ace/trunk/org.apache.ace.verifier/.settings/org.eclipse.jdt.core.prefs
ace/trunk/org.apache.ace.verifier/bnd.bnd
ace/trunk/org.apache.ace.verifier/build.xml
ace/trunk/org.apache.ace.verifier/impl.bnd
ace/trunk/org.apache.ace.verifier/src/
ace/trunk/org.apache.ace.verifier/src/org/
ace/trunk/org.apache.ace.verifier/src/org/apache/
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/VerifierService.java
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/impl/
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/impl/Activator.java
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/impl/VerifierBundleRevision.java
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/impl/VerifierResolverState.java
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/impl/VerifierServiceImpl.java
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/impl/VerifyEnvironmentImpl.java
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/packageinfo
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/ui/
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/ui/ACEVerifierExtension.java
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/ui/Activator.java
ace/trunk/org.apache.ace.verifier/src/org/apache/ace/deployment/verifier/ui/VerificationResult.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/Logger.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/capabilityset/
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/capabilityset/CapabilitySet.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/capabilityset/SimpleFilter.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/resolver/
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/resolver/CandidateComparator.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/resolver/Candidates.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/resolver/HostBundleRevision.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/resolver/HostedCapability.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/resolver/HostedRequirement.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/resolver/ResolveException.java (with props)
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/resolver/Resolver.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/resolver/ResolverImpl.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/resolver/ResolverWire.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/resolver/ResolverWireImpl.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/resolver/ResourceNotFoundException.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/util/
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/util/FelixConstants.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/util/MapToDictionary.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/util/SecureAction.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/util/StringComparator.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/util/Util.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/util/VersionRange.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/util/manifestparser/
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/util/manifestparser/ManifestParser.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/util/manifestparser/ParsedHeaderClause.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/util/manifestparser/R4Library.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/util/manifestparser/R4LibraryClause.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/wiring/
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/wiring/BundleCapabilityImpl.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/wiring/BundleRequirementImpl.java
ace/trunk/org.apache.ace.verifier/src/org/apache/felix/framework/wiring/BundleWireImpl.java
ace/trunk/org.apache.ace.verifier/test/
ace/trunk/org.apache.ace.verifier/test/org/
ace/trunk/org.apache.ace.verifier/test/org/apache/
ace/trunk/org.apache.ace.verifier/test/org/apache/ace/
ace/trunk/org.apache.ace.verifier/test/org/apache/ace/deployment/
ace/trunk/org.apache.ace.verifier/test/org/apache/ace/deployment/verifier/
ace/trunk/org.apache.ace.verifier/test/org/apache/ace/deployment/verifier/impl/
ace/trunk/org.apache.ace.verifier/test/org/apache/ace/deployment/verifier/impl/VerifierTest.java
ace/trunk/org.apache.ace.verifier/ui.bnd
Removed:
ace/trunk/org.apache.ace.deployment.api/
ace/trunk/org.apache.ace.deployment.deploymentadmin/
ace/trunk/org.apache.ace.deployment.provider.api/
ace/trunk/org.apache.ace.deployment.provider.base/
ace/trunk/org.apache.ace.deployment.provider.filebased/
ace/trunk/org.apache.ace.deployment.provider.repositorybased/
ace/trunk/org.apache.ace.deployment.servlet/
ace/trunk/org.apache.ace.deployment.streamgenerator/
ace/trunk/org.apache.ace.deployment.task/
ace/trunk/org.apache.ace.deployment.task.base/
ace/trunk/org.apache.ace.deployment.verifier/
ace/trunk/org.apache.ace.deployment.verifier.ui/
ace/trunk/org.apache.ace.test/src/org/apache/ace/test/utils/deployment/
Modified:
ace/trunk/org.apache.ace.deployment.itest/bnd.bnd
ace/trunk/org.apache.ace.deployment.itest/src/org/apache/ace/it/deployment/DeploymentIntegrationTest.java
ace/trunk/org.apache.ace.obr/test/org/apache/ace/obr/metadata/bindeximpl/BindexMetadataTest.java
ace/trunk/org.apache.ace.repository.ext/bnd.bnd
ace/trunk/org.apache.ace.test/bnd.bnd
Modified: ace/trunk/org.apache.ace.deployment.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment.itest/bnd.bnd?rev=1464402&r1=1464401&r2=1464402&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.deployment.itest/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.deployment.itest/bnd.bnd Thu Apr 4 09:43:34 2013
@@ -2,6 +2,7 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
-buildpath: junit.osgi,\
osgi.core,\
osgi.cmpn,\
+ javax.servlet,\
org.apache.felix.dependencymanager,\
org.apache.ace.test;version=latest,\
org.apache.ace.log;version=latest,\
@@ -11,11 +12,11 @@ Test-Cases: ${classes;CONCRETE;EXTENDS;o
org.apache.ace.identification.api;version=latest,\
org.apache.ace.identification.property;version=latest,\
org.apache.ace.server.log.store.api;version=latest,\
- javax.servlet,\
org.apache.ace.scheduler.api;version=latest,\
org.apache.ace.deployment.servlet;version=latest,\
org.apache.ace.deployment.provider.api;version=latest,\
- org.apache.ace.deployment.provider.filebased;version=latest
+ org.apache.ace.deployment.provider.filebased;version=latest,\
+ org.apache.ace.deployment.util.test;version=latest
-runfw: org.apache.felix.framework;version='[4,5)'
-runbundles: \
osgi.cmpn,\
Modified: ace/trunk/org.apache.ace.deployment.itest/src/org/apache/ace/it/deployment/DeploymentIntegrationTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment.itest/src/org/apache/ace/it/deployment/DeploymentIntegrationTest.java?rev=1464402&r1=1464401&r2=1464402&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.deployment.itest/src/org/apache/ace/it/deployment/DeploymentIntegrationTest.java (original)
+++ ace/trunk/org.apache.ace.deployment.itest/src/org/apache/ace/it/deployment/DeploymentIntegrationTest.java Thu Apr 4 09:43:34 2013
@@ -32,13 +32,13 @@ import java.util.concurrent.TimeUnit;
import org.apache.ace.deployment.provider.ArtifactData;
import org.apache.ace.deployment.provider.impl.ArtifactDataImpl;
+import org.apache.ace.deployment.util.test.BundleStreamGenerator;
import org.apache.ace.discovery.property.constants.DiscoveryConstants;
import org.apache.ace.http.listener.constants.HttpConstants;
import org.apache.ace.identification.property.constants.IdentificationConstants;
import org.apache.ace.it.IntegrationTestBase;
import org.apache.ace.scheduler.constants.SchedulerConstants;
import org.apache.ace.test.constants.TestConstants;
-import org.apache.ace.test.utils.deployment.BundleStreamGenerator;
import org.apache.felix.dm.Component;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleEvent;
Added: ace/trunk/org.apache.ace.deployment/.classpath
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/.classpath?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/.classpath (added)
+++ ace/trunk/org.apache.ace.deployment/.classpath Thu Apr 4 09:43:34 2013
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" output="bin_test" path="test"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="aQute.bnd.classpath.container"/>
+ <classpathentry kind="con" path="org.testng.TESTNG_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: ace/trunk/org.apache.ace.deployment/.project
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/.project?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/.project (added)
+++ ace/trunk/org.apache.ace.deployment/.project Thu Apr 4 09:43:34 2013
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.ace.deployment</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>bndtools.core.bndbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>bndtools.core.bndnature</nature>
+ </natures>
+</projectDescription>
Added: ace/trunk/org.apache.ace.deployment/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/.settings/org.eclipse.jdt.core.prefs?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/.settings/org.eclipse.jdt.core.prefs (added)
+++ ace/trunk/org.apache.ace.deployment/.settings/org.eclipse.jdt.core.prefs Thu Apr 4 09:43:34 2013
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: ace/trunk/org.apache.ace.deployment/api.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/api.bnd?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/api.bnd (added)
+++ ace/trunk/org.apache.ace.deployment/api.bnd Thu Apr 4 09:43:34 2013
@@ -0,0 +1,2 @@
+Export-Package: org.apache.ace.deployment
+Bundle-Version: 1.0.0
Added: ace/trunk/org.apache.ace.deployment/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/bnd.bnd?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/bnd.bnd (added)
+++ ace/trunk/org.apache.ace.deployment/bnd.bnd Thu Apr 4 09:43:34 2013
@@ -0,0 +1,18 @@
+-buildpath: \
+ osgi.core,\
+ osgi.cmpn,\
+ javax.servlet,\
+ org.apache.felix.dependencymanager,\
+ org.ops4j.pax.swissbox.tinybundles,\
+ org.ops4j.base.store,\
+ commons-logging,\
+ com.vaadin,\
+ org.apache.ace.authentication.api;version=latest,\
+ org.apache.ace.identification.api;version=latest,\
+ org.apache.ace.discovery.api;version=latest,\
+ org.apache.ace.connectionfactory;version=latest,\
+ org.apache.ace.repository.api;version=latest,\
+ org.apache.ace.repository.ext;version=latest,\
+ org.apache.ace.scheduler.api;version=latest,\
+ org.apache.ace.range.api;version=latest
+-sub: *.bnd
Added: ace/trunk/org.apache.ace.deployment/build.xml
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/build.xml?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/build.xml (added)
+++ ace/trunk/org.apache.ace.deployment/build.xml Thu Apr 4 09:43:34 2013
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="project" default="build">
+
+ <!-- -->
+
+ <import file="../cnf/build.xml" />
+</project>
Added: ace/trunk/org.apache.ace.deployment/deployment.repositorybased.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/deployment.repositorybased.bnd?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/deployment.repositorybased.bnd (added)
+++ ace/trunk/org.apache.ace.deployment/deployment.repositorybased.bnd Thu Apr 4 09:43:34 2013
@@ -0,0 +1,6 @@
+Private-Package: org.apache.ace.deployment.provider.repositorybased,\
+ org.apache.ace.deployment.provider.impl,\
+ org.apache.ace.repository.ext,\
+ org.apache.ace.repository.ext.impl
+Bundle-Activator: org.apache.ace.deployment.provider.repositorybased.Activator
+Bundle-Version: 1.0.0
Added: ace/trunk/org.apache.ace.deployment/deploymentadmin.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/deploymentadmin.bnd?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/deploymentadmin.bnd (added)
+++ ace/trunk/org.apache.ace.deployment/deploymentadmin.bnd Thu Apr 4 09:43:34 2013
@@ -0,0 +1,3 @@
+Private-Package: org.apache.ace.deployment.deploymentadmin
+Bundle-Activator: org.apache.ace.deployment.deploymentadmin.Activator
+Bundle-Version: 1.0.0
Added: ace/trunk/org.apache.ace.deployment/provider.api.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/provider.api.bnd?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/provider.api.bnd (added)
+++ ace/trunk/org.apache.ace.deployment/provider.api.bnd Thu Apr 4 09:43:34 2013
@@ -0,0 +1,2 @@
+Export-Package: org.apache.ace.deployment.provider
+Bundle-Version: 1.0.0
Added: ace/trunk/org.apache.ace.deployment/provider.base.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/provider.base.bnd?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/provider.base.bnd (added)
+++ ace/trunk/org.apache.ace.deployment/provider.base.bnd Thu Apr 4 09:43:34 2013
@@ -0,0 +1,2 @@
+Export-Package: org.apache.ace.deployment.provider.impl
+Bundle-Version: 1.0.0
Added: ace/trunk/org.apache.ace.deployment/provider.filebased.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/provider.filebased.bnd?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/provider.filebased.bnd (added)
+++ ace/trunk/org.apache.ace.deployment/provider.filebased.bnd Thu Apr 4 09:43:34 2013
@@ -0,0 +1,4 @@
+Private-Package: org.apache.ace.deployment.provider.filebased,\
+ org.apache.ace.deployment.provider.impl
+Bundle-Activator: org.apache.ace.deployment.provider.filebased.Activator
+Bundle-Version: 1.0.0
Added: ace/trunk/org.apache.ace.deployment/servlet.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/servlet.bnd?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/servlet.bnd (added)
+++ ace/trunk/org.apache.ace.deployment/servlet.bnd Thu Apr 4 09:43:34 2013
@@ -0,0 +1,4 @@
+Private-Package: org.apache.ace.deployment.servlet
+Bundle-Activator: org.apache.ace.deployment.servlet.Activator
+Export-Package: org.apache.ace.deployment.processor
+Bundle-Version: 1.0.0
Added: ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/Deployment.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/Deployment.java?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/Deployment.java (added)
+++ ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/Deployment.java Thu Apr 4 09:43:34 2013
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.deployment;
+
+import java.io.InputStream;
+import org.osgi.framework.Version;
+
+/**
+ * Service that abstracts the actual implementation that manages components that are to be deployed.
+ * Implementations of this interface could for example make use of the <code>DeploymentAdmin</code>
+ * from the OSGi spec to actually deploy packages. The objects used as arguments and return values
+ * must all be of the same type, which type depends on the implementation.
+ */
+public interface Deployment {
+
+ /**
+ * Deploys the contents of the stream onto the system.
+ *
+ * @param inputStream Stream containing new components.
+ * @return The update package that was installed, may be null if the implementation does not support this.
+ * @throws Exception If the specified stream could not be deployed.
+ */
+ public Object install(InputStream inputStream) throws Exception;
+
+ /**
+ * Gets the name of the specified update package. Guaranteed to work with <code>Object</code>s returned
+ * by the same implementation of this interface.
+ *
+ * @param object The update package
+ * @return the name
+ * @throws IllegalArgumentException when the specified object is an invalid update package, only Objects returned by the same implementation of this interface should be used.
+ */
+ public String getName(Object object) throws IllegalArgumentException;
+
+ /**
+ * Gets the version of the specified update package. Guaranteed to work with <code>Object</code>s returned
+ * by the same implementation of this interface.
+ *
+ * @param object The update package
+ * @return the version
+ * @throws IllegalArgumentException when the specified object is an invalid update package, only Objects returned by the same implementation of this interface should be used.
+ */
+ public Version getVersion(Object object) throws IllegalArgumentException;
+
+ /**
+ * Retrieve a list of installed update packages.
+ *
+ * @return list of installed update packages or an empty array if none are available.
+ */
+ public Object[] list();
+
+}
\ No newline at end of file
Added: ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/deploymentadmin/Activator.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/deploymentadmin/Activator.java?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/deploymentadmin/Activator.java (added)
+++ ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/deploymentadmin/Activator.java Thu Apr 4 09:43:34 2013
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.deployment.deploymentadmin;
+
+import org.apache.ace.deployment.Deployment;
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.deploymentadmin.DeploymentAdmin;
+import org.osgi.service.log.LogService;
+
+public class Activator extends DependencyActivatorBase {
+ public void init(BundleContext context, DependencyManager manager) throws Exception {
+ manager.add(createComponent()
+ .setInterface(Deployment.class.getName(), null)
+ .setImplementation(DeploymentAdminDeployer.class)
+ .add(createServiceDependency().setService(DeploymentAdmin.class).setRequired(true))
+ .add(createServiceDependency().setService(LogService.class).setRequired(false)));
+ }
+
+ public void destroy(BundleContext context, DependencyManager manager) throws Exception {
+ // do nothing
+ }
+}
\ No newline at end of file
Added: ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/deploymentadmin/DeploymentAdminDeployer.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/deploymentadmin/DeploymentAdminDeployer.java?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/deploymentadmin/DeploymentAdminDeployer.java (added)
+++ ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/deploymentadmin/DeploymentAdminDeployer.java Thu Apr 4 09:43:34 2013
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.deployment.deploymentadmin;
+
+import java.io.InputStream;
+import org.apache.ace.deployment.Deployment;
+import org.osgi.framework.Version;
+import org.osgi.service.deploymentadmin.DeploymentAdmin;
+import org.osgi.service.deploymentadmin.DeploymentPackage;
+import org.osgi.service.log.LogService;
+
+/**
+ * Implementation of the <code>DeploymentService</code> interface that uses the <code>DeploymentAdmin</code>
+ * to deploy components.
+ */
+public class DeploymentAdminDeployer implements Deployment {
+ private volatile LogService m_log; /* will be injected by dependencymanager */
+ private volatile DeploymentAdmin m_admin; /* will be injected by dependencymanager */
+
+ public String getName(Object object) throws IllegalArgumentException {
+ if (!(object instanceof DeploymentPackage)) {
+ throw new IllegalArgumentException("Argument is not a DeploymentPackage");
+ }
+ return ((DeploymentPackage) object).getName();
+ }
+
+ public Version getVersion(Object object) throws IllegalArgumentException {
+ if (!(object instanceof DeploymentPackage)) {
+ throw new IllegalArgumentException("Argument is not a DeploymentPackage");
+ }
+ return ((DeploymentPackage) object).getVersion();
+ }
+
+ public Object install(InputStream inputStream) throws Exception {
+ DeploymentPackage deploymentPackage = m_admin.installDeploymentPackage(inputStream);
+ m_log.log(LogService.LOG_INFO, "Deployment Package installed: name=" + deploymentPackage.getName() + " version=" + deploymentPackage.getVersion());
+ return deploymentPackage;
+ }
+
+ public Object[] list() {
+ // DeploymentAdmin spec says this call should never return null
+ return m_admin.listDeploymentPackages();
+ }
+}
\ No newline at end of file
Added: ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/packageinfo
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/packageinfo?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/packageinfo (added)
+++ ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/packageinfo Thu Apr 4 09:43:34 2013
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file
Added: ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/processor/DeploymentProcessor.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/processor/DeploymentProcessor.java?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/processor/DeploymentProcessor.java (added)
+++ ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/processor/DeploymentProcessor.java Thu Apr 4 09:43:34 2013
@@ -0,0 +1,44 @@
+package org.apache.ace.deployment.processor;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Deployment processors can post process the deployment package before it is sent to the original requester. This allows you to
+ * transform how the data is actually sent, allowing you to basically "repackage" the content on the fly. Deployment processors
+ * should be registered as services with a service property called "processor" which should match a request property of the same
+ * name and value.
+ */
+public interface DeploymentProcessor {
+ /**
+ * Post-process the stream and send it to the response. The input stream is the deployment package as it was generated. You
+ * should set the correct mime type and start writing to the response.
+ *
+ * @param inputStream the input stream for the deployment package
+ * @param request the original request, in case you want to access certain parameters
+ * @param response the response to write to
+ */
+ public void process(InputStream inputStream, HttpServletRequest request, HttpServletResponse response) throws IOException;
+}
Added: ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/processor/packageinfo
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/processor/packageinfo?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/processor/packageinfo (added)
+++ ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/processor/packageinfo Thu Apr 4 09:43:34 2013
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file
Added: ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/ArtifactData.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/ArtifactData.java?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/ArtifactData.java (added)
+++ ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/ArtifactData.java Thu Apr 4 09:43:34 2013
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.deployment.provider;
+
+import java.net.URL;
+import java.util.jar.Attributes;
+
+/**
+ * The ArtifactData as returned by the <code>DeploymentProvider</code> class in this package.
+ * It contains several pieces of data which describe the artifact and the place where it can be found.
+ */
+public interface ArtifactData {
+
+ /**
+ * Indicate if the bundle has changed. This is used when comparing artifacts in 2 versions. (see DeploymentProvider)
+ * If you requested one version it always returns true.
+ *
+ * @return if this artifact has changed.
+ */
+ public boolean hasChanged();
+
+ /**
+ * @return <code>true</code> if this artifact is a bundle; <code>false</code> otherwise.
+ */
+ public boolean isBundle();
+
+ /**
+ * @return <code>true</code> if this artifact is a customizer that contains a resource processor; <code>false</code> otherwise.
+ */
+ public boolean isCustomizer();
+
+ /**
+ * @return the filename of the artifact
+ */
+ public String getFilename();
+
+ /**
+ * @return the symbolic name, if this artifact is a bundle.
+ */
+ public String getSymbolicName();
+
+ /**
+ * @return the version, if this artifact is a bundle. If it is an artifact, this function
+ * will always return "0.0.0".
+ */
+ public String getVersion();
+
+ /**
+ * @return the url to the artifact data.
+ */
+ public URL getUrl();
+
+ /**
+ * @return the processor Pid to be used for this resource, if any.
+ */
+ public String getProcessorPid();
+
+ /**
+ * @return a set of attributes that describes this artifact in a manifest.
+ * @param fixPackage Indicating whether this set of headers is intended to be part
+ * of a fixpackage.
+ */
+ public Attributes getManifestAttributes(boolean fixPackage);
+
+}
\ No newline at end of file
Added: ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/DeploymentProvider.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/DeploymentProvider.java?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/DeploymentProvider.java (added)
+++ ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/DeploymentProvider.java Thu Apr 4 09:43:34 2013
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.deployment.provider;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * An interface that provides the meta information for the bundles
+ * in a certain version number.
+ */
+public interface DeploymentProvider {
+
+ /**
+ * Get the collection of bundleData for a specific version. This data can be used to generate a deployment package.
+ * The ArtifactData.hasChanged method will return true for all bundles in this collection
+ *
+ * @return a collection of bundledata. If there are no bundles in this version, return an empty list
+ * @throws IllegalArgumentException if the target or version do not exist
+ * @throws java.io.IOException If an IOException occurs.
+ */
+ public List<ArtifactData> getBundleData(String targetId, String version) throws IllegalArgumentException, IOException;
+
+ /**
+ * This data can be used to generate a fix package. It gives the differences between the versionFrom and versionTo.
+ *
+ * Changes between versions are indicated by ArtifactData.hasChanged:
+ * <ol>
+ * <li> If a bundle was present in versionFrom and not in VersionTo, it will not be in the collection</li>
+ * <li> If a bundle existed in versionFrom and exists unchanged in VersionTo, hasChanged will return false</li>
+ * <li> If a bundle existed in versionFrom and exists changed (i.e. other version) in versionTo, hasChanged will return true</li>
+ * <li> If a bundle did not exist in versionFrom and exists in VersionTo, hasChanged will return true</li>
+ * </ol>
+ *
+ * @return a list of bundles.
+ * @throws IllegalArgumentException if the target, the versionFrom or versionTo do no exist
+ * @throws java.io.IOException If an IOException occurs.
+ */
+
+ public List<ArtifactData> getBundleData(String targetId, String versionFrom, String versionTo) throws IllegalArgumentException, IOException;
+
+ /**
+ * Returns a list of versions for a specific target. The list is sorted in
+ * ascending order, so the latest version is the last one in the list.
+ *
+ * @param targetId The id of the target for which all available deployment package
+ * versions are being retrieved.
+ * @return All available deployment package versions for a specific target. If none available,
+ * return an empty List.
+ * If the target doesn't exist, an IllegalArgumentException is thrown
+ * @throws java.io.IOException If an IOException occurs.
+ */
+ public List<String> getVersions(String targetId) throws IllegalArgumentException, IOException;
+}
\ No newline at end of file
Added: ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/Activator.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/Activator.java?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/Activator.java (added)
+++ ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/Activator.java Thu Apr 4 09:43:34 2013
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.deployment.provider.filebased;
+
+import org.apache.ace.deployment.provider.DeploymentProvider;
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+
+public class Activator extends DependencyActivatorBase {
+ public static final String PID = "org.apache.ace.deployment.provider.filebased";
+
+ @Override
+ public void init(BundleContext context, DependencyManager manager) throws Exception {
+ manager.add(createComponent()
+ .setInterface(DeploymentProvider.class.getName(), null)
+ .setImplementation(FileBasedProvider.class)
+ .add(createConfigurationDependency()
+ .setPid(PID)
+ )
+ .add(createServiceDependency()
+ .setService(LogService.class)
+ .setRequired(false)));
+ }
+
+ @Override
+ public void destroy(BundleContext arg0, DependencyManager arg1) throws Exception {
+ // TODO Auto-generated method stub
+ }
+}
\ No newline at end of file
Added: ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/FileBasedProvider.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/FileBasedProvider.java?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/FileBasedProvider.java (added)
+++ ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/filebased/FileBasedProvider.java Thu Apr 4 09:43:34 2013
@@ -0,0 +1,373 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.deployment.provider.filebased;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.Semaphore;
+import java.util.jar.Attributes;
+import java.util.jar.JarInputStream;
+import java.util.jar.Manifest;
+
+import org.apache.ace.deployment.provider.ArtifactData;
+import org.apache.ace.deployment.provider.DeploymentProvider;
+import org.apache.ace.deployment.provider.impl.ArtifactDataImpl;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Version;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedService;
+import org.osgi.service.log.LogService;
+
+/**
+ * This class reads data from the filesystem. It contains deployment data in the following format: <storage dir>/<target-name>/<bundle-version>/<jars>
+ * example : storage-directory/ storage-directory/target-a storage-directory/target-a/1.0.0
+ * storage-directory/target-a/1.0.0/bundle1.jar storage-directory/target-a/1.0.0/bundle2.jar storage-directory/target-a/1.1.0
+ * storage-directory/target-a/1.1.0/bundle2.jar storage-directory/target-a/1.1.0/bundle3.jar The versions are in the
+ * org.osgi.framework.Version format.
+ */
+public class FileBasedProvider implements DeploymentProvider, ManagedService {
+ /** Directory where all the target ID folders are located. */
+ private static final String DIRECTORY_NAME = "BaseDirectoryName";
+ /** Fallback directory for all targets that have no specific versions. Defaults to BaseDirectoryName if not specified. */
+ private static final String DEFAULT_DIRECTORY_NAME = "DefaultDirectoryName";
+ private static final int OSGI_R4_MANIFEST_VERSION = 2;
+ private volatile File m_baseDirectory;
+ private volatile File m_defaultDirectory;
+ private volatile LogService m_log;
+ private final Semaphore m_disk = new Semaphore(1, true);
+
+ /**
+ * Get the bundle data from the bundles in the <data dir>/<target>/<version> directory It reads the manifest from all the
+ * .jar files in that directory. If the manifest cannot be found, This method can only parse OSGi R4 bundles
+ */
+ public List<ArtifactData> getBundleData(String targetId, String version) throws IllegalArgumentException {
+ List<String> versions = getVersions(targetId);
+ if (!versions.contains(version)) {
+ throw new IllegalArgumentException("Unknown version " + version + " requested");
+ }
+ File targetDirectory = new File(m_baseDirectory, targetId);
+ File versionDirectory;
+ if (targetDirectory.isDirectory()) {
+ // target has its own folder
+ versionDirectory = findMatchingVersionDirectory(targetDirectory, version);
+ }
+ else {
+ versionDirectory = findMatchingVersionDirectory(m_defaultDirectory, version);
+ }
+ List<ArtifactData> bundleData = new ArrayList<ArtifactData>();
+
+ JarInputStream jarInputStream = null;
+
+ File[] jarFiles = versionDirectory.listFiles();
+ for (int i = 0; i < jarFiles.length; i++) {
+ Manifest bundleManifest = null;
+ File jarFile = jarFiles[i];
+ try {
+ jarInputStream = new JarInputStream(new FileInputStream(jarFile));
+ bundleManifest = jarInputStream.getManifest();
+ }
+ catch (IOException ioe) {
+ m_log.log(LogService.LOG_WARNING, "Error making inputstream", ioe);
+ continue;
+ }
+ finally {
+ if (jarInputStream != null) {
+ try {
+ jarInputStream.close();
+ }
+ catch (Exception ioe) {
+ m_log.log(LogService.LOG_ERROR, "Error closing the file input stream", ioe);
+ }
+ }
+ }
+ Attributes mainAttributes = bundleManifest.getMainAttributes();
+ String manifestVersion = mainAttributes.getValue(Constants.BUNDLE_MANIFESTVERSION);
+ String symbolicName = mainAttributes.getValue(Constants.BUNDLE_SYMBOLICNAME);
+ String bundleVersion = mainAttributes.getValue(Constants.BUNDLE_VERSION);
+
+ if ((manifestVersion != null) && (symbolicName != null) && (bundleVersion != null)) {
+ // ok, now at least we have the required attributes
+ // now check if they have the expected values
+ if (OSGI_R4_MANIFEST_VERSION != new Integer(manifestVersion).intValue()) {
+ m_log.log(LogService.LOG_WARNING, "Invalid bundle:" + jarFile.getAbsolutePath() + " has the wrong manifest version.");
+ }
+ else {
+ // it is the right manifest version
+ if (symbolicName.trim().equals("")) {
+ m_log.log(LogService.LOG_WARNING, "Invalid bundle:" + jarFile.getAbsolutePath() + " the symbolic name is empty.");
+ }
+ else {
+ // it also has the right symbolic name
+ try {
+ new Version(bundleVersion);
+ // Do a file.toURI().toURL() to preserve special path characters
+ // see http://www.javalobby.org/java/forums/t19698.html
+ URL bundleUrl = new URL(null, jarFile.toURI().toURL().toString(), new URLStreamHandler() {
+
+ @Override
+ protected URLConnection openConnection(final URL u) throws IOException {
+ return new URLConnection(u) {
+ @Override
+ public void connect() throws IOException {
+ // TODO Auto-generated method stub
+ }
+ @Override
+ public InputStream getInputStream() throws IOException {
+ final InputStream parent;
+ try {
+ parent = new URL(u.toURI().toURL().toString()).openStream();
+ }
+ catch (URISyntaxException ex) {
+ throw new IOException(ex.getMessage());
+ }
+ return new InputStream() {
+ @Override
+ public int read() throws IOException {
+ return parent.read();
+ }
+
+ @Override
+ public int read(byte[] buffer) throws IOException {
+ return read(buffer, 0, buffer.length);
+ }
+
+ @Override
+ public int read(byte[] buffer, int off, int length) throws IOException {
+ m_disk.acquireUninterruptibly();
+ try {
+ return parent.read(buffer, off, length);
+ }
+ finally {
+ m_disk.release();
+ }
+ }
+
+ @Override
+ public void close() throws IOException {
+ parent.close();
+ }
+ };
+ }
+ };
+ }
+ });
+ bundleData.add(new ArtifactDataImpl(jarFile.getName(), symbolicName, bundleVersion, bundleUrl, true));
+ }
+ catch (IllegalArgumentException iae) {
+ m_log.log(LogService.LOG_WARNING, "Invalid bundle:" + jarFile.getAbsolutePath() + " has an illegal version", iae);
+ }
+ catch (MalformedURLException mue) {
+ m_log.log(LogService.LOG_WARNING, "Invalid bundle:" + jarFile.getAbsolutePath() + " unable to convert path to URL", mue);
+ }
+ }
+ }
+ }
+ else {
+ m_log.log(LogService.LOG_WARNING, "Invalid bundle:" + jarFile.getAbsolutePath() + " is missing required attributes");
+ }
+ }
+
+ return bundleData;
+ }
+
+ /**
+ * Version folder and requested version do not always match (see implementation of getVersions, which uses Versions.parseVersion to allow different styles)
+ * like 1 instead of 1.0.0 and alike.
+ * So we need to do some crawling to map them.
+ *
+ * @param targetDirectory store directory
+ * @param version that has been requested.
+ *
+ * @return the matching folder.
+ *
+ * @throws IllegalArgumentException if no matching folder has been found. If this happens something is weirdly wrong.
+ */
+ private File findMatchingVersionDirectory(File targetDirectory, String version) {
+ // first try the direct way:
+ File directTry = new File(targetDirectory, version);
+ if ((directTry != null) && directTry.isDirectory()) {
+ return directTry;
+ }
+ // otherwise try to find it:
+ Version requestedVersion;
+ try {
+ requestedVersion = Version.parseVersion(version);
+ }
+ catch (IllegalArgumentException iae) {
+ throw new IllegalArgumentException("Requested version " + version + " has no matching folder in store: " + targetDirectory.getAbsolutePath());
+ }
+
+ File[] files = targetDirectory.listFiles();
+ for (int i = 0; i < files.length; i++) {
+ File possibleVersionDirectory = files[i];
+ if (possibleVersionDirectory.isDirectory()) {
+ // ok, it is a directory. Now see if it is a version
+ try {
+ Version foundVersion = Version.parseVersion(possibleVersionDirectory.getName());
+ // no exception, but is could still be an empty version
+ if ((requestedVersion != null) && requestedVersion.equals(foundVersion)) {
+ return new File(targetDirectory, possibleVersionDirectory.getName());
+ }
+ }
+ catch (IllegalArgumentException iae) {
+ // dont' care at this point.
+ }
+ }
+ }
+ throw new IllegalArgumentException("Requested version " + version + " has no matching folder in store: " + targetDirectory.getAbsolutePath());
+ }
+
+ public List<ArtifactData> getBundleData(String targetId, String versionFrom, String versionTo) throws IllegalArgumentException {
+ List<ArtifactData> dataVersionFrom = getBundleData(targetId, versionFrom);
+ List<ArtifactData> dataVersionTo = getBundleData(targetId, versionTo);
+
+ Iterator<ArtifactData> it = dataVersionTo.iterator();
+ while (it.hasNext()) {
+ ArtifactDataImpl bundleDataVersionTo = (ArtifactDataImpl) it.next();
+ // see if there was previously a version of this bundle.
+ ArtifactData bundleDataVersionFrom = getBundleData(bundleDataVersionTo.getSymbolicName(), dataVersionFrom);
+ bundleDataVersionTo.setChanged(!bundleDataVersionTo.equals(bundleDataVersionFrom));
+ }
+ return dataVersionTo;
+ }
+
+ /**
+ * Check for the existence of bundledata in the collection for a bundle with the given symbolic name
+ *
+ * @param symbolicName
+ */
+ private ArtifactData getBundleData(String symbolicName, Collection<ArtifactData> data) {
+ Iterator<ArtifactData> it = data.iterator();
+ while (it.hasNext()) {
+ ArtifactData bundle = it.next();
+ if (bundle.getSymbolicName().equals(symbolicName)) {
+ return bundle;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Look in the baseDirectory for the specified target. If it exists, get the list of directories in there and check if they
+ * conform to the <code>org.osgi.framework.Version</code> format. If it does, it will be in the list of versions that are
+ * returned. If there are no valid versions, return an empty list. If the target cannot be found, an
+ * IllegalArgumentException is thrown. The list will be sorted on version.
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> getVersions(String targetId) throws IllegalArgumentException {
+ List<Version> versionList = new ArrayList<Version>();
+ File targetDirectory = new File(m_baseDirectory.getAbsolutePath(), targetId);
+ if (targetDirectory.isDirectory()) {
+ getVersions(targetId, versionList, targetDirectory);
+ }
+ else {
+ // try the default
+ getVersions(targetId, versionList, m_defaultDirectory);
+ }
+
+ // now sort the list of versions and convert all values to strings.
+ Collections.sort(versionList);
+ List<String> stringVersionList = new ArrayList<String>();
+ Iterator<Version> it = versionList.iterator();
+ while (it.hasNext()) {
+ String version = (it.next()).toString();
+ stringVersionList.add(version);
+ }
+ return stringVersionList;
+ }
+
+ /**
+ *
+ * @param targetId ID that requested versions
+ * @param versionList where collected versions will be put into.
+ * @param base folder to be crawled.
+ */
+ private void getVersions(String targetId, List<Version> versionList, File base) {
+ // ok, it is a directory. Now treat all the subdirectories as seperate versions
+ File[] files = base.listFiles();
+ for (int i = 0; i < files.length; i++) {
+ File possibleVersionDirectory = files[i];
+ if (possibleVersionDirectory.isDirectory()) {
+ // ok, it is a directory. Now see if it is a version
+ try {
+ Version version = Version.parseVersion(possibleVersionDirectory.getName());
+ // no exception, but is could still be an empty version
+ if (!version.equals(Version.emptyVersion)) {
+ versionList.add(version);
+ }
+ }
+ catch (IllegalArgumentException iae) {
+ // do nothing. This version will be ignored.
+ }
+ }
+ }
+ if (files.length == 0) {
+ m_log.log(LogService.LOG_DEBUG, "No versions found for target: " + targetId);
+ }
+ }
+
+ /**
+ * Update the configuration for this bundle. It checks if the basedirectory exists and is a directory.
+ */
+ public void updated(Dictionary settings) throws ConfigurationException {
+ if (settings != null) {
+ String baseDirectoryName = getNotNull(settings, DIRECTORY_NAME, "The base directory cannot be null");
+ File baseDirectory = new File(baseDirectoryName);
+ if (!baseDirectory.exists() || !baseDirectory.isDirectory()) {
+ throw new ConfigurationException(DIRECTORY_NAME, "The directory called '" + baseDirectoryName + "' " + (baseDirectory.exists() ? "is no directory." : "doesn't exist."));
+ }
+ m_baseDirectory = baseDirectory;
+
+ String defaultDirectoryName = (String) settings.get(DEFAULT_DIRECTORY_NAME);
+ if (defaultDirectoryName != null) {
+ File defaultDirectory = new File(defaultDirectoryName);
+ if (defaultDirectory.exists() && defaultDirectory.isDirectory()) {
+ m_defaultDirectory = defaultDirectory;
+ return;
+ }
+ }
+ // fallback to using the base directory
+ m_defaultDirectory = baseDirectory;
+ }
+ }
+
+ /**
+ * Convenience method for getting settings from a configuration dictionary.
+ */
+ private String getNotNull(Dictionary settings, String id, String errorMessage) throws ConfigurationException {
+ String result = (String) settings.get(id);
+ if (result == null) {
+ throw new ConfigurationException(id, errorMessage);
+ }
+ return result;
+ }
+}
\ No newline at end of file
Added: ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/impl/ArtifactDataImpl.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/impl/ArtifactDataImpl.java?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/impl/ArtifactDataImpl.java (added)
+++ ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/impl/ArtifactDataImpl.java Thu Apr 4 09:43:34 2013
@@ -0,0 +1,242 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.deployment.provider.impl;
+
+import java.net.URL;
+import java.util.Map;
+import java.util.jar.Attributes;
+import org.apache.ace.deployment.provider.ArtifactData;
+import org.osgi.framework.Constants;
+
+/**
+ * Implementation of <code>ArtifactData</code>. It overrides equals to make comparisons between versions easier.
+ */
+public class ArtifactDataImpl implements ArtifactData {
+ public final static String HEADER_NAME = "Name";
+ public static final String CUSTOMIZER = "DeploymentPackage-Customizer";
+ public static final String PROCESSORPID = "Resource-Processor";
+
+ /**
+ * Key, intended to be used for artifacts which are bundles and will publish
+ * a resource processor (see OSGi compendium section 114.10).
+ */
+ public static final String DIRECTIVE_ISCUSTOMIZER = "DeploymentPackage-Customizer";
+
+ /**
+ * Key, intended to be used for resources which require a resource processor
+ * (see OSGi compendium section 114.10).
+ */
+ public static final String DIRECTIVE_KEY_PROCESSORID = "Resource-Processor";
+
+ /**
+ * Key, intended to be used for artifacts which have a resourceID that's different
+ * from their generated name (based on URL).
+ */
+ public static final String DIRECTIVE_KEY_RESOURCE_ID = "Resource-ID";
+
+ /**
+ * Key, intended to be used for matching processed (see ArtifactPreprocessor) to their
+ * 'original' one.
+ */
+ public static final String DIRECTIVE_KEY_BASEURL = "Base-Url";
+
+ public static final String REPOSITORY_PATH = "ACE-RepositoryPath";
+
+
+
+ private final String m_filename;
+ private final String m_symbolicName;
+ private final String m_version;
+ private final Map<String, String> m_directives;
+
+ private final URL m_url;
+ private volatile boolean m_hasChanged;
+
+ /**
+ * Constructs an ArtifactDataImpl object.
+ * @param url The URL to the bundle. It will also be used to create the filename.
+ * The file-part of the url (after the last /) should It must only contain characters [A-Za-z0-9._-].
+ * @param directives A map of extra directives.
+ * @param symbolicName The symbolicname of the bundle.
+ * @param version The version of the bundle. If this is <code>null</code> or empty, it will be
+ * normalized to "0.0.0".
+ * @param hasChanged Indication of whether this bundle has changed relative to the previous deployment.
+ */
+ public ArtifactDataImpl(URL url, Map<String, String> directives, String symbolicName, String version, boolean hasChanged) {
+ this(url, symbolicName, version, null, directives, hasChanged);
+ }
+
+ /**
+ * Constructs an ArtifactDataImpl object.
+ * @param url The URL to the bundle. It will also be used to create the filename.
+ * The file-part of the url (after the last /) should It must only contain characters [A-Za-z0-9._-].
+ * @param directives A map of extra directives.
+ * @param hasChanged Indication of whether this bundle has changed relative to the previous deployment.
+ */
+ public ArtifactDataImpl(URL url, Map<String, String> directives, boolean hasChanged) {
+ this(url, null, null, null, directives, hasChanged);
+ }
+
+ public ArtifactDataImpl(String filename, URL url, Map<String, String> directives, boolean hasChanged) {
+ this(url, null, null, filename, directives, hasChanged);
+ }
+
+ /**
+ * Constructs an ArtifactDataImpl object.
+ * @param filename The filename of the bundle. If passed, it must only contain characters [A-Za-z0-9._-]; can be null.
+ * @param symbolicName The symbolicname of the bundle.
+ * @param version The version of the bundle. If this is <code>null</code> or empty, it will be
+ * normalized to "0.0.0".
+ * @param url The URL to the bundle. If filename is null, this will be used to create the filename; hence, the file-part of
+ * the url (after the last /) should adhere to the same rules as filename.
+ * @param hasChanged Indication of whether this bundle has changed relative to the previous deployment.
+ */
+ public ArtifactDataImpl(String filename, String symbolicName, String version, URL url, boolean hasChanged) {
+ this(url, symbolicName, version, filename, null, hasChanged);
+ }
+
+ private ArtifactDataImpl(URL url, String symbolicName, String version, String filename, Map<String, String> directives, boolean hasChanged) {
+ m_url = url;
+
+ if (filename != null) {
+ m_filename = filename;
+ }
+ else {
+ String urlString = m_url.toString();
+ m_filename = (urlString == null) ? null : urlString.substring(urlString.lastIndexOf('/') + 1);
+ }
+
+ for (byte b : m_filename.getBytes()) {
+ if (!(((b >= 'A') && (b <= 'Z')) || ((b >= 'a') && (b <= 'z')) || ((b >= '0') && (b <= '9')) || (b == '.') || (b == '-') || (b == '_'))) {
+ throw new IllegalArgumentException("Filename " + m_filename + " " + (filename == null ? "constructed from the url" : "") + " contains an illegal character '" + new String(new byte[] {b}) + "'");
+ }
+ }
+
+ m_symbolicName = symbolicName;
+ if ((version == null) || (version.trim().length() == 0)) {
+ m_version = "0.0.0";
+ }
+ else {
+ m_version = version;
+ }
+ m_directives = directives;
+ m_hasChanged = hasChanged;
+ }
+
+ public String getFilename() {
+ return m_filename;
+ }
+
+ public String getSymbolicName() {
+ return m_symbolicName;
+ }
+
+ public String getVersion() {
+ return m_version;
+ }
+
+ public String getProcessorPid() {
+ if (m_directives != null) {
+ return m_directives.get(DIRECTIVE_KEY_PROCESSORID);
+ }
+ return null;
+ }
+
+ public URL getUrl() {
+ return m_url;
+ }
+
+ public boolean hasChanged() {
+ return m_hasChanged;
+ }
+
+ /**
+ * @param hasChanged Indicate the bundle has changed
+ */
+ public void setChanged(boolean hasChanged) {
+ m_hasChanged = hasChanged;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (!(other instanceof ArtifactDataImpl)) {
+ return false;
+ }
+ ArtifactDataImpl jarFile2 = (ArtifactDataImpl) other;
+
+ if (getSymbolicName() != null) {
+ // this is a bundle
+ return getSymbolicName().equals(jarFile2.getSymbolicName()) &&
+ getVersion().equals(jarFile2.getVersion());
+ }
+ else {
+ // this is another artifact.
+ return m_url.equals(jarFile2.getUrl());
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 11;
+ if (getSymbolicName() != null) {
+ result = result ^ getSymbolicName().hashCode();
+ }
+ result = result ^ getVersion().hashCode();
+ result = result ^ getUrl().hashCode();
+ return result;
+ }
+
+ public Attributes getManifestAttributes(boolean fixPackage) {
+ Attributes a = new Attributes();
+
+ if (!isBundle()) {
+ // this is a regular artifact
+ a.putValue(PROCESSORPID, getProcessorPid());
+ }
+ else {
+ a.putValue(Constants.BUNDLE_SYMBOLICNAME, getSymbolicName());
+ a.putValue(Constants.BUNDLE_VERSION, getVersion());
+ // this is a bundle
+ if (isCustomizer()) {
+ a.putValue(CUSTOMIZER, "true");
+ }
+ }
+
+ if (m_directives != null) {
+ String path = m_directives.get(REPOSITORY_PATH);
+ if (path != null) {
+ a.putValue(REPOSITORY_PATH, path);
+ }
+ }
+ if (!hasChanged() && fixPackage) {
+ a.putValue("DeploymentPackage-Missing", "true");
+ }
+
+ return a;
+ }
+
+ public boolean isCustomizer() {
+ return (m_directives != null) && "true".equals(m_directives.get(DIRECTIVE_ISCUSTOMIZER));
+ }
+
+ public boolean isBundle() {
+ return getSymbolicName() != null;
+ }
+
+}
\ No newline at end of file
Added: ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/impl/packageinfo
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/impl/packageinfo?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/impl/packageinfo (added)
+++ ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/impl/packageinfo Thu Apr 4 09:43:34 2013
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file
Added: ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/packageinfo
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/packageinfo?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/packageinfo (added)
+++ ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/packageinfo Thu Apr 4 09:43:34 2013
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file
Added: ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/Activator.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/Activator.java?rev=1464402&view=auto
==============================================================================
--- ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/Activator.java (added)
+++ ace/trunk/org.apache.ace.deployment/src/org/apache/ace/deployment/provider/repositorybased/Activator.java Thu Apr 4 09:43:34 2013
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.deployment.provider.repositorybased;
+
+import org.apache.ace.deployment.provider.DeploymentProvider;
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+
+public class Activator extends DependencyActivatorBase {
+ public static final String PID = "org.apache.ace.deployment.provider.repositorybased";
+
+ @Override
+ public void init(BundleContext context, DependencyManager manager) throws Exception {
+ manager.add(createComponent()
+ .setInterface(DeploymentProvider.class.getName(), null)
+ .setImplementation(RepositoryBasedProvider.class)
+ .add(createConfigurationDependency()
+ .setPid(PID)
+ )
+ .add(createServiceDependency()
+ .setService(LogService.class)
+ .setRequired(false)));
+ }
+
+ @Override
+ public void destroy(BundleContext arg0, DependencyManager arg1) throws Exception {
+ // TODO Auto-generated method stub
+ }
+}
\ No newline at end of file