On Thu, Feb 11, 2010 at 10:46 AM, Ruwan Linton <ruwan.lin...@gmail.com>wrote:

>
>
> On Thu, Feb 11, 2010 at 10:10 AM, Isuru Suriarachchi <isur...@gmail.com>wrote:
>
>>
>>
>> On Thu, Feb 11, 2010 at 10:05 AM, Amila Suriarachchi <
>> amilasuriarach...@gmail.com> wrote:
>>
>>>
>>>
>>> On Thu, Feb 11, 2010 at 8:11 AM, Ruwan Linton <ruwan.lin...@gmail.com>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;
>>>>
>>>> <deployer extension="xml" directory="conf/synapse-config/sequences"
>>>> 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 <deployer>)
>>>>     private void loadOtherDirectories() {
>>>>         for (Map.Entry<String, Map<String, Deployer>> entry :
>>>> deploymentEngine.getDeployers().entrySet()) {
>>>>             String directory = entry.getKey();
>>>>             Map<String, Deployer> 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.

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

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: ru...@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: ru...@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: ru...@wso2.com; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com

Reply via email to