Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 5087 invoked from network); 11 Feb 2010 05:23:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Feb 2010 05:23:35 -0000 Received: (qmail 11270 invoked by uid 500); 11 Feb 2010 05:23:35 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 10879 invoked by uid 500); 11 Feb 2010 05:23:34 -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 10870 invoked by uid 99); 11 Feb 2010 05:23:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Feb 2010 05:23:34 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ruwan.linton@gmail.com designates 209.85.221.194 as permitted sender) Received: from [209.85.221.194] (HELO mail-qy0-f194.google.com) (209.85.221.194) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Feb 2010 05:23:24 +0000 Received: by qyk32 with SMTP id 32so577624qyk.18 for ; Wed, 10 Feb 2010 21:23:03 -0800 (PST) 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; bh=9nlq2tG7C619bOMEwHFy3nM+19dL/Qnco0U1Q37z8Xg=; b=oxLqOU3oUJ102UHafuT6JSmMGCamjNqqN121WJYEiyOa/Qc3TphD7aCQbUWgRb+STW mHBLvMOf+63JvsyCMJYY4QqYNRPGDjLA0jtSPFhPYwn6x4QVX/ojnGEq1OShA+2Y/asW E8QgKgRmmYgd63enhne2XSjLkLzvtE/fSFAkw= 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; b=XgchJS6UTMIM0vr/AAJh2gPwETcu57GSFCZcr8/uHghSceAcx3BH91m3dUKiRR1SLW T4pLP588sXhYW8892nLOWFLMksgCSygP1t7uInfKHULAF5aDuKvSFUXa818YkPfeur0I J7QGi/QdbF7zEuxI/m1EGU2wOzFiy6r6E1WOY= MIME-Version: 1.0 Received: by 10.229.191.142 with SMTP id dm14mr596933qcb.39.1265865783209; Wed, 10 Feb 2010 21:23:03 -0800 (PST) In-Reply-To: <672a01201002102116u70b5ed12jd69fe0a7397a74b0@mail.gmail.com> References: <672a01201002101841n3f0af906m2bd6fc1ea7ce0f15@mail.gmail.com> <60708f4b1002102035p5c74a6f7m57ae5e56d736fc46@mail.gmail.com> <672a01201002102116u70b5ed12jd69fe0a7397a74b0@mail.gmail.com> Date: Thu, 11 Feb 2010 10:53:03 +0530 Message-ID: <672a01201002102123l69c560f3h560e68f99def5e5f@mail.gmail.com> Subject: Re: Axis2 Deployers doesn't support a directory within another directory under repository?? From: Ruwan Linton To: axis-dev@ws.apache.org Content-Type: multipart/alternative; boundary=001636284162576f0d047f4c5817 --001636284162576f0d047f4c5817 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Feb 11, 2010 at 10:46 AM, Ruwan Linton wrote: > > > On Thu, Feb 11, 2010 at 10:10 AM, Isuru Suriarachchi wrote: > >> >> >> On Thu, Feb 11, 2010 at 10:05 AM, Amila Suriarachchi < >> amilasuriarachchi@gmail.com> wrote: >> >>> >>> >>> On Thu, Feb 11, 2010 at 8:11 AM, Ruwan Linton wrote: >>> >>>> Folks, >>>> >>>> Synapse has a requirement to have a directory called conf/synapse-config >>>> in the repository and have its own space for sequences, endpoints, proxy >>>> services so forth inside that.. So the expected deployer config within the >>>> axis2.xml is as follows; >>>> >>>> >>> class="org.apache.synapse.deployers.SequenceDeployer"/> >>>> >>>> but because of the following code fragment it takes only the last >>>> director specified in the directory declaration of the deployer. Is there >>>> any reason for us to restrict the deployer to only one level, even in that >>>> case we should be treating the directory as the top level direcotry so that >>>> the path is correct, but here we are calculating a directory path which is >>>> not existing. With the above case it computes the directory as >>>> $AXIS2_REPOSITORY/sequences which is completely wrong :-( >>>> >>>> org.apache.axis2.deployment.RepositoryListener [267, 280] >>>> >>>> //This will load the files from the directories >>>> // specified by axis2.xml (As ) >>>> private void loadOtherDirectories() { >>>> for (Map.Entry> entry : >>>> deploymentEngine.getDeployers().entrySet()) { >>>> String directory = entry.getKey(); >>>> Map extensionMap = entry.getValue(); >>>> for (String extension : extensionMap.keySet()) { >>>> String[] strings = directory.split("/"); >>>> File dirToSearch = new >>>> File(deploymentEngine.getRepositoryDir(), >>>> strings[strings.length - 1]); >>>> findFileForGivenDirectory(dirToSearch, extension, >>>> directory); >>>> >>> I think it may work if you specify only 'conf' and above method finds it >>> recursively. >>> >> >> But if it is set to 'conf', the deployer will try to find sequences inside >> all sub directories of the 'conf' dir. Therefore it won't be a good solution >> I guess. >> >> +1 for removing this splitting code and supporting a '/' separated path >> for the directory attribute of the deployer, rather than only supporting one >> level. >> > > Yes, Isuru is correct. > > So inside the conf/synapse-config we have endpoints, proxy services, local > entries and so forth as well and they will be tried to build as sequences > and will be failed as well. Note that all these configurations are in .xml > extension and we cannot differentiate them with the extension. > > Let's remove the splitting if there is no valid reason to have that. I had > a look at the logic and there is no need to have this logic. Also the logic > is wrong, I think this has been introduced to detect the absolute path > provided as the directory case, where it should have been better handled > with the File operations :-) > Well, by looking at the JavaDoc for the two argument (File, String) File constructor we do not need to do anything special, File class handles it within the constructor. If the child * pathname string is absolute then it is converted into a relative * pathname in a system-dependent way. Thanks, Ruwan > > I will fix it, and will see if it breaks anything (I don't think so, > though) > > Thanks, > Ruwan > >> >> Thanks, >> ~Isuru >> >> >>> >>> +1 to remove spliting if there is no reason for that. >>> >>> thanks, >>> Amila. >>> >>>> } >>>> } >>>> } >>>> >>>> Can we get rid of the splitting and let the user declare inner >>>> directories for the artifacts to be deployed?? >>>> >>>> Thanks, >>>> Ruwan >>>> >>>> -- >>>> Ruwan Linton >>>> Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb >>>> WSO2 Inc.; http://wso2.org >>>> email: ruwan@wso2.com; cell: +94 77 341 3097 >>>> blog: http://ruwansblog.blogspot.com >>>> >>> >>> >>> >>> -- >>> Amila Suriarachchi >>> WSO2 Inc. >>> blog: http://amilachinthaka.blogspot.com/ >>> >> >> >> >> -- >> Senior Software Engineer, >> WSO2 Inc. http://wso2.org/ >> Blog : http://isurues.wordpress.com/ >> > > > > -- > Ruwan Linton > Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb > WSO2 Inc.; http://wso2.org > email: ruwan@wso2.com; cell: +94 77 341 3097 > blog: http://ruwansblog.blogspot.com > -- Ruwan Linton Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb WSO2 Inc.; http://wso2.org email: ruwan@wso2.com; cell: +94 77 341 3097 blog: http://ruwansblog.blogspot.com --001636284162576f0d047f4c5817 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Thu, Feb 11, 2010 at 10:46 AM, Ruwan = Linton <ruwa= n.linton@gmail.com> wrote:


