Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 22803 invoked from network); 28 May 2009 11:01:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 May 2009 11:01:09 -0000 Received: (qmail 43264 invoked by uid 500); 28 May 2009 11:01:19 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 43173 invoked by uid 500); 28 May 2009 11:01:19 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 43130 invoked by uid 99); 28 May 2009 11:01:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 11:01:19 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of andreas.veithen@gmail.com designates 209.85.218.166 as permitted sender) Received: from [209.85.218.166] (HELO mail-bw0-f166.google.com) (209.85.218.166) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 11:01:09 +0000 Received: by bwz10 with SMTP id 10so5446941bwz.16 for ; Thu, 28 May 2009 04:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+EjVdjDRllB6VlvheroOHLFr6i2smDvd4yKLlyL6MUE=; b=ouQqkxs9hFfiXgSKc334ZtthcrS621fCCP5H9lIkKTYGr3st2T+kwlAzUObBWlq0uD yPVry076DOog9d3MY3Ba1CwuxbGtI1AvUILMqbl9GyH4n6klcq5vV5AewuxvFejlDLtg /r5ZyuK/S+hw1NR/3EO9+M9QhnN3VfRTrtQ/4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=gEgHdnl2eSga1KJ3evgVCKQ7gg/zVRfZvgOXtW3DmOrEN+duA8NjsH47CyUsbjmG82 U/STbKxk/4xR0D8+aMLRqGuU9020phMCYGAUDQHdSO5jNw7vHWAwquHMjx0pTqVGgMqr kZldNCP1CzNezVwt152WSvWC0zfwH9/CSVzoc= MIME-Version: 1.0 Received: by 10.239.171.148 with SMTP id w20mr86585hbe.171.1243508449234; Thu, 28 May 2009 04:00:49 -0700 (PDT) In-Reply-To: <20090528093156.7F2B92388897@eris.apache.org> References: <20090528093156.7F2B92388897@eris.apache.org> Date: Thu, 28 May 2009 13:00:49 +0200 Message-ID: Subject: Re: svn commit: r779507 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: description/AxisDescription.java description/AxisServiceGroup.java engine/AxisConfiguration.java engine/AxisEvent.java From: Andreas Veithen To: axis-dev@ws.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org -1 for this change. Reasons: * If you generate the Javadoc from this code, there is ZERO documentation for it. * As discussed previously, it is ugly and not generic enough. * There are at least two better solutions: add a specific method to AxisObserver or add a completely new type of event listener. Personally, I favor the second solution. Andreas On Thu, May 28, 2009 at 11:31, wrote: > Author: amilas > Date: Thu May 28 09:31:54 2009 > New Revision: 779507 > > URL: http://svn.apache.org/viewvc?rev=3D779507&view=3Drev > Log: > applied the patch for AXIS2-4347 > > Modified: > =A0 =A0webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/d= escription/AxisDescription.java > =A0 =A0webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/d= escription/AxisServiceGroup.java > =A0 =A0webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/e= ngine/AxisConfiguration.java > =A0 =A0webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/e= ngine/AxisEvent.java > > Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis= 2/description/AxisDescription.java > URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/ke= rnel/src/org/apache/axis2/description/AxisDescription.java?rev=3D779507&r1= =3D779506&r2=3D779507&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/desc= ription/AxisDescription.java (original) > +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/desc= ription/AxisDescription.java Thu May 28 09:31:54 2009 > @@ -27,6 +27,7 @@ > =A0import org.apache.axis2.AxisFault; > =A0import org.apache.axis2.Constants; > =A0import org.apache.axis2.engine.AxisConfiguration; > +import org.apache.axis2.engine.AxisEvent; > =A0import org.apache.axis2.i18n.Messages; > =A0import org.apache.axis2.modules.Module; > =A0import org.apache.axis2.util.JavaUtils; > @@ -436,6 +437,8 @@ > =A0 =A0 =A0*/ > =A0 =A0 public void engageModule(AxisModule axisModule) throws AxisFault = { > =A0 =A0 =A0 =A0 engageModule(axisModule, this); > + =A0 =A0 =A0 =A0AxisConfiguration config =3D getAxisConfiguration(); > + =A0 =A0 =A0 =A0config.notifyObservers(new AxisEvent(AxisEvent.MODULE_EN= GAGED , this) , axisModule); > =A0 =A0 } > > =A0 =A0 /** > @@ -513,6 +516,11 @@ > =A0 =A0 =A0 =A0 if (isEngaged(module)) { > =A0 =A0 =A0 =A0 =A0 =A0 onDisengage(module); > =A0 =A0 =A0 =A0 =A0 =A0 engagedModules.remove(module.getArchiveName()); > + =A0 =A0 =A0 =A0 =A0 =A0/** > + =A0 =A0 =A0 =A0 =A0 =A0 * if a Disengaged module belogs to an AxisServi= ce or an Operation > + =A0 =A0 =A0 =A0 =A0 =A0 * notify with a serviceUpdate > + =A0 =A0 =A0 =A0 =A0 =A0 */ > + =A0 =A0 =A0 =A0 =A0 =A0getAxisConfiguration().notifyObservers(new AxisE= vent(AxisEvent.MODULE_DISENGAGED, this), module); > =A0 =A0 =A0 =A0 } > =A0 =A0 } > > > Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis= 2/description/AxisServiceGroup.java > URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/ke= rnel/src/org/apache/axis2/description/AxisServiceGroup.java?rev=3D779507&r1= =3D779506&r2=3D779507&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/desc= ription/AxisServiceGroup.java (original) > +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/desc= ription/AxisServiceGroup.java Thu May 28 09:31:54 2009 > @@ -146,7 +146,8 @@ > =A0 =A0 =A0 =A0 AxisService service =3D getService(name); > > =A0 =A0 =A0 =A0 if (service !=3D null) { > - =A0 =A0 =A0 =A0 =A0 =A0getAxisConfiguration().notifyObservers(AxisEvent= .SERVICE_REMOVE, service); > + =A0 =A0 =A0 =A0 =A0 =A0getAxisConfiguration().notifyObservers(new AxisE= vent(AxisEvent.SERVICE_REMOVE,service), > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0service); > =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 removeChild(name); > > Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis= 2/engine/AxisConfiguration.java > URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/ke= rnel/src/org/apache/axis2/engine/AxisConfiguration.java?rev=3D779507&r1=3D7= 79506&r2=3D779507&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engi= ne/AxisConfiguration.java (original) > +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engi= ne/AxisConfiguration.java Thu May 28 09:31:54 2009 > @@ -247,7 +247,7 @@ > =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 allModules.put(module.getArchiveName(), module); > - =A0 =A0 =A0 =A0notifyObservers(AxisEvent.MODULE_DEPLOY, module); > + =A0 =A0 =A0 =A0notifyObservers(new AxisEvent(AxisEvent.MODULE_DEPLOY,nu= ll), module); > > =A0 =A0 =A0 =A0 // Registering the policy namespaces that the module unde= rstand > =A0 =A0 =A0 =A0 registerModulePolicySupport(module); > @@ -332,7 +332,7 @@ > =A0 =A0 public synchronized void addServiceGroup(AxisServiceGroup axisSer= viceGroup) > =A0 =A0 =A0 =A0 =A0 =A0 throws AxisFault { > =A0 =A0 =A0 =A0 axisServiceGroup.setParent(this); > - =A0 =A0 =A0 =A0notifyObservers(AxisEvent.SERVICE_DEPLOY, axisServiceGro= up); > + =A0 =A0 =A0 =A0notifyObservers(new AxisEvent(AxisEvent.SERVICE_DEPLOY, = axisServiceGroup), axisServiceGroup); > =A0 =A0 =A0 =A0 AxisService axisService; > > =A0 =A0 =A0 =A0 Iterator services =3D axisServiceGroup.getSe= rvices(); > @@ -395,7 +395,7 @@ > =A0 =A0 =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 =A0 =A0 if (!axisService.isClientSide()) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0notifyObservers(AxisEvent.SERVICE_DEPLOY= , axisService); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0notifyObservers(new AxisEvent(AxisEvent.= SERVICE_DEPLOY ,axisService ), axisService); > =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 // serviceGroups.put(axisServiceGroup.getServiceGroupName= (), > @@ -440,7 +440,7 @@ > =A0 =A0 =A0 =A0 =A0 =A0 AxisService axisService =3D services.next(); > =A0 =A0 =A0 =A0 =A0 =A0 allServices.remove(axisService.getName()); > =A0 =A0 =A0 =A0 =A0 =A0 if (!axisService.isClientSide()) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0notifyObservers(AxisEvent.SERVICE_REMOVE= , axisService); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0notifyObservers(new AxisEvent(AxisEvent.= SERVICE_REMOVE , axisService), axisService); > =A0 =A0 =A0 =A0 =A0 =A0 } else { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 isClientSide =3D true; > =A0 =A0 =A0 =A0 =A0 =A0 } > @@ -457,7 +457,7 @@ > =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 removeChild(serviceGroupName); > =A0 =A0 =A0 =A0 if (!isClientSide) { > - =A0 =A0 =A0 =A0 =A0 =A0notifyObservers(AxisEvent.SERVICE_REMOVE, axisSe= rviceGroup); > + =A0 =A0 =A0 =A0 =A0 =A0notifyObservers(new AxisEvent(AxisEvent.SERVICE_= REMOVE, axisServiceGroup), axisServiceGroup); > =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 return axisServiceGroup; > @@ -570,12 +570,10 @@ > =A0 =A0 =A0 =A0 } > =A0 =A0 } > > - =A0 =A0public void notifyObservers(int event_type, AxisService service)= { > + =A0 =A0public void notifyObservers(AxisEvent event, AxisService service= ) { > =A0 =A0 =A0 =A0 if (service.isClientSide()) > =A0 =A0 =A0 =A0 =A0 =A0 return; > > - =A0 =A0 =A0 =A0AxisEvent event =3D new AxisEvent(event_type); > - > =A0 =A0 =A0 =A0 for (AxisObserver observer : observersList) { > =A0 =A0 =A0 =A0 =A0 =A0 try { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 observer.serviceUpdate(event, service); > @@ -586,8 +584,7 @@ > =A0 =A0 =A0 =A0 } > =A0 =A0 } > > - =A0 =A0public void notifyObservers(int event_type, AxisModule moule) { > - =A0 =A0 =A0 =A0AxisEvent event =3D new AxisEvent(event_type); > + =A0 =A0public void notifyObservers(AxisEvent event, AxisModule moule) { > > =A0 =A0 =A0 =A0 for (AxisObserver anObserversList : observersList) { > > @@ -600,8 +597,7 @@ > =A0 =A0 =A0 =A0 } > =A0 =A0 } > > - =A0 =A0public void notifyObservers(int event_type, AxisServiceGroup ser= viceGroup) { > - =A0 =A0 =A0 =A0AxisEvent event =3D new AxisEvent(event_type); > + =A0 =A0public void notifyObservers(AxisEvent event, AxisServiceGroup se= rviceGroup) { > > =A0 =A0 =A0 =A0 for (AxisObserver anObserversList : observersList) { > > @@ -1143,7 +1139,7 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 serviceName)); > =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 service.setActive(false); > - =A0 =A0 =A0 =A0notifyObservers(AxisEvent.SERVICE_STOP, service); > + =A0 =A0 =A0 =A0notifyObservers(new AxisEvent(AxisEvent.SERVICE_STOP , s= ervice), service); > =A0 =A0 } > > =A0 =A0 public void startService(String serviceName) throws AxisFault { > @@ -1153,7 +1149,7 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 serviceName)); > =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 service.setActive(true); > - =A0 =A0 =A0 =A0notifyObservers(AxisEvent.SERVICE_START, service); > + =A0 =A0 =A0 =A0notifyObservers(new AxisEvent(AxisEvent.SERVICE_START , = service), service); > =A0 =A0 } > > =A0 =A0 public List getModulesForPolicyNamesapce(String names= apce) { > > Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis= 2/engine/AxisEvent.java > URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/ke= rnel/src/org/apache/axis2/engine/AxisEvent.java?rev=3D779507&r1=3D779506&r2= =3D779507&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engi= ne/AxisEvent.java (original) > +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engi= ne/AxisEvent.java Thu May 28 09:31:54 2009 > @@ -20,6 +20,8 @@ > > =A0package org.apache.axis2.engine; > > +import org.apache.axis2.description.AxisDescription; > + > =A0public class AxisEvent { > > =A0 =A0 /** > @@ -32,14 +34,30 @@ > =A0 =A0 public static final int SERVICE_START =3D 3; > =A0 =A0 public static final int MODULE_DEPLOY =3D 4; > =A0 =A0 public static final int MODULE_REMOVE =3D 5; > + =A0 =A0public static final int MODULE_ENGAGED =3D 6; > + =A0 =A0public static final int MODULE_DISENGAGED =3D 7; > + > + =A0 =A0/** > + =A0 =A0 * hold a reference to the AxisDiscription > + =A0 =A0 * that the AxisEvent must carry ot the Observer > + =A0 =A0 * this referrece can be null of not needed > + =A0 =A0 */ > + =A0 =A0private AxisDescription axisDiscription; > + > =A0 =A0 private int EVENT_TYPE; > > - =A0 =A0public AxisEvent(int EVENT_TYPE) { > + =A0 =A0public AxisEvent(int EVENT_TYPE , AxisDescription axisDescriptio= n) { > =A0 =A0 =A0 =A0 this.EVENT_TYPE =3D EVENT_TYPE; > + =A0 =A0 =A0 =A0this.axisDiscription =3D axisDiscription; > + > =A0 =A0 } > > =A0 =A0 public int getEventType() { > =A0 =A0 =A0 =A0 return EVENT_TYPE; > =A0 =A0 } > + > + =A0 =A0public AxisDescription getAxisDiscription() { > + =A0 =A0 =A0 return axisDiscription; > + =A0 =A0} > > =A0} > > >