Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 36732 invoked from network); 28 May 2009 11:57:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 May 2009 11:57:44 -0000 Received: (qmail 17366 invoked by uid 500); 28 May 2009 11:57:55 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 17267 invoked by uid 500); 28 May 2009 11:57:55 -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 17258 invoked by uid 99); 28 May 2009 11:57:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 11:57:55 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of andreas.veithen@gmail.com designates 209.85.220.170 as permitted sender) Received: from [209.85.220.170] (HELO mail-fx0-f170.google.com) (209.85.220.170) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 11:57:47 +0000 Received: by fxm18 with SMTP id 18so5584307fxm.16 for ; Thu, 28 May 2009 04:57:25 -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=k9Pw5LNf/DiJioxsulHWMg/V0dD675R9lnb8hfZr4+Y=; b=rBu9MjFpUVAGzLuD2EEF5u56EQyCbaxrdLd9wiOKFVRVuHSIeWYEpnWx49hYXrgYIv HDnkSabT/RxmKtbTNwN1KYNYGsYy8UQ/zr1ZUyNKmP1rKhNZg4jLTDsc/zSeB6unCkyk FbMa4yAFIRnMUmWS8brf1v+oRO6Uac9fOvigs= 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=u/1T/knJ6ulV4xcQToFbn1oNCGG6c48EFd2f8ZfC3h2DUe96gR2oysk5ULHjOq7ZGE k/qnHdFKU7dtB8zLbmXQI/Rd3syXLxL/lbqMYALZT0wo4fZdo7ESPLSo0t63lkhGTlnM QW/GKPE9GzJG15DgD3tgAvmvFz5TBmhJXY2bU= MIME-Version: 1.0 Received: by 10.239.136.194 with SMTP id i2mr82361hbi.76.1243511845535; Thu, 28 May 2009 04:57:25 -0700 (PDT) In-Reply-To: <60708f4b0905280436l743effbcvb850793fe52fee5b@mail.gmail.com> References: <20090528093156.7F2B92388897@eris.apache.org> <60708f4b0905280436l743effbcvb850793fe52fee5b@mail.gmail.com> Date: Thu, 28 May 2009 13:57:25 +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 It's on my todo list. Andreas On Thu, May 28, 2009 at 13:36, Amila Suriarachchi wrote: > > > On Thu, May 28, 2009 at 4:30 PM, Andreas Veithen > wrote: >> >> -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. > > Could you please attach a patch for the better way you suggest? > > then we can compare the two and go the the best one. > > thanks, > Amila. >> >> * 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, =A0 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: >> > >> > =A0webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/de= scription/AxisDescription.java >> > >> > =A0webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/de= scription/AxisServiceGroup.java >> > >> > =A0webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/en= gine/AxisConfiguration.java >> > >> > =A0webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/en= gine/AxisEvent.java >> > >> > Modified: >> > webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/descr= iption/AxisDescription.java >> > URL: >> > http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kern= el/src/org/apache/axis2/description/AxisDescription.java?rev=3D779507&r1=3D= 779506&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/descr= iption/AxisDescription.java >> > (original) >> > +++ >> > webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/descr= iption/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 AxisFau= lt { >> > =A0 =A0 =A0 =A0 engageModule(axisModule, this); >> > + =A0 =A0 =A0 =A0AxisConfiguration config =3D getAxisConfiguration(); >> > + =A0 =A0 =A0 =A0config.notifyObservers(new AxisEvent(AxisEvent.MODULE= _ENGAGED , >> > 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 AxisSe= rvice 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 >> > AxisEvent(AxisEvent.MODULE_DISENGAGED, this), module); >> > =A0 =A0 =A0 =A0 } >> > =A0 =A0 } >> > >> > >> > Modified: >> > webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/descr= iption/AxisServiceGroup.java >> > URL: >> > http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kern= el/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/descr= iption/AxisServiceGroup.java >> > (original) >> > +++ >> > webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/descr= iption/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) { >> > - >> > =A0getAxisConfiguration().notifyObservers(AxisEvent.SERVICE_REMOVE, se= rvice); >> > + =A0 =A0 =A0 =A0 =A0 =A0getAxisConfiguration().notifyObservers(new >> > AxisEvent(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/axis2/engin= e/AxisConfiguration.java >> > URL: >> > http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kern= el/src/org/apache/axis2/engine/AxisConfiguration.java?rev=3D779507&r1=3D779= 506&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/engin= e/AxisConfiguration.java >> > (original) >> > +++ >> > webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engin= e/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= ,null), >> > module); >> > >> > =A0 =A0 =A0 =A0 // Registering the policy namespaces that the module u= nderstand >> > =A0 =A0 =A0 =A0 registerModulePolicySupport(module); >> > @@ -332,7 +332,7 @@ >> > =A0 =A0 public synchronized void addServiceGroup(AxisServiceGroup >> > axisServiceGroup) >> > =A0 =A0 =A0 =A0 =A0 =A0 throws AxisFault { >> > =A0 =A0 =A0 =A0 axisServiceGroup.setParent(this); >> > - =A0 =A0 =A0 =A0notifyObservers(AxisEvent.SERVICE_DEPLOY, axisService= Group); >> > + =A0 =A0 =A0 =A0notifyObservers(new AxisEvent(AxisEvent.SERVICE_DEPLO= Y, >> > axisServiceGroup), axisServiceGroup); >> > =A0 =A0 =A0 =A0 AxisService axisService; >> > >> > =A0 =A0 =A0 =A0 Iterator services =3D axisServiceGroup.ge= tServices(); >> > @@ -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_DEP= LOY, axisService); >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0notifyObservers(new AxisEvent(AxisEve= nt.SERVICE_DEPLOY >> > ,axisService ), axisService); >> > =A0 =A0 =A0 =A0 =A0 =A0 } >> > =A0 =A0 =A0 =A0 } >> > =A0 =A0 =A0 =A0 // serviceGroups.put(axisServiceGroup.getServiceGroupN= ame(), >> > @@ -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_REM= OVE, axisService); >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0notifyObservers(new AxisEvent(AxisEve= nt.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, >> > axisServiceGroup); >> > + =A0 =A0 =A0 =A0 =A0 =A0notifyObservers(new AxisEvent(AxisEvent.SERVI= CE_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 servi= ce) { >> > + =A0 =A0public void notifyObservers(AxisEvent event, AxisService serv= ice) { >> > =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 >> > serviceGroup) { >> > - =A0 =A0 =A0 =A0AxisEvent event =3D new AxisEvent(event_type); >> > + =A0 =A0public void notifyObservers(AxisEvent event, AxisServiceGroup >> > serviceGroup) { >> > >> > =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 = , >> > service), 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 >> > namesapce) { >> > >> > Modified: >> > webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engin= e/AxisEvent.java >> > URL: >> > http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kern= el/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/engin= e/AxisEvent.java >> > (original) >> > +++ >> > webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engin= e/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 axisDescrip= tion) >> > { >> > =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} >> > >> > >> > > > > > -- > Amila Suriarachchi > WSO2 Inc. > blog: http://amilachinthaka.blogspot.com/ >