On Thu, Feb 11, 2010 a= t 10:10 AM, Isuru Suriarachchi <isurues@gmail.com> wrote:


On Thu, Feb 11, 2010 at 10:05 AM, A= mila Suriarachchi <amilasuriarachchi@gmail.com> wr= ote:


On Thu, Feb 11, 2010 at 8:11 AM, Ru= wan Linton <ruwan.linton@gmail.com> wrote:
Folks,

Synapse has a requirement to have a directory called conf/syn= apse-config in the repository and have its own space for sequences, endpoin= ts, proxy services so forth inside that.. So the expected deployer config w= ithin the axis2.xml is as follows;

<deployer extension=3D"xml" directory=3D"conf/synapse= -config/sequences" class=3D"org.apache.synapse.deployers.Sequence= Deployer"/>

but because of the following code fragment it ta= kes only the last director specified in the directory declaration of the de= ployer. Is there any reason for us to restrict the deployer to only one lev= el, even in that case we should be treating the directory as the top level = direcotry so that the path is correct, but here we are calculating a direct= ory path which is not existing. With the above case it computes the directo= ry as $AXIS2_REPOSITORY/sequences which is completely wrong :-(

org.apache.axis2.deployment.RepositoryListener [267, 280]

//This= will load the files from the directories
=A0=A0=A0 // specified by axis= 2.xml (As <deployer>)
=A0=A0=A0 private void loadOtherDirectories(= ) {
=A0=A0=A0=A0=A0=A0=A0 for (Map.Entry<String, Map<String, Deployer>= > entry : deploymentEngine.getDeployers().entrySet()) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 String directory =3D entry.getKey();
= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Map<String, Deployer> extensionMap = =3D entry.getValue();
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 for (String exte= nsion : extensionMap.keySet()) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 String[] strings =3D directory.split("/");
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 File dirToSearch =3D new File= (deploymentEngine.getRepositoryDir(),
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 strings[strings.length - 1]);
=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 findFileForGivenDirectory(dirToS= earch, extension, directory);
I think it may work if you specify only 'conf&#= 39; and above method finds it recursively.

But if it is set to 'conf', the deployer will try to fin= d sequences inside all sub directories of the 'conf' dir. Therefore= it won't be a good solution I guess.

+1 for removing this splitting code and supporting a '/' separa= ted path for the directory attribute of the deployer, rather than only supp= orting one level.

Yes, Isuru is = correct.

So inside the conf/synapse-config we have endpoints, proxy services, lo= cal entries and so forth as well and they will be tried to build as sequenc= es and will be failed as well. Note that all these configurations are in .x= ml extension and we cannot differentiate them with the extension.

Let's remove the splitting if there is no valid reason to have that= . I had a look at the logic and there is no need to have this logic. Also t= he logic is wrong, I think this has been introduced to detect the absolute = path provided as the directory case, where it should have been better handl= ed with the File operations :-)

Well, by looking at the JavaDoc for the t= wo argument (File, String) File constructor we do not need to do anything s= pecial, File class handles it within the constructor.

<quote> = If the <code>child</code>
=A0=A0=A0=A0 * pathname string is absolute then it is converted into a rela= tive
=A0=A0=A0=A0 * pathname in a system-dependent way.
</quote>= ;

Thanks,
Ruwan
=A0

I will fix it, and will see if it breaks anything (I don't think so= , though)

Thanks,
Ruwan
<= div class=3D"im">

Thanks,
~Isuru
=A0

+1 to remove spliting if there is no re= ason for that.

thanks,
Amila.
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }
=A0=A0=A0=A0=A0=A0=A0 }
=A0=A0=A0= }

Can we get rid of the splitting and let the user declare inner di= rectories for the artifacts to be deployed??

Thanks,
Ruwan

--
Ruwan Linton
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email:
ruwan@wso2.= com; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com



--
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspo= t.com/



--
Senior Software Engineer,
WSO2 Inc. http://wso2.org/
Blog : http://isurues.wordpress.com/<= br>



--
Ruwan Linto= n
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: ruwan@wso2.com; cell: +94 77 3= 41 3097
blog: http://ruwansbl= og.blogspot.com
--001636284162576f0d047f4c5817--