i'm interested in creating DataSources for tyrex domains dynamically as well as through the configuration file.
I think the correct process is something like:
create an EnabledDataSource
get the Resources from the domain
use the Resources addConfiguration method to add a ResourceConfig object to the Resources.
if this is correct i'm not sure what to do with the ResourceConfig object.
if this is not correct would love a pointer to a simple example or code snippet showing how to do this.
thanks,
jason
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The ResourceConfig contains the factory for creating the actual resource. In your case the factory is the EnabledDataSource.
So off the top of my head:
create an EnabledDataSource
create a tyrex.resources.jdbc.DataSourceConfig
dataSourceConfig.setFactory(enabledDataSource);
dataSourceConfig.setName(<uniqueName>);
dataSourceConfig.getResource(domain);
// at this point the connection pool will be set for
// the enabled data source
Riad
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i'm interested in creating DataSources for tyrex domains dynamically as well as through the configuration file.
I think the correct process is something like:
create an EnabledDataSource
get the Resources from the domain
use the Resources addConfiguration method to add a ResourceConfig object to the Resources.
if this is correct i'm not sure what to do with the ResourceConfig object.
if this is not correct would love a pointer to a simple example or code snippet showing how to do this.
thanks,
jason
Hi Jason,
Sorry for the late reply.
The ResourceConfig contains the factory for creating the actual resource. In your case the factory is the EnabledDataSource.
So off the top of my head:
create an EnabledDataSource
create a tyrex.resources.jdbc.DataSourceConfig
dataSourceConfig.setFactory(enabledDataSource);
dataSourceConfig.setName(<uniqueName>);
dataSourceConfig.getResource(domain);
// at this point the connection pool will be set for
// the enabled data source
Riad