Return-Path: X-Original-To: apmail-karaf-dev-archive@minotaur.apache.org Delivered-To: apmail-karaf-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CE33B9FA3 for ; Thu, 10 May 2012 07:53:09 +0000 (UTC) Received: (qmail 15965 invoked by uid 500); 10 May 2012 07:53:09 -0000 Delivered-To: apmail-karaf-dev-archive@karaf.apache.org Received: (qmail 15347 invoked by uid 500); 10 May 2012 07:53:07 -0000 Mailing-List: contact dev-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list dev@karaf.apache.org Received: (qmail 15301 invoked by uid 99); 10 May 2012 07:53:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 07:53:06 +0000 X-ASF-Spam-Status: No, hits=-0.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cschneider111@googlemail.com designates 209.85.214.48 as permitted sender) Received: from [209.85.214.48] (HELO mail-bk0-f48.google.com) (209.85.214.48) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 07:53:01 +0000 Received: by bkcjf20 with SMTP id jf20so1402738bkc.21 for ; Thu, 10 May 2012 00:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=UXQ1Z2MgOAlPefAxZV8dUjmIa5KUktu7/fscGyCF19k=; b=FtJPLyTrRFwjeEmlyvR0kk4Vq/lNnxlK8QkJoecmzIPRs/OirYl6klicQzmOa9hvb/ NcCKd3g4QpUHFvxbUXbOkhrUurdHacJn1WJtah6fqgdDlvNuEjg/B4VsyLpe/63jrY8C THaXkCivWByg48zyFhqO73KNYQXCNq/QWQz5BTDQvOTBROIljafQPZmR1tpYWfTc3Qcb k04Wu6xaosHrDUHb2W/Dw4fgkYvq884M6pNbsd/ful3WoSOHSGyawCfaWIN0Nilvrzm5 UBOsLu+mNvFG8Fz0dJqWhirAOfSdIIJ0ZYKDxgaYg10i2NK3HfTF9lMWpO3Yo6wjuN9Z W34A== Received: by 10.205.139.81 with SMTP id iv17mr1206797bkc.118.1336636359437; Thu, 10 May 2012 00:52:39 -0700 (PDT) Received: from [10.0.0.103] (HSI-KBW-46-223-138-180.hsi.kabel-badenwuerttemberg.de. [46.223.138.180]) by mx.google.com with ESMTPS id n17sm9771093bkw.5.2012.05.10.00.52.37 (version=SSLv3 cipher=OTHER); Thu, 10 May 2012 00:52:38 -0700 (PDT) Sender: Christian Schneider Message-ID: <4FAB73C1.60205@die-schneider.net> Date: Thu, 10 May 2012 09:52:33 +0200 From: Christian Schneider User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: dev@karaf.apache.org Subject: Re: Simpler karaf shell command/action definition References: <4FAA8870.90606@die-schneider.net> <4FAA933B.504@die-schneider.net> <4FAA9851.8010109@die-schneider.net> <4FAAA26F.4060704@die-schneider.net> <4FAB5C3C.1090508@die-schneider.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I used the blueprint annotations that should be available in the next aries release. From the snytax I would prefer CDI annotations but I do not think the frameworks for CDI are ready for OSGi at the moment. On the other hand I do not really want to get rid of blueprint at this point. For example I think it makes a lot of sense to define references to external services in the blueprint context and use @Inject in the commands to reference them. I think at the moment there is a lot of movement around annotations in OSGi so probably we simply wait a bit before switching larger chunks of the Karaf code. Still we could provide the layer that takes the services and creates the commands out of them. So people could start experimenting with it. Christian Am 10.05.2012 08:29, schrieb Guillaume Nodet: > I would not try to add real injection annotations unless we either have > them supported by blueprint or switch to a different framework, so the > @Service @Completer and @Inject are not a good idea now. > If we want to get rid of blueprint, I'd consider standardizing around the > CDI annotations, but we need to find a framework that plays nicely with > OSGi first (or implement it in aries blueprint). > > On Thu, May 10, 2012 at 8:12 AM, Christian Schneider< > chris@die-schneider.net> wrote: > >> I must have missed that. In this case we do not need to hurry with a new >> schema. I will >> prepare a schema and some demo code as soon as 3.0 is out. >> >> At the moment I think the best starting point is this for the xml: >> >> >> >> >> >> >> >> For the annotation based config we could do something like: >> >> |@Command(scope = "test", name = "hello", description="Says hello") >> @Completer{beanId="**myCompleter"} >> @Service >> public class HelloShellCommand implements Action { >> >> @Inject(ref="|**blueprintBundleContext|") >> BundleContext context; >> >> @Override >> protected Object doExecute() throws Exception { >> System.out.println("Executing Hello command"); >> return null; >> } >> }| >> >> >> Btw. the annotation based config would allow to have a parent class with a >> common service that gets injected. So not every command has to do it. I >> think it might >> make a lot off sense to use annotation based config in karaf itself as it >> requires much less code. It also reacts nicer when doing refactorings as it >> cant happen that you still >> refer to the old class name. >> >> Christian >> >> Am 09.05.2012 19:50, schrieb Guillaume Nodet: >> >> The 1.1.0 version has already been released from the 2.x branch, so it has >>> to be a 1.2 if we keep the old elements in the same schema, or a 2.0 if we >>> remove the old elements from the schema (even if the handler >>> implementation >>> supports both namespaces). >>> >>> On Wed, May 9, 2012 at 6:59 PM, Christian Schneider>> *net >>> >>> >> -- >> >> Christian Schneider >> http://www.liquid-reality.de >> >> Open Source Architect >> Talend Application Integration Division http://www.talend.com >> >> > -- Christian Schneider http://www.liquid-reality.de Open Source Architect Talend Application Integration Division http://www.talend.com