Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-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 27C16104F3 for ; Tue, 18 Mar 2014 21:26:25 +0000 (UTC) Received: (qmail 45442 invoked by uid 500); 18 Mar 2014 21:26:24 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 45387 invoked by uid 500); 18 Mar 2014 21:26:23 -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 45193 invoked by uid 99); 18 Mar 2014 21:26:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Mar 2014 21:26:23 +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; Tue, 18 Mar 2014 21:26:21 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 38B16238897A; Tue, 18 Mar 2014 21:26:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1579044 - /felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/BundleDependency.java Date: Tue, 18 Mar 2014 21:26:01 -0000 To: commits@felix.apache.org From: pderop@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140318212601.38B16238897A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: pderop Date: Tue Mar 18 21:26:00 2014 New Revision: 1579044 URL: http://svn.apache.org/r1579044 Log: added BundleDependency from old codebase Added: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/BundleDependency.java Added: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/BundleDependency.java URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/BundleDependency.java?rev=1579044&view=auto ============================================================================== --- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/BundleDependency.java (added) +++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/BundleDependency.java Tue Mar 18 21:26:00 2014 @@ -0,0 +1,122 @@ +package dm; + +import org.osgi.framework.Bundle; + +import dm.admin.ComponentDependencyDeclaration; + +/** + * @author Felix Project Team + */ +public interface BundleDependency extends Dependency, ComponentDependencyDeclaration { + /** + * Sets the callbacks for this dependency. These callbacks can be used as hooks whenever a dependency is added or removed. + * When you specify callbacks, the auto configuration feature is automatically turned off, because we're assuming you don't + * need it in this case. + * + * @param added the method to call when a bundle was added + * @param removed the method to call when a bundle was removed + * @return the bundle dependency + */ + public BundleDependency setCallbacks(String added, String removed); + + /** + * Sets the callbacks for this dependency. These callbacks can be used as hooks whenever a dependency is added, changed or + * removed. When you specify callbacks, the auto configuration feature is automatically turned off, because we're assuming + * you don't need it in this case. + * + * @param added the method to call when a bundle was added + * @param changed the method to call when a bundle was changed + * @param removed the method to call when a bundle was removed + * @return the bundle dependency + */ + public BundleDependency setCallbacks(String added, String changed, String removed); + + /** + * Sets the callbacks for this dependency. These callbacks can be used as hooks whenever a dependency is added or removed. + * They are called on the instance you provide. When you specify callbacks, the auto configuration feature is automatically + * turned off, because we're assuming you don't need it in this case. + * + * @param instance the instance to call the callbacks on + * @param added the method to call when a bundle was added + * @param removed the method to call when a bundle was removed + * @return the bundle dependency + */ + public BundleDependency setCallbacks(Object instance, String added, String removed); + + /** + * Sets the callbacks for this dependency. These callbacks can be used as hooks whenever a dependency is added, changed or + * removed. They are called on the instance you provide. When you specify callbacks, the auto configuration feature is + * automatically turned off, because we're assuming you don't need it in this case. + * + * @param instance the instance to call the callbacks on + * @param added the method to call when a bundle was added + * @param changed the method to call when a bundle was changed + * @param removed the method to call when a bundle was removed + * @return the bundle dependency + */ + public BundleDependency setCallbacks(Object instance, String added, String changed, String removed); + + /** + * Enables auto configuration for this dependency. This means the component implementation (composition) will be + * injected with this bundle dependency automatically. + * + * @param autoConfig true to enable auto configuration + * @return the bundle dependency + */ + public BundleDependency setAutoConfig(boolean autoConfig); + + /** + * Sets the dependency to be required. + * + * @param required true if this bundle dependency is required + * @return the bundle dependency + */ + public BundleDependency setRequired(boolean required); + + /** + * Sets the bundle to depend on directly. + * + * @param bundle the bundle to depend on + * @return the bundle dependency + */ + public BundleDependency setBundle(Bundle bundle); + + /** + * Sets the filter condition to depend on. Filters are matched against the full manifest of a bundle. + * + * @param filter the filter condition + * @return the bundle dependency + * @throws IllegalArgumentException + */ + public BundleDependency setFilter(String filter) throws IllegalArgumentException; + + /** + * Sets the bundle state mask to depend on. The OSGi BundleTracker explains this mask in more detail, but + * it is basically a mask with flags for each potential state a bundle can be in. + * + * @param mask the mask to use + * @return the bundle dependency + */ + public BundleDependency setStateMask(int mask); + + /** + * Sets property propagation. If set to true any bundle manifest properties will be added + * to the service properties of the component that has this dependency (if it registers as a service). + * + * @param propagate true to propagate the bundle manifest properties + * @return the bundle dependency + */ + public BundleDependency setPropagate(boolean propagate); + + /** + * Sets an Object instance and a callback method used to propagate some properties to the provided service properties. + * The method will be invoked on the specified object instance and must have one of the following signatures:

+ *

  • Dictionary callback(ServiceReference, Object service) + *
  • Dictionary callback(ServiceReference) + *
+ * @param instance the Object instance which is used to retrieve propagated service properties + * @param method the method to invoke for retrieving the properties to be propagated to the service properties. + * @return this service dependency. + */ + public BundleDependency setPropagate(Object instance, String method); +}