Return-Path: X-Original-To: apmail-sling-commits-archive@www.apache.org Delivered-To: apmail-sling-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8AC37959B for ; Thu, 9 Feb 2012 11:02:57 +0000 (UTC) Received: (qmail 75874 invoked by uid 500); 9 Feb 2012 11:02:56 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 75800 invoked by uid 500); 9 Feb 2012 11:02:53 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 75792 invoked by uid 99); 9 Feb 2012 11:02:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Feb 2012 11:02:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Feb 2012 11:02:48 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4B50D2388865; Thu, 9 Feb 2012 11:02:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1242275 - /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java Date: Thu, 09 Feb 2012 11:02:28 -0000 To: commits@sling.apache.org From: cziegeler@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120209110228.4B50D2388865@eris.apache.org> Author: cziegeler Date: Thu Feb 9 11:02:27 2012 New Revision: 1242275 URL: http://svn.apache.org/viewvc?rev=1242275&view=rev Log: SLING-2409 : If configuration is removed by config admin, state of provided artifact should either be uninstalled or ignored 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=1242275&r1=1242274&r2=1242275&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 Thu Feb 9 11:02:27 2012 @@ -900,7 +900,14 @@ public class OsgiInstallerImpl key = resourceType + ':' + resourceId; final TaskResource tr = erl.getFirstResource(); if ( tr != null ) { - if ( tr.getState() != ResourceState.IGNORED ) { + if ( tr.getState() == ResourceState.IGNORED ) { + // if it has been ignored before, we activate it now again! + ((RegisteredResourceImpl)tr).setState(ResourceState.INSTALL); + this.persistentList.save(); + this.scheduleRetry(); + } else if ( tr.getState() == ResourceState.UNINSTALLED ) { + // it has already been removed - nothing do to + } else { final UpdateHandler handler = this.findHandler(tr.getScheme()); if ( handler == null ) { // set to ignored @@ -919,12 +926,9 @@ public class OsgiInstallerImpl ((RegisteredResourceImpl)tr).setState(ResourceState.IGNORED); } } - } else { - // if it has been ignored before, we activate it now again! - ((RegisteredResourceImpl)tr).setState(ResourceState.INSTALL); + this.persistentList.save(); + this.scheduleRetry(); } - this.persistentList.save(); - this.scheduleRetry(); } } }