svn commit: r1061954 - in /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl: ./ tasks/
Author: cziegeler Date: Fri Jan 21 18:33:01 2011 New Revision: 1061954 URL: http://svn.apache.org/viewvc?rev=1061954&view=rev Log: SLING-1943 : Sort services (transformer and factories) by service ranking before invoking Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/DefaultTransformer.java sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/SortingServiceTracker.java sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/Util.java sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleStartTask.java sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleTaskCreator.java sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleUpdateTask.java sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/SystemBundleUpdateTask.java Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/DefaultTransformer.java URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/DefaultTransformer.java?rev=1061954&r1=1061953&r2=1061954&view=diff == --- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/DefaultTransformer.java (original) +++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/DefaultTransformer.java Fri Jan 21 18:33:01 2011 @@ -18,12 +18,8 @@ */ package org.apache.sling.installer.core.impl; -import java.io.IOException; -import java.io.InputStream; import java.util.HashMap; import java.util.Map; -import java.util.jar.JarInputStream; -import java.util.jar.Manifest; import org.apache.sling.installer.api.InstallableResource; import org.apache.sling.installer.api.tasks.RegisteredResource; @@ -79,34 +75,23 @@ public class DefaultTransformer * @return */ private TransformationResult[] checkBundle(final RegisteredResource resource) { -try { -final Manifest m = getManifest(resource.getInputStream()); -if (m != null) { -final String sn = m.getMainAttributes().getValue(Constants.BUNDLE_SYMBOLICNAME); -if (sn != null) { -final String v = m.getMainAttributes().getValue(Constants.BUNDLE_VERSION); -if (v != null) { -final Map attr = new HashMap(); -attr.put(Constants.BUNDLE_SYMBOLICNAME, sn); -attr.put(Constants.BUNDLE_VERSION, v.toString()); - -// check for activation policy -final String actPolicy = m.getMainAttributes().getValue(Constants.BUNDLE_ACTIVATIONPOLICY); -if ( Constants.ACTIVATION_LAZY.equals(actPolicy) ) { -attr.put(Constants.BUNDLE_ACTIVATIONPOLICY, actPolicy); -} - -final TransformationResult tr = new TransformationResult(); -tr.setId(sn); -tr.setResourceType(InstallableResource.TYPE_BUNDLE); -tr.setAttributes(attr); - -return new TransformationResult[] {tr}; -} -} +final Util.BundleHeaders headers = Util.readBundleHeaders(resource); +if ( headers != null ) { +final Map attr = new HashMap(); +attr.put(Constants.BUNDLE_SYMBOLICNAME, headers.symbolicName); +attr.put(Constants.BUNDLE_VERSION, headers.version); + +// check for activation policy +if ( headers.activationPolicy != null ) { +attr.put(Constants.BUNDLE_ACTIVATIONPOLICY, headers.activationPolicy); } -} catch (final IOException ignore) { -// ignore + +final TransformationResult tr = new TransformationResult(); +tr.setId(headers.symbolicName); +tr.setResourceType(InstallableResource.TYPE_BUNDLE); +tr.setAttributes(attr); + +return new TransformationResult[] {tr}; } return null; } @@ -161,38 +146,7 @@ public class DefaultTransformer return new TransformationResult[] {tr}; } -/** - * Read the manifest from supplied input stream, which is closed before return. - */ -private Manifest getManifest(final InputStream ins) throws IOException { -Manifest result = null; -if ( ins != null ) { -JarInputStream jis = null; -try { -jis = new JarInputStream(ins); -result= jis.getManifest(); - -
svn commit: r1061832 - /sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/NodeNameGenerator.java
Author: justin Date: Fri Jan 21 14:56:52 2011 New Revision: 1061832 URL: http://svn.apache.org/viewvc?rev=1061832&view=rev Log: adding return to javadoc Modified: sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/NodeNameGenerator.java Modified: sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/NodeNameGenerator.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/NodeNameGenerator.java?rev=1061832&r1=1061831&r2=1061832&view=diff == --- sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/NodeNameGenerator.java (original) +++ sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/NodeNameGenerator.java Fri Jan 21 14:56:52 2011 @@ -31,6 +31,8 @@ public interface NodeNameGenerator { * @param parentPath the path to the new node's parent * @param requirePrefix if true, ignore parameters which do not being with ./ * @param defaultNodeNameGenerator the default node name generator + * + * @return the node name to be created or null if other NodeNameGenerators should be consulted */ public String getNodeName(SlingHttpServletRequest request, String parentPath, boolean requirePrefix, NodeNameGenerator defaultNodeNameGenerator);
svn commit: r1061795 - in /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl: OsgiInstallerImpl.java SortingServiceTracker.java
Author: cziegeler Date: Fri Jan 21 12:57:17 2011 New Revision: 1061795 URL: http://svn.apache.org/viewvc?rev=1061795&view=rev Log: SLING-1943 : Sort services (transformer and factories) by service ranking before invoking Added: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/SortingServiceTracker.java (with props) Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java?rev=1061795&r1=1061794&r2=1061795&view=diff == --- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java (original) +++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java Fri Jan 21 12:57:17 2011 @@ -48,9 +48,6 @@ import org.osgi.framework.BundleEvent; import org.osgi.framework.BundleListener; import org.osgi.framework.FrameworkEvent; import org.osgi.framework.FrameworkListener; -import org.osgi.framework.ServiceReference; -import org.osgi.util.tracker.ServiceTracker; -import org.osgi.util.tracker.ServiceTrackerCustomizer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -65,7 +62,7 @@ import org.slf4j.LoggerFactory; */ public class OsgiInstallerImpl extends Thread -implements BundleListener, FrameworkListener, OsgiInstaller, ServiceTrackerCustomizer { +implements BundleListener, FrameworkListener, OsgiInstaller { /** The logger */ private final Logger logger = LoggerFactory.getLogger(this.getClass()); @@ -95,10 +92,10 @@ public class OsgiInstallerImpl private PersistentResourceList persistentList; /** A tracker for the factories. */ -private ServiceTracker factoryTracker; +private SortingServiceTracker factoryTracker; /** A tracker for the transformers. */ -private ServiceTracker transformerTracker; +private SortingServiceTracker transformerTracker; /** New resources lock. */ private final Object resourcesLock = new Object(); @@ -146,9 +143,9 @@ public class OsgiInstallerImpl */ private void init() { // start service trackers -this.factoryTracker = new ServiceTracker(ctx, InstallTaskFactory.class.getName(), this); +this.factoryTracker = new SortingServiceTracker(ctx, InstallTaskFactory.class.getName(), this); this.factoryTracker.open(); -this.transformerTracker = new ServiceTracker(ctx, ResourceTransformer.class.getName(), this); +this.transformerTracker = new SortingServiceTracker(ctx, ResourceTransformer.class.getName(), this); this.transformerTracker.open(); // listen to framework and bundle events @@ -449,7 +446,7 @@ public class OsgiInstallerImpl } // Walk the list of entities, and create appropriate OSGi tasks for each group -final Object[] services = this.factoryTracker.getServices(); +final InstallTaskFactory[] services = this.factoryTracker.getSortedServices(); if ( services != null && services.length > 0 ) { for(final String entityId : this.persistentList.getEntityIds()) { final EntityResourceList group = this.persistentList.getEntityResourceList(entityId); @@ -470,13 +467,13 @@ public class OsgiInstallerImpl /** * Get the task for the resource. */ -private InstallTask getTask(final Object[] services, +private InstallTask getTask(final InstallTaskFactory[] services, final TaskResourceGroup rrg) { InstallTask result = null; for(int i=0; i 0 ) { // Walk the list of unknown resources and invoke all transformers @@ -555,8 +552,8 @@ public class OsgiInstallerImpl while ( index < unknownList.size() ) { final RegisteredResource resource = unknownList.get(index); for(int i=0; ihttp://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/SortingServiceTracker.java?rev=1061795&view=auto == --- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/SortingServiceTracker.java (added) +++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/SortingServiceTracker.java Fri Jan 21 12:57:17 2011 @@ -0,0 +1,98 @@ +/* + * 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 L
svn commit: r1061777 - /sling/trunk/launchpad/builder/src/main/bundles/list.xml
Author: cziegeler Date: Fri Jan 21 12:08:16 2011 New Revision: 1061777 URL: http://svn.apache.org/viewvc?rev=1061777&view=rev Log: Use recent snapshots and remove groovy support which we will not ship with sling6 Modified: sling/trunk/launchpad/builder/src/main/bundles/list.xml Modified: sling/trunk/launchpad/builder/src/main/bundles/list.xml URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/builder/src/main/bundles/list.xml?rev=1061777&r1=1061776&r2=1061777&view=diff == --- sling/trunk/launchpad/builder/src/main/bundles/list.xml (original) +++ sling/trunk/launchpad/builder/src/main/bundles/list.xml Fri Jan 21 12:08:16 2011 @@ -111,7 +111,7 @@ org.apache.sling org.apache.sling.jcr.resource -2.0.7-SNAPSHOT +2.0.9-SNAPSHOT org.apache.sling @@ -126,12 +126,12 @@ org.apache.sling org.apache.sling.bundleresource.impl -2.0.5-SNAPSHOT +2.0.7-SNAPSHOT org.apache.sling org.apache.sling.fsresource -1.0.1-SNAPSHOT +1.0.3-SNAPSHOT @@ -258,11 +258,6 @@ org.apache.sling -org.apache.sling.extensions.groovy -1.0.0-SNAPSHOT - - -org.apache.sling org.apache.sling.extensions.explorer 1.0.0
svn commit: r1061753 - /sling/trunk/bundles/jcr/resource/pom.xml
Author: cziegeler Date: Fri Jan 21 11:17:06 2011 New Revision: 1061753 URL: http://svn.apache.org/viewvc?rev=1061753&view=rev Log: [maven-release-plugin] prepare for next development iteration Modified: sling/trunk/bundles/jcr/resource/pom.xml Modified: sling/trunk/bundles/jcr/resource/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/pom.xml?rev=1061753&r1=1061752&r2=1061753&view=diff == --- sling/trunk/bundles/jcr/resource/pom.xml (original) +++ sling/trunk/bundles/jcr/resource/pom.xml Fri Jan 21 11:17:06 2011 @@ -27,7 +27,7 @@ org.apache.sling.jcr.resource -2.0.8 +2.0.9-SNAPSHOT bundle Apache Sling JCR Resource Resolver @@ -37,13 +37,13 @@ - scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.resource-2.0.8 + scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/resource - scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.resource-2.0.8 + scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/resource - http://svn.apache.org/viewvc/sling/tags/org.apache.sling.jcr.resource-2.0.8 +http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource
svn commit: r1061752 - /sling/tags/org.apache.sling.jcr.resource-2.0.8/
Author: cziegeler Date: Fri Jan 21 11:17:02 2011 New Revision: 1061752 URL: http://svn.apache.org/viewvc?rev=1061752&view=rev Log: [maven-scm] copy for tag org.apache.sling.jcr.resource-2.0.8 Added: sling/tags/org.apache.sling.jcr.resource-2.0.8/ - copied from r1061751, sling/trunk/bundles/jcr/resource/
svn commit: r1061751 - /sling/trunk/bundles/jcr/resource/pom.xml
Author: cziegeler Date: Fri Jan 21 11:16:48 2011 New Revision: 1061751 URL: http://svn.apache.org/viewvc?rev=1061751&view=rev Log: [maven-release-plugin] prepare release org.apache.sling.jcr.resource-2.0.8 Modified: sling/trunk/bundles/jcr/resource/pom.xml Modified: sling/trunk/bundles/jcr/resource/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/pom.xml?rev=1061751&r1=1061750&r2=1061751&view=diff == --- sling/trunk/bundles/jcr/resource/pom.xml (original) +++ sling/trunk/bundles/jcr/resource/pom.xml Fri Jan 21 11:16:48 2011 @@ -27,7 +27,7 @@ org.apache.sling.jcr.resource -2.0.7-SNAPSHOT +2.0.8 bundle Apache Sling JCR Resource Resolver @@ -37,13 +37,13 @@ - scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/resource + scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.resource-2.0.8 - scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/resource + scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.resource-2.0.8 -http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource + http://svn.apache.org/viewvc/sling/tags/org.apache.sling.jcr.resource-2.0.8
svn commit: r1061749 - /sling/trunk/bundles/extensions/fsresource/pom.xml
Author: cziegeler Date: Fri Jan 21 11:13:59 2011 New Revision: 1061749 URL: http://svn.apache.org/viewvc?rev=1061749&view=rev Log: [maven-release-plugin] prepare for next development iteration Modified: sling/trunk/bundles/extensions/fsresource/pom.xml Modified: sling/trunk/bundles/extensions/fsresource/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/fsresource/pom.xml?rev=1061749&r1=1061748&r2=1061749&view=diff == --- sling/trunk/bundles/extensions/fsresource/pom.xml (original) +++ sling/trunk/bundles/extensions/fsresource/pom.xml Fri Jan 21 11:13:59 2011 @@ -28,7 +28,7 @@ org.apache.sling.fsresource bundle -1.0.2 +1.0.3-SNAPSHOT Apache Sling Filesystem Resource Provider @@ -37,9 +37,9 @@ - scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.fsresource-1.0.2 - scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.fsresource-1.0.2 - http://svn.apache.org/viewvc/sling/tags/org.apache.sling.fsresource-1.0.2 + scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/fsresource + scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/fsresource + http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/fsresource
svn commit: r1061748 - /sling/tags/org.apache.sling.fsresource-1.0.2/
Author: cziegeler Date: Fri Jan 21 11:13:54 2011 New Revision: 1061748 URL: http://svn.apache.org/viewvc?rev=1061748&view=rev Log: [maven-scm] copy for tag org.apache.sling.fsresource-1.0.2 Added: sling/tags/org.apache.sling.fsresource-1.0.2/ - copied from r1061747, sling/trunk/bundles/extensions/fsresource/
svn commit: r1061747 - /sling/trunk/bundles/extensions/fsresource/pom.xml
Author: cziegeler Date: Fri Jan 21 11:13:41 2011 New Revision: 1061747 URL: http://svn.apache.org/viewvc?rev=1061747&view=rev Log: [maven-release-plugin] prepare release org.apache.sling.fsresource-1.0.2 Modified: sling/trunk/bundles/extensions/fsresource/pom.xml Modified: sling/trunk/bundles/extensions/fsresource/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/fsresource/pom.xml?rev=1061747&r1=1061746&r2=1061747&view=diff == --- sling/trunk/bundles/extensions/fsresource/pom.xml (original) +++ sling/trunk/bundles/extensions/fsresource/pom.xml Fri Jan 21 11:13:41 2011 @@ -28,7 +28,7 @@ org.apache.sling.fsresource bundle -1.0.1-SNAPSHOT +1.0.2 Apache Sling Filesystem Resource Provider @@ -37,9 +37,9 @@ - scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/fsresource - scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/fsresource - http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/fsresource + scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.fsresource-1.0.2 + scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.fsresource-1.0.2 + http://svn.apache.org/viewvc/sling/tags/org.apache.sling.fsresource-1.0.2
svn commit: r1061744 - /sling/trunk/bundles/extensions/bundleresource/pom.xml
Author: cziegeler Date: Fri Jan 21 11:10:22 2011 New Revision: 1061744 URL: http://svn.apache.org/viewvc?rev=1061744&view=rev Log: [maven-release-plugin] prepare for next development iteration Modified: sling/trunk/bundles/extensions/bundleresource/pom.xml Modified: sling/trunk/bundles/extensions/bundleresource/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/bundleresource/pom.xml?rev=1061744&r1=1061743&r2=1061744&view=diff == --- sling/trunk/bundles/extensions/bundleresource/pom.xml (original) +++ sling/trunk/bundles/extensions/bundleresource/pom.xml Fri Jan 21 11:10:22 2011 @@ -28,7 +28,7 @@ org.apache.sling.bundleresource.impl bundle -2.0.6 +2.0.7-SNAPSHOT Apache Sling Bundle Resource Provider @@ -38,13 +38,13 @@ - scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.bundleresource.impl-2.0.6 + scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/bundleresource - scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.bundleresource.impl-2.0.6 + scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/bundleresource - http://svn.apache.org/viewvc/sling/tags/org.apache.sling.bundleresource.impl-2.0.6 + http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/bundleresource
svn commit: r1061743 - /sling/tags/org.apache.sling.bundleresource.impl-2.0.6/
Author: cziegeler Date: Fri Jan 21 11:10:18 2011 New Revision: 1061743 URL: http://svn.apache.org/viewvc?rev=1061743&view=rev Log: [maven-scm] copy for tag org.apache.sling.bundleresource.impl-2.0.6 Added: sling/tags/org.apache.sling.bundleresource.impl-2.0.6/ - copied from r1061742, sling/trunk/bundles/extensions/bundleresource/
svn commit: r1061742 - /sling/trunk/bundles/extensions/bundleresource/pom.xml
Author: cziegeler Date: Fri Jan 21 11:10:04 2011 New Revision: 1061742 URL: http://svn.apache.org/viewvc?rev=1061742&view=rev Log: [maven-release-plugin] prepare release org.apache.sling.bundleresource.impl-2.0.6 Modified: sling/trunk/bundles/extensions/bundleresource/pom.xml Modified: sling/trunk/bundles/extensions/bundleresource/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/bundleresource/pom.xml?rev=1061742&r1=1061741&r2=1061742&view=diff == --- sling/trunk/bundles/extensions/bundleresource/pom.xml (original) +++ sling/trunk/bundles/extensions/bundleresource/pom.xml Fri Jan 21 11:10:04 2011 @@ -28,7 +28,7 @@ org.apache.sling.bundleresource.impl bundle -2.0.5-SNAPSHOT +2.0.6 Apache Sling Bundle Resource Provider @@ -38,13 +38,13 @@ - scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/bundleresource + scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.bundleresource.impl-2.0.6 - scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/bundleresource + scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.bundleresource.impl-2.0.6 - http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/bundleresource + http://svn.apache.org/viewvc/sling/tags/org.apache.sling.bundleresource.impl-2.0.6
svn commit: r1061707 - in /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl: PersistentResourceList.java RegisteredResourceImpl.java
Author: cziegeler Date: Fri Jan 21 09:41:42 2011 New Revision: 1061707 URL: http://svn.apache.org/viewvc?rev=1061707&view=rev Log: SLING-1945 : Remove resource from untransformed resources if resource is removed by provider Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResourceImpl.java Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java?rev=1061707&r1=1061706&r2=1061707&view=diff == --- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java (original) +++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java Fri Jan 21 09:41:42 2011 @@ -191,6 +191,10 @@ public class PersistentResourceList { t.addOrUpdate(input); } else { +// check if there is an old resource and remove it first +if ( this.untransformedResources.contains(input) ) { +this.untransformedResources.remove(input); +} this.untransformedResources.add(input); } } @@ -203,13 +207,25 @@ public class PersistentResourceList { } /** - * Remove a resource by url + * Remove a resource by url. + * Check all resource groups and the list of untransformed resources. * @param url The url to remove */ public void remove(final String url) { +// iterate over all resource groups and remove resources +// with the given url for(final EntityResourceList group : this.data.values()) { group.remove(url); } +// iterate over untransformed resources and remove +// the resource with that url +for(final RegisteredResource rr : this.untransformedResources) { +if ( rr.getURL().equals(url) ) { +((RegisteredResourceImpl)rr).cleanup(); +this.untransformedResources.remove(rr); +break; +} +} } /** Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResourceImpl.java URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResourceImpl.java?rev=1061707&r1=1061706&r2=1061707&view=diff == --- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResourceImpl.java (original) +++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResourceImpl.java Fri Jan 21 09:41:42 2011 @@ -293,7 +293,7 @@ public class RegisteredResourceImpl return false; } if ( this.entity == null ) { -return super.equals(obj); +return this.getURL().equals(((RegisteredResourceImpl)obj).getURL()); } return compareTo((RegisteredResourceImpl)obj) == 0; }
svn commit: r1061701 - in /sling/trunk/installer/core/src/main/java/org/apache/sling/installer: api/tasks/TransformationResult.java core/impl/DefaultTransformer.java core/impl/PersistentResourceList.j
Author: cziegeler Date: Fri Jan 21 09:21:22 2011 New Revision: 1061701 URL: http://svn.apache.org/viewvc?rev=1061701&view=rev Log: SLING-1944 : Check result from resource transformer Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TransformationResult.java sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/DefaultTransformer.java sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TransformationResult.java URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TransformationResult.java?rev=1061701&r1=1061700&r2=1061701&view=diff == --- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TransformationResult.java (original) +++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TransformationResult.java Fri Jan 21 09:21:22 2011 @@ -23,6 +23,13 @@ import java.util.Map; /** * A result of a {@link ResourceTransformer}. + * + * In most cases the new transformation result just contains new + * content (provided through {@link #getInputStream()}. + * + * However, if the transformer is able to detect the new resource + * type and sets it, it must also provide a unique id ( + * {@link #getResourceType()} and {@link #getId()}. */ public class TransformationResult { Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/DefaultTransformer.java URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/DefaultTransformer.java?rev=1061701&r1=1061700&r2=1061701&view=diff == --- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/DefaultTransformer.java (original) +++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/DefaultTransformer.java Fri Jan 21 09:21:22 2011 @@ -44,7 +44,7 @@ public class DefaultTransformer /** * @see org.apache.sling.installer.core.impl.InternalService#init(org.osgi.framework.BundleContext) */ -public void init(BundleContext bctx) { +public void init(final BundleContext bctx) { // nothing to do } Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java?rev=1061701&r1=1061700&r2=1061701&view=diff == --- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java (original) +++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java Fri Jan 21 09:21:22 2011 @@ -256,6 +256,17 @@ public class PersistentResourceList { this.untransformedResources.remove(resource); try { for(int i=0; i
svn commit: r1061697 - /sling/trunk/installer/core/pom.xml
Author: cziegeler Date: Fri Jan 21 09:07:11 2011 New Revision: 1061697 URL: http://svn.apache.org/viewvc?rev=1061697&view=rev Log: SLING-1942 : Include ServiceTracker in Bundle Modified: sling/trunk/installer/core/pom.xml Modified: sling/trunk/installer/core/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/pom.xml?rev=1061697&r1=1061696&r2=1061697&view=diff == --- sling/trunk/installer/core/pom.xml (original) +++ sling/trunk/installer/core/pom.xml Fri Jan 21 09:07:11 2011 @@ -61,7 +61,10 @@ org.apache.sling.installer.api;version=3.0.0, org.apache.sling.installer.api.tasks;version=1.0.0 - org.apache.sling.installer.core.impl.* + + org.apache.sling.installer.core.impl.*, +org.osgi.util.tracker + org.apache.felix.configadmin;inline="org/apache/felix/cm/file/ConfigurationHandler.*"