Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7DC11200D60 for ; Fri, 1 Dec 2017 10:01:21 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7BFB4160C06; Fri, 1 Dec 2017 09:01:21 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BD8BC160BFB for ; Fri, 1 Dec 2017 10:01:20 +0100 (CET) Received: (qmail 56894 invoked by uid 500); 1 Dec 2017 09:01:19 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 56885 invoked by uid 99); 1 Dec 2017 09:01:19 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2017 09:01:19 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 8B8763A0047 for ; Fri, 1 Dec 2017 09:01:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1816813 - /felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceRuntimeImpl.java Date: Fri, 01 Dec 2017 09:01:15 -0000 To: commits@felix.apache.org From: cziegeler@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20171201090118.8B8763A0047@svn01-us-west.apache.org> archived-at: Fri, 01 Dec 2017 09:01:21 -0000 Author: cziegeler Date: Fri Dec 1 09:01:15 2017 New Revision: 1816813 URL: http://svn.apache.org/viewvc?rev=1816813&view=rev Log: Update change count handling Modified: felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceRuntimeImpl.java Modified: felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceRuntimeImpl.java URL: http://svn.apache.org/viewvc/felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceRuntimeImpl.java?rev=1816813&r1=1816812&r2=1816813&view=diff ============================================================================== --- felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceRuntimeImpl.java (original) +++ felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceRuntimeImpl.java Fri Dec 1 09:01:15 2017 @@ -131,23 +131,22 @@ public final class HttpServiceRuntimeImp { if ( reg != null ) { - boolean setProps = false; - final long count; + boolean setPropsDirectly = false; synchronized ( this ) { this.changeCount++; - count = this.changeCount; + final long count = this.changeCount; this.setAttribute(PROP_CHANGECOUNT, this.changeCount); - if ( this.updateChangeCountDelay > 0 && this.timer == null ) + if ( this.updateChangeCountDelay <= 0L ) { - this.timer = new Timer(); - } - if ( this.updateChangeCountDelay == 0L ) - { - setProps = true; + setPropsDirectly = true; } else { + if ( this.timer == null ) + { + this.timer = new Timer(); + } timer.schedule(new TimerTask() { @@ -174,8 +173,16 @@ public final class HttpServiceRuntimeImp }, this.updateChangeCountDelay); } } - if ( setProps ) { - reg.setProperties(getAttributes()); + if ( setPropsDirectly ) + { + try + { + reg.setProperties(getAttributes()); + } + catch ( final IllegalStateException ise) + { + // we ignore this as this might happen on shutdown + } } } }