Return-Path: Delivered-To: apmail-avalon-dev-archive@www.apache.org Received: (qmail 41733 invoked from network); 9 Mar 2004 15:18:19 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 9 Mar 2004 15:18:19 -0000 Received: (qmail 41835 invoked by uid 500); 9 Mar 2004 15:18:07 -0000 Delivered-To: apmail-avalon-dev-archive@avalon.apache.org Received: (qmail 41783 invoked by uid 500); 9 Mar 2004 15:18:07 -0000 Mailing-List: contact dev-help@avalon.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon Developers List" Reply-To: "Avalon Developers List" Delivered-To: mailing list dev@avalon.apache.org Received: (qmail 41742 invoked from network); 9 Mar 2004 15:18:07 -0000 Received: from unknown (HELO smtp01.myhosting.com) (168.144.68.181) by daedalus.apache.org with SMTP; 9 Mar 2004 15:18:07 -0000 Received: from lagrange ([81.225.126.237]) by smtp01.myhosting.com (Merak 7.1.0) with ASMTP id DXA74513 for ; Tue, 09 Mar 2004 10:18:08 -0500 From: "Leo Sutic" To: "'Avalon Developers List'" Subject: RE: State of the Aspect Date: Tue, 9 Mar 2004 16:18:07 +0100 Message-ID: <007901c405e9$ba577870$0801a8c0@lagrange> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal In-Reply-To: <034f01c405e6$abdcd590$0600005a@adsnm.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N > From: Jonathan Hawkes [mailto:jhawkes@adsnm.com] > > public interface Aspect { > void setContainer(Container c); > } > > public interface Container { > void addContainerServicesListener(ContainerServicesListener l); } > > > Something like the java.beans.context package? Registered > aspects can peruse or register to be notified of particular > containment services? That would put a burden on the container to maintain a list of services exposed and so on, and a burden on the aspect to "pull" services from the container. I was more thinking like this: Any aspect that can be monitored exposes a Monitorable interface. When you add a LoggerAspect, it will iterate over all existing aspects and connect to them via the Monitorable interface. public interface Monitorable { // Get the interface the monitor must implement public Class getMonitorClass (); // sets the monitor. It is guaranteed to implement the // interface given by the getMonitorClass method public void setMonitor (Object monitor); } The aspect would then do: forall Aspect a in allCurrentAspects: if a instanceof Monitorable Class monitorClass = a.getMonitorClass(); Object loggerMonitor = createLoggerMonitor (monitorClass); // loggerMonitor implements monitorClass a.setMonitor (loggerMonitor); Thus, the logger/monitor aspect pushes services to those that want it. /LS --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org For additional commands, e-mail: dev-help@avalon.apache.org