public class GenericDbConfig extends Object implements DbConfig, Initialisable
PHASE_NAME
Constructor and Description |
---|
GenericDbConfig(DataSource dataSource,
String name,
DbTypeManager dbTypeManager) |
Modifier and Type | Method and Description |
---|---|
protected DataSource |
createDataSource() |
TransactionalDbConnectionFactory |
getConnectionFactory() |
DataSource |
getDataSource() |
DbTypeManager |
getDbTypeManager() |
org.mule.common.Result<org.mule.common.metadata.MetaData> |
getMetaData(org.mule.common.metadata.MetaDataKey metaDataKey) |
org.mule.common.Result<List<org.mule.common.metadata.MetaDataKey>> |
getMetaDataKeys() |
String |
getName() |
void |
initialise()
Method used to perform any initialisation work.
|
void |
setConnectionTimeout(int connectionTimeout) |
void |
setDriverClassName(String driverClassName) |
void |
setMuleContext(MuleContext muleContext) |
void |
setPassword(String password) |
void |
setPoolingProfile(DbPoolingProfile poolingProfile) |
void |
setRetryPolicyTemplate(RetryPolicyTemplate retryPolicyTemplate) |
void |
setTransactionIsolation(int transactionIsolation) |
void |
setUrl(String url) |
void |
setUsername(String username) |
void |
setUseXaTransactions(boolean useXaTransactions) |
org.mule.common.TestResult |
test() |
public GenericDbConfig(DataSource dataSource, String name, DbTypeManager dbTypeManager)
public String getName()
public DataSource getDataSource()
getDataSource
in interface DbConfig
DataSource
to access the databasepublic TransactionalDbConnectionFactory getConnectionFactory()
getConnectionFactory
in interface DbConfig
DbConnectionFactory
used to create connections for the databasepublic DbTypeManager getDbTypeManager()
public org.mule.common.TestResult test()
test
in interface org.mule.common.Testable
public org.mule.common.Result<List<org.mule.common.metadata.MetaDataKey>> getMetaDataKeys()
getMetaDataKeys
in interface org.mule.common.metadata.ConnectorMetaDataEnabled
public org.mule.common.Result<org.mule.common.metadata.MetaData> getMetaData(org.mule.common.metadata.MetaDataKey metaDataKey)
getMetaData
in interface org.mule.common.metadata.ConnectorMetaDataEnabled
public void initialise() throws InitialisationException
Initialisable
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.initialise
in interface Initialisable
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdownRecoverableException
- if an error occurs that can be recovered fromprotected DataSource createDataSource() throws Exception
Exception
public void setPoolingProfile(DbPoolingProfile poolingProfile)
public void setUseXaTransactions(boolean useXaTransactions)
public void setUrl(String url)
public void setConnectionTimeout(int connectionTimeout)
public void setUsername(String username)
public void setPassword(String password)
public void setTransactionIsolation(int transactionIsolation)
public void setDriverClassName(String driverClassName)
public void setMuleContext(MuleContext muleContext)
public void setRetryPolicyTemplate(RetryPolicyTemplate retryPolicyTemplate)
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.