public class DefaultSql2oFactory extends AbstractObjectFactory<org.sql2o.Sql2o> implements Sql2oFactory
KEY_DEFAULT
Constructor and Description |
---|
DefaultSql2oFactory(Configuration configuration,
GriffonApplication application) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeDataSource(String dataSourceName) |
org.sql2o.Sql2o |
create(String name) |
protected org.sql2o.Sql2o |
createSql2o(String dataSourceName,
Map<String,Object> config) |
void |
destroy(String name,
org.sql2o.Sql2o instance) |
Map<String,Object> |
getConfigurationFor(String datasourceName) |
protected DataSource |
getDataSource(String dataSourceName) |
Set<String> |
getDatasourceNames() |
protected String |
getPluralKey() |
protected String |
getSingleKey() |
event, getApplication, getConfiguration, narrowConfig
@Inject public DefaultSql2oFactory(@Nonnull @Named(value="datasource") Configuration configuration, @Nonnull GriffonApplication application)
@Nonnull public Set<String> getDatasourceNames()
getDatasourceNames
in interface Sql2oFactory
@Nonnull public Map<String,Object> getConfigurationFor(@Nonnull String datasourceName)
getConfigurationFor
in interface Sql2oFactory
@Nonnull protected String getSingleKey()
getSingleKey
in class AbstractObjectFactory<org.sql2o.Sql2o>
@Nonnull protected String getPluralKey()
getPluralKey
in class AbstractObjectFactory<org.sql2o.Sql2o>
@Nonnull public org.sql2o.Sql2o create(@Nonnull String name)
create
in interface ObjectFactory<org.sql2o.Sql2o>
public void destroy(@Nonnull String name, @Nonnull org.sql2o.Sql2o instance)
destroy
in interface ObjectFactory<org.sql2o.Sql2o>
@Nonnull protected org.sql2o.Sql2o createSql2o(@Nonnull String dataSourceName, @Nonnull Map<String,Object> config)
@Nonnull protected DataSource getDataSource(@Nonnull String dataSourceName)