Return-Path: Delivered-To: apmail-incubator-beehive-user-archive@www.apache.org Received: (qmail 3156 invoked from network); 16 Aug 2005 15:08:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Aug 2005 15:08:25 -0000 Received: (qmail 60676 invoked by uid 500); 16 Aug 2005 15:08:24 -0000 Delivered-To: apmail-incubator-beehive-user-archive@incubator.apache.org Received: (qmail 60560 invoked by uid 500); 16 Aug 2005 15:08:23 -0000 Mailing-List: contact beehive-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Beehive Users" Delivered-To: mailing list beehive-user@incubator.apache.org Received: (qmail 60469 invoked by uid 99); 16 Aug 2005 15:08:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Aug 2005 08:08:23 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of kentaminator@gmail.com designates 64.233.162.199 as permitted sender) Received: from [64.233.162.199] (HELO zproxy.gmail.com) (64.233.162.199) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Aug 2005 08:08:42 -0700 Received: by zproxy.gmail.com with SMTP id o1so929604nzf for ; Tue, 16 Aug 2005 08:08:20 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hm8Tp2GB0VxdT9eA4BOK+BLhrduXFQNFwCTAEiPnd+WcvlZjq/1pqTJMT0N3jjToeGLjY9xRigiTxEZQhVUT06NQJ7NKTPhPoVd7bgE+menYdtepHKefDtKmgX5v5tj9wwCcpoi31P97xjncy0FcnrLZTbJIkEc3c6d1XySsTgA= Received: by 10.37.14.76 with SMTP id r76mr4571149nzi; Tue, 16 Aug 2005 08:08:20 -0700 (PDT) Received: by 10.36.128.10 with HTTP; Tue, 16 Aug 2005 08:08:20 -0700 (PDT) Message-ID: Date: Tue, 16 Aug 2005 08:08:20 -0700 From: Kenneth Tam To: Beehive Users Subject: Re: Control: annotation based injection In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Antony, Can you provide some more detail on the scenario you're interested in? You can think of controls as JavaBeans with a variable amount of "container" provided functionality. As such, using them can be as simple as instantiating a JavaBean via existing JavaBean instantiation mechanisms such as java.beans.Beans.instantiate or . The controls model provides more "advanced" instantiation APIs in org.apache.beehive.controls.api.bean.Controls (for example, this allows explicit setting of initial properties and the container context). Any Java file/class can also participate in declarative controls initialization, where you simply annotate a field whose type is a control or a control interface with @Control -- when such a file is processed with APT, a helper class is created with a single method that knows how to inject all the controls in the original client. One of the first features that control containers typically provide is support for automatically calling that helper; that's what allows e.g. controls, pageflows and Beehive webservices to support @Control-annotated fields seamlessly to the user. The other major feature that control containers provide is context management; not all controls need this, but features like control lifecycle callbacks, external property override, etc, don't work without it. Beehive comes with a servlet filter that provides such container services -- this means any webapp code can be controls-enabled simply by adding a filter to web.xml. See org.apache.beehive.controls.runtime.servlet.ControlFilter. hope this helps, k On 8/12/05, Antony Chien wrote: > Hello everybody: > I'm quite interested in the feature that beehive provides, especially the > annotation based dependency injection. > However, how do I make sure that this feature is available wherever I wan= t? > I mean, can I just take a POJO and add an annotation to call a Control? I= s > that possible? > If not, then how do I prepare a right environment? >=20 > -- > Regards, > Antony Chien >=20 >