Hi Manoj,

Let me clarify my situation a bit further.

I want to read some properties from the carbon.xml, from outside the JVM
running Carbon. The value for <CARBON_HOME> is not available to me, so my
main concern is locating the carbon.xml file from an external context.

The single instance of the ServerConfiguration is created as the class is
loaded. But I can't find a usage where the initialized object's*
init(filepath) *method is invoked. I guess it must be a trivial case from
within the JVM.

I checked if any services are exposed to outside by Carbon relating to the
ServerConfiguration, but so far I was able to find none.

If there is no way to get the value for CARBON_HOME, it will have to be
provided from outside. I'm looking for a better way than that.



Regards,
Chamila de Alwis
Software Engineer | WSO2 | +94772207163
Blog: code.chamiladealwis.com



On Thu, Oct 2, 2014 at 8:43 AM, Manoj Gunawardena <[email protected]> wrote:

> Hi,
>
> I also writing a code to read a configuration files exists in the
> repository/conf folder. I am planning to use ServerConfiguration class as
> follows.
> Pass the configuration file, which i want to load, into init method and
> get the properties list.
> The serverconfiguartion class uses singleton pattern.  Also init method is
> synchronized. Therefore, can be use to load multiple configuration files at
> different occasions.
>
>
> ex -: ServerConfiguration serverConfiguration =
> ServerConfiguration.getInstance();
>
>        serverConfiguration.init("InputStrem to  conf file");
>        serverConfiguration.getProperties("prop key")
>
>
> Please correct me, if i am wrong.
>
> Thanks
>
>
>
> On Thu, Oct 2, 2014 at 1:05 AM, Chamila De Alwis <[email protected]>
> wrote:
>
>> Hi,
>>
>> I've been going through the ServerConfiguration class, to understand how
>> it is being initiated and configurations are loaded.
>>
>> The init() method initializes and starts reading and loading the
>> properties. And it uses "conf/carbon.xml" as the default value for the
>> configuration XML file.
>>
>> What I don't understand is how and when ServerConfiguration classes's
>> init is called, and it's mechanism to set the context to
>> <CARBON_HOME>/repository/.
>>
>> I'm in the process of writing a component in Python which requires access
>> to the server configuration properties, however I have yet to find a way to
>> retrieve the path to carbon.xml.
>>
>>
>> Regards,
>> Chamila de Alwis
>> Software Engineer | WSO2 | +94772207163
>> Blog: code.chamiladealwis.com
>>
>>
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Manoj Gunawardena
> Tech Lead
> WSO2, Inc.: http://wso2.com
> lean.enterprise.middleware
> Mobile : +94 77 2291643
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to