[Registry-dev] Registry as a library inside other products

Paul Fremantle paul at wso2.com
Mon Dec 3 01:19:17 PST 2007


I'm bothered about the "fallback" to an inmemory database. I don't think 
that makes sense as something to do automatically.

Surely its better for a user to explicitly try to start the JDBCReg and 
if that fails catch the exception or null and then create an in-mem Reg?

Paul

Sanjiva Weerawarana wrote:
> +1 for 3 alternative constructors. Since the registry is unusable until 
> init'ed, IMO constructors make more sense.
> 
> Thanks,
> 
> Sanjiva.
> 
> Chathura C. Ekanayake wrote:
>>
>> We want to allow users to configure registry database in different 
>> ways (e.g. using a data source, using a connection URL, specify 
>> whether to start in-memory database if other database is not available).
>>
>> So we provide few methods in the JDBCRegistry to configure them. We 
>> only want the registry to initialize after those parameters are 
>> configured.
>> And we don't know whether the user is specifying them or not at the 
>> construction time. Therefore, user has to call init() after 
>> configuring them.
>>
>> Alternative would be to have 3 constructors.
>>
>> 1) JDBCRegistry() - Use default datasource name if available. If not 
>> available, use in-memory DB
>>
>> 2) JDBCRegistry(String datasourceName, boolean allowInMemoryDB) - Use 
>> given data source. If not available, use in-memory DB depending on the 
>> allowInMemoryDB parameter value
>>
>> 3) JDBCRegistry(String driverClass, String URL, String userName, 
>> String password, boolean allowInMemoryDB) - Use given connection URL 
>> to connect to the DB
>>
>> Thanks,
>> Chathura
>>
>>
>> Paul Fremantle wrote:
>>>
>>>
>>> Chathura C. Ekanayake wrote:
>>>>
>>>> JDBCRegistry registry = new JDBCRegistry();
>>>> registry.init();
>>>
>>> Love it! That's what I was looking for.
>>>
>>> Last question - why do we need init()?
>>>
>>> Paul
>>>
>>> _______________________________________________
>>> Registry-dev mailing list
>>> Registry-dev at wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/registry-dev
>>>
>>
>>
>> _______________________________________________
>> Registry-dev mailing list
>> Registry-dev at wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/registry-dev
>>
> 

-- 
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

Office: +1 646 290 8050
Cell: +44 798 447 4618

blog: http://pzf.fremantle.org
paul at wso2.com

"Oxygenating the Web Service Platform", www.wso2.com



More information about the Registry-dev mailing list