Return-Path: Delivered-To: apmail-felix-commits-archive@www.apache.org Received: (qmail 60445 invoked from network); 12 Aug 2010 12:03:19 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Aug 2010 12:03:19 -0000 Received: (qmail 17561 invoked by uid 500); 12 Aug 2010 12:03:18 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 17468 invoked by uid 500); 12 Aug 2010 12:03:16 -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 17455 invoked by uid 99); 12 Aug 2010 12:03:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Aug 2010 12:03:15 +0000 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, 12 Aug 2010 12:03:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E280B238890B; Thu, 12 Aug 2010 12:01:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r984732 - /felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/ServiceDependency.java Date: Thu, 12 Aug 2010 12:01:57 -0000 To: commits@felix.apache.org From: pderop@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100812120157.E280B238890B@eris.apache.org> Author: pderop Date: Thu Aug 12 12:01:57 2010 New Revision: 984732 URL: http://svn.apache.org/viewvc?rev=984732&view=rev Log: improved javadoc Modified: felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/ServiceDependency.java Modified: felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/ServiceDependency.java URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/ServiceDependency.java?rev=984732&r1=984731&r2=984732&view=diff ============================================================================== --- felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/ServiceDependency.java (original) +++ felix/trunk/dependencymanager/annotation/src/main/java/org/apache/felix/dm/annotation/api/ServiceDependency.java Thu Aug 12 12:01:57 2010 @@ -118,34 +118,48 @@ public @interface ServiceDependency * *
      *  /**
-     *    * A Service whose service dependency filter/require attribute may be configured from ConfigAdmin
+     *    * A Service whose service dependency "otherService" filter is configured from ConfigAdmin
      *    */
      *  @Service
      *  class X {
      *      private Dictionary m_config;
      *      
+     *      /**
+     *       * Initialize our service from config ... and store the config for later usage (from our init method)
+     *       */ 
      *      @ConfigurationDependency(pid="MyPid")
      *      void configure(Dictionary conf) {
-     *           // Initialize our service from config ...
-     *           
-     *           // And store the config for later usage (from our init method)
      *           m_config = config;
      *      }
      * 
-     *      // This named dependency will be configured by our init method (see below).
-     *      @ServiceDependency(name="dependency1") 
-     *      void bindOtherService(OtherService other) {
-     *         // the filter and required flag will be configured from our init method.
-     *      }
-
-     *      // The returned Map will be used to configure our "dependency1" Dependency.
+     *      /**
+     *       * All unnamed dependencies are injected: we can now configure other named
+     *       * dependencies, using the already injected configuration.
+     *       * The returned Map will be used to configure our "otherService" Dependency.
+     *       */
      *      @Init
      *      Map init() {
      *          return new HashMap() {{
-     *              put("dependency1.filter", m_config.get("filter"));
-     *              put("dependency1.required", m_config.get("required"));
+     *              put("otherService.filter", m_config.get("filter"));
+     *              put("otherService.required", m_config.get("required"));
      *          }};
      *      } 
+     *
+     *      /**
+     *       * This named dependency filter/required flag will be configured by our init method (see above).
+     *       */
+     *      @ServiceDependency(name="otherService") 
+     *      void bindOtherService(OtherService other) {
+     *      }
+     *      
+     *      /**
+     *       * All dependencies are injected and our service is now ready to be published.
+     *       * Notice that you can also use the publisher service attribute if you need 
+     *       * to take control on service exposition.
+     *       */
+     *      @Start
+     *      void start() {
+     *      }
      *  }
      *  
*/