Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 285E110498 for ; Sat, 1 Nov 2014 23:26:39 +0000 (UTC) Received: (qmail 36181 invoked by uid 500); 1 Nov 2014 23:26:33 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 36102 invoked by uid 500); 1 Nov 2014 23:26:33 -0000 Mailing-List: contact dev-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 dev@felix.apache.org Received: (qmail 36090 invoked by uid 99); 1 Nov 2014 23:26:33 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Nov 2014 23:26:33 +0000 Date: Sat, 1 Nov 2014 23:26:33 +0000 (UTC) From: "Pierre De Rop (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (FELIX-4158) ComponentDeclaration should give access to component information MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14193567#comment-14193567 ] Pierre De Rop edited comment on FELIX-4158 at 11/1/14 11:25 PM: ---------------------------------------------------------------- Committed a patch in revision 1636069 for this issue, and also the corresponding test case in [1]. The component implementation class name and the provided services were already returned by the ComponentDeclaration.getClassName() and ComponentDeclaration.getServices() methods. For the dependency class name and dependency filter, I just added the following signatures in the ComponentDependencyDeclaration interface: - ComponentDependencyDeclaration.getSimpleName(): only returns the dependency name (it does not include the filters, unlike the getName() method does). - ComponentDependencyDeclaration.getFilter(): returns the dependency filter. (see the FELIX4158_DependencyDeclarationTest for examples). [1] http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX4158_DependencyDeclarationTest.java was (Author: pderop): Committed a patch in revision 1636069 for this issue, and also the corresponding test case in [1]. The component implementation class name and the provided services was already returned by ComponentDeclaration.getClassName() and ComponentDeclaration.getServices() methods. For the dependency class name and dependency filter, I just added the following signatures in the ComponentDependencyDeclaration interface: - ComponentDependencyDeclaration.getSimpleName(): only returns the dependency name (it does not include the filters, unlike the getName() method does). - ComponentDependencyDeclaration.getFilter(): returns the dependency filter. (see the FELIX4158_DependencyDeclarationTest for examples). [1] http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX4158_DependencyDeclarationTest.java > ComponentDeclaration should give access to component information > ---------------------------------------------------------------- > > Key: FELIX-4158 > URL: https://issues.apache.org/jira/browse/FELIX-4158 > Project: Felix > Issue Type: Improvement > Components: Dependency Manager > Reporter: Arjun Panday > Priority: Minor > Fix For: dependencymanager-4.0.0 > > > DependencyManager has a ComponentDeclaration and ComponentDependencyDeclaration interface to get information about the components it manages, but these interfaces don't have a explicit access to the implementation class, the exposed interfaces or the dependency filter. > For now, one can only parse Component.toString to find the services and implementation (assuming the implementation doesn't override its toString method), and parse ComponentDependencyDeclaration.getName to find the requested service and filter. This kind of parsing is naturally very unsafe and dependent on the implementation details. > I suggest to add the following methods: > ComponentDeclaration.getImplementation should return the implementation class name > ComponentDeclaration.getServices should return a list of interfaces declared by the component > ComponentDependencyDeclaration.getService should return the requested service name (interface) > ComponentDependencyDeclaration.getFilter should return the associated filter > Although minor, these changes would be very useful. (My immediate need is for the improvement of the service diagnostics webconsole plugin) -- This message was sent by Atlassian JIRA (v6.3.4#6332)