Return-Path: Delivered-To: apmail-felix-commits-archive@www.apache.org Received: (qmail 48184 invoked from network); 11 Sep 2008 15:19:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2008 15:19:56 -0000 Received: (qmail 27816 invoked by uid 500); 11 Sep 2008 15:19:36 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 27764 invoked by uid 500); 11 Sep 2008 15:19:36 -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 27419 invoked by uid 99); 11 Sep 2008 15:19:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 08:19:35 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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, 11 Sep 2008 15:18:45 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9055B238896C; Thu, 11 Sep 2008 08:19:17 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r694291 - in /felix/trunk/ipojo: core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java handler/temporal/NOTICE Date: Thu, 11 Sep 2008 15:19:16 -0000 To: commits@felix.apache.org From: clement@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080911151917.9055B238896C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: clement Date: Thu Sep 11 08:19:12 2008 New Revision: 694291 URL: http://svn.apache.org/viewvc?rev=694291&view=rev Log: Enable dynamic reconfiguration of service dependencies (for primitive types). Provide a method to invalidate the service object cache of a dependency. Modify the wrong header of the temporal dependency handler NOTICE file. Modified: felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java felix/trunk/ipojo/handler/temporal/NOTICE Modified: felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java?rev=694291&r1=694290&r2=694291&view=diff ============================================================================== --- felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java (original) +++ felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java Thu Sep 11 08:19:12 2008 @@ -395,12 +395,32 @@ /** * The dependency has been reconfigured. - * @param departs : service no more matching. + * Call unbind method and then bind methods. If the dependency cache is not reset, + * the thread continues to get older services. + * @param departs : no more matching services. * @param arrivals : new services * @see org.apache.felix.ipojo.util.DependencyModel#onDependencyReconfiguration(org.osgi.framework.ServiceReference[], org.osgi.framework.ServiceReference[]) */ public void onDependencyReconfiguration(ServiceReference[] departs, ServiceReference[] arrivals) { - throw new UnsupportedOperationException("Dependency set change is not yet supported"); + for (int i = 0; departs != null && i < departs.length; i++) { + callUnbindMethod(departs[i]); + } + + for (int i = 0; arrivals != null && i < arrivals.length; i++) { + callBindMethod(arrivals[i]); + } + } + + /** + * Reset the thread local cache if used. + */ + public void resetLocalCache() { + if (m_usage != null) { + Usage usage = (Usage) m_usage.get(); + if (usage.m_stack > 0) { + createServiceObject(usage); + } + } } /** Modified: felix/trunk/ipojo/handler/temporal/NOTICE URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/temporal/NOTICE?rev=694291&r1=694290&r2=694291&view=diff ============================================================================== --- felix/trunk/ipojo/handler/temporal/NOTICE (original) +++ felix/trunk/ipojo/handler/temporal/NOTICE Thu Sep 11 08:19:12 2008 @@ -1,4 +1,4 @@ -Apache Felix iPOJO White-board Pattern Handler +Apache Felix iPOJO Temporal Dependency Handler Copyright 2008 The Apache Software Foundation I. Included Software