org.apache.openejb.config.typed
Class DataSourceBuilder

java.lang.Object
  extended by org.apache.openejb.config.sys.AbstractService
      extended by org.apache.openejb.config.sys.Resource
          extended by org.apache.openejb.config.typed.DataSourceBuilder
All Implemented Interfaces:
Service

public class DataSourceBuilder
extends Resource


Field Summary
 
Fields inherited from class org.apache.openejb.config.sys.Resource
aliases, jndi, postConstruct, preDestroy
 
Fields inherited from class org.apache.openejb.config.sys.AbstractService
className, classpath, constructor, factoryName, id, jar, properties, provider, type
 
Constructor Summary
DataSourceBuilder()
           
 
Method Summary
 boolean getAccessToUnderlyingConnectionAllowed()
           
 String getConnectionProperties()
           
 boolean getDefaultAutoCommit()
           
 String getDefaultReadOnly()
           
 String getDefinition()
           
 boolean getIgnoreDefaultValues()
           
 int getInitialSize()
           
 String getJdbcDriver()
           
 URI getJdbcUrl()
           
 boolean getJtaManaged()
           
 int getMaxActive()
           
 int getMaxIdle()
           
 int getMaxOpenPreparedStatements()
           
 Duration getMaxWaitTime()
           
 Duration getMinEvictableIdleTime()
           
 int getMinIdle()
           
 int getNumTestsPerEvictionRun()
           
 String getPassword()
           
 String getPasswordCipher()
           
 boolean getPoolPreparedStatements()
           
 Properties getProperties()
          Gets the value of the properties property.
 String getServiceId()
           
 boolean getTestOnBorrow()
           
 boolean getTestOnReturn()
           
 boolean getTestWhileIdle()
           
 Duration getTimeBetweenEvictionRuns()
           
 String getUserName()
           
 String getValidationQuery()
           
 DataSourceBuilder id(String id)
           
 void setAccessToUnderlyingConnectionAllowed(boolean accessToUnderlyingConnectionAllowed)
           
 void setConnectionProperties(String connectionProperties)
           
 void setDefaultAutoCommit(boolean defaultAutoCommit)
           
 void setDefaultReadOnly(String defaultReadOnly)
           
 void setDefinition(String definition)
           
 void setIgnoreDefaultValues(boolean ignoreDefaultValues)
           
 void setInitialSize(int initialSize)
           
 void setJdbcDriver(String jdbcDriver)
           
 void setJdbcUrl(URI jdbcUrl)
           
 void setJtaManaged(boolean jtaManaged)
           
 void setMaxActive(int maxActive)
           
 void setMaxIdle(int maxIdle)
           
 void setMaxOpenPreparedStatements(int maxOpenPreparedStatements)
           
 void setMaxWaitTime(Duration maxWaitTime)
           
 void setMaxWaitTime(long time, TimeUnit unit)
           
 void setMinEvictableIdleTime(Duration minEvictableIdleTime)
           
 void setMinEvictableIdleTime(long time, TimeUnit unit)
           
 void setMinIdle(int minIdle)
           
 void setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
           
 void setPassword(String password)
           
 void setPasswordCipher(String passwordCipher)
           
 void setPoolPreparedStatements(boolean poolPreparedStatements)
           
 void setServiceId(String serviceId)
           
 void setTestOnBorrow(boolean testOnBorrow)
           
 void setTestOnReturn(boolean testOnReturn)
           
 void setTestWhileIdle(boolean testWhileIdle)
           
 void setTimeBetweenEvictionRuns(Duration timeBetweenEvictionRuns)
           
 void setTimeBetweenEvictionRuns(long time, TimeUnit unit)
           
 void setUserName(String userName)
           
 void setValidationQuery(String validationQuery)
           
 DataSourceBuilder withAccessToUnderlyingConnectionAllowed(boolean accessToUnderlyingConnectionAllowed)
           
 DataSourceBuilder withConnectionProperties(String connectionProperties)
           
 DataSourceBuilder withDefaultAutoCommit(boolean defaultAutoCommit)
           
 DataSourceBuilder withDefaultReadOnly(String defaultReadOnly)
           
 DataSourceBuilder withDefinition(String definition)
           
 DataSourceBuilder withIgnoreDefaultValues(boolean ignoreDefaultValues)
           
 DataSourceBuilder withInitialSize(int initialSize)
           
 DataSourceBuilder withJdbcDriver(String jdbcDriver)
           
 DataSourceBuilder withJdbcUrl(URI jdbcUrl)
           
 DataSourceBuilder withJtaManaged(boolean jtaManaged)
           
 DataSourceBuilder withMaxActive(int maxActive)
           
 DataSourceBuilder withMaxIdle(int maxIdle)
           
 DataSourceBuilder withMaxOpenPreparedStatements(int maxOpenPreparedStatements)
           
 DataSourceBuilder withMaxWaitTime(Duration maxWaitTime)
           
 DataSourceBuilder withMaxWaitTime(long time, TimeUnit unit)
           
 DataSourceBuilder withMinEvictableIdleTime(Duration minEvictableIdleTime)
           
 DataSourceBuilder withMinEvictableIdleTime(long time, TimeUnit unit)
           
 DataSourceBuilder withMinIdle(int minIdle)
           
 DataSourceBuilder withNumTestsPerEvictionRun(int numTestsPerEvictionRun)
           
 DataSourceBuilder withPassword(String password)
           
 DataSourceBuilder withPasswordCipher(String passwordCipher)
           
 DataSourceBuilder withPoolPreparedStatements(boolean poolPreparedStatements)
           
 DataSourceBuilder withServiceId(String serviceId)
           
 DataSourceBuilder withTestOnBorrow(boolean testOnBorrow)
           
 DataSourceBuilder withTestOnReturn(boolean testOnReturn)
           
 DataSourceBuilder withTestWhileIdle(boolean testWhileIdle)
           
 DataSourceBuilder withTimeBetweenEvictionRuns(Duration timeBetweenEvictionRuns)
           
 DataSourceBuilder withTimeBetweenEvictionRuns(long time, TimeUnit unit)
           
 DataSourceBuilder withUserName(String userName)
           
 DataSourceBuilder withValidationQuery(String validationQuery)
           
 
Methods inherited from class org.apache.openejb.config.sys.Resource
equals, getAliases, getJndi, getPostConstruct, getPreDestroy, hashCode, setJndi, setPostConstruct, setPreDestroy
 
Methods inherited from class org.apache.openejb.config.sys.AbstractService
getClassName, getClasspath, getConstructor, getFactoryName, getId, getJar, getPropertiesProvider, getProvider, getType, setClassName, setClasspath, setConstructor, setFactoryName, setId, setJar, setPropertiesProvider, setProvider, setType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceBuilder

public DataSourceBuilder()
Method Detail

id

public DataSourceBuilder id(String id)

withServiceId

public DataSourceBuilder withServiceId(String serviceId)

setServiceId

public void setServiceId(String serviceId)

getServiceId

public String getServiceId()

withDefinition

public DataSourceBuilder withDefinition(String definition)

setDefinition

public void setDefinition(String definition)

getDefinition

public String getDefinition()

withJtaManaged

public DataSourceBuilder withJtaManaged(boolean jtaManaged)

setJtaManaged

public void setJtaManaged(boolean jtaManaged)

getJtaManaged

public boolean getJtaManaged()

withJdbcDriver

public DataSourceBuilder withJdbcDriver(String jdbcDriver)

setJdbcDriver

public void setJdbcDriver(String jdbcDriver)

getJdbcDriver

public String getJdbcDriver()

withJdbcUrl

public DataSourceBuilder withJdbcUrl(URI jdbcUrl)

setJdbcUrl

public void setJdbcUrl(URI jdbcUrl)

getJdbcUrl

public URI getJdbcUrl()

withUserName

public DataSourceBuilder withUserName(String userName)

setUserName

public void setUserName(String userName)

getUserName

public String getUserName()

withPassword

public DataSourceBuilder withPassword(String password)

setPassword

public void setPassword(String password)

getPassword

public String getPassword()

withPasswordCipher

public DataSourceBuilder withPasswordCipher(String passwordCipher)

setPasswordCipher

public void setPasswordCipher(String passwordCipher)

getPasswordCipher

public String getPasswordCipher()

withConnectionProperties

public DataSourceBuilder withConnectionProperties(String connectionProperties)

setConnectionProperties

public void setConnectionProperties(String connectionProperties)

getConnectionProperties

public String getConnectionProperties()

withDefaultAutoCommit

public DataSourceBuilder withDefaultAutoCommit(boolean defaultAutoCommit)

setDefaultAutoCommit

public void setDefaultAutoCommit(boolean defaultAutoCommit)

getDefaultAutoCommit

public boolean getDefaultAutoCommit()

withDefaultReadOnly

public DataSourceBuilder withDefaultReadOnly(String defaultReadOnly)

setDefaultReadOnly

public void setDefaultReadOnly(String defaultReadOnly)

getDefaultReadOnly

public String getDefaultReadOnly()

withInitialSize

public DataSourceBuilder withInitialSize(int initialSize)

setInitialSize

public void setInitialSize(int initialSize)

getInitialSize

public int getInitialSize()

withMaxActive

public DataSourceBuilder withMaxActive(int maxActive)

setMaxActive

public void setMaxActive(int maxActive)

getMaxActive

public int getMaxActive()

withMaxIdle

public DataSourceBuilder withMaxIdle(int maxIdle)

setMaxIdle

public void setMaxIdle(int maxIdle)

getMaxIdle

public int getMaxIdle()

withMinIdle

public DataSourceBuilder withMinIdle(int minIdle)

setMinIdle

public void setMinIdle(int minIdle)

getMinIdle

public int getMinIdle()

withMaxWaitTime

public DataSourceBuilder withMaxWaitTime(Duration maxWaitTime)

setMaxWaitTime

public void setMaxWaitTime(Duration maxWaitTime)

getMaxWaitTime

public Duration getMaxWaitTime()

withMaxWaitTime

public DataSourceBuilder withMaxWaitTime(long time,
                                         TimeUnit unit)

setMaxWaitTime

public void setMaxWaitTime(long time,
                           TimeUnit unit)

withValidationQuery

public DataSourceBuilder withValidationQuery(String validationQuery)

setValidationQuery

public void setValidationQuery(String validationQuery)

getValidationQuery

public String getValidationQuery()

withTestOnBorrow

public DataSourceBuilder withTestOnBorrow(boolean testOnBorrow)

setTestOnBorrow

public void setTestOnBorrow(boolean testOnBorrow)

getTestOnBorrow

public boolean getTestOnBorrow()

withTestOnReturn

public DataSourceBuilder withTestOnReturn(boolean testOnReturn)

setTestOnReturn

public void setTestOnReturn(boolean testOnReturn)

getTestOnReturn

public boolean getTestOnReturn()

withTestWhileIdle

public DataSourceBuilder withTestWhileIdle(boolean testWhileIdle)

setTestWhileIdle

public void setTestWhileIdle(boolean testWhileIdle)

getTestWhileIdle

public boolean getTestWhileIdle()

withTimeBetweenEvictionRuns

public DataSourceBuilder withTimeBetweenEvictionRuns(Duration timeBetweenEvictionRuns)

setTimeBetweenEvictionRuns

public void setTimeBetweenEvictionRuns(Duration timeBetweenEvictionRuns)

getTimeBetweenEvictionRuns

public Duration getTimeBetweenEvictionRuns()

withTimeBetweenEvictionRuns

public DataSourceBuilder withTimeBetweenEvictionRuns(long time,
                                                     TimeUnit unit)

setTimeBetweenEvictionRuns

public void setTimeBetweenEvictionRuns(long time,
                                       TimeUnit unit)

withNumTestsPerEvictionRun

public DataSourceBuilder withNumTestsPerEvictionRun(int numTestsPerEvictionRun)

setNumTestsPerEvictionRun

public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun)

getNumTestsPerEvictionRun

public int getNumTestsPerEvictionRun()

withMinEvictableIdleTime

public DataSourceBuilder withMinEvictableIdleTime(Duration minEvictableIdleTime)

setMinEvictableIdleTime

public void setMinEvictableIdleTime(Duration minEvictableIdleTime)

getMinEvictableIdleTime

public Duration getMinEvictableIdleTime()

withMinEvictableIdleTime

public DataSourceBuilder withMinEvictableIdleTime(long time,
                                                  TimeUnit unit)

setMinEvictableIdleTime

public void setMinEvictableIdleTime(long time,
                                    TimeUnit unit)

withPoolPreparedStatements

public DataSourceBuilder withPoolPreparedStatements(boolean poolPreparedStatements)

setPoolPreparedStatements

public void setPoolPreparedStatements(boolean poolPreparedStatements)

getPoolPreparedStatements

public boolean getPoolPreparedStatements()

withMaxOpenPreparedStatements

public DataSourceBuilder withMaxOpenPreparedStatements(int maxOpenPreparedStatements)

setMaxOpenPreparedStatements

public void setMaxOpenPreparedStatements(int maxOpenPreparedStatements)

getMaxOpenPreparedStatements

public int getMaxOpenPreparedStatements()

withAccessToUnderlyingConnectionAllowed

public DataSourceBuilder withAccessToUnderlyingConnectionAllowed(boolean accessToUnderlyingConnectionAllowed)

setAccessToUnderlyingConnectionAllowed

public void setAccessToUnderlyingConnectionAllowed(boolean accessToUnderlyingConnectionAllowed)

getAccessToUnderlyingConnectionAllowed

public boolean getAccessToUnderlyingConnectionAllowed()

withIgnoreDefaultValues

public DataSourceBuilder withIgnoreDefaultValues(boolean ignoreDefaultValues)

setIgnoreDefaultValues

public void setIgnoreDefaultValues(boolean ignoreDefaultValues)

getIgnoreDefaultValues

public boolean getIgnoreDefaultValues()

getProperties

public Properties getProperties()
Description copied from class: AbstractService
Gets the value of the properties property.

This accessor method returns a reference to the live Properties Object, not a snapshot. Therefore any modification you make to the returned Properties will be present inside the JAXB object. This is why there is not a set method for the properties property.

For example, to add a new value, do as follows:

    getProperties().setProperty(key, value);
 

Specified by:
getProperties in interface Service
Overrides:
getProperties in class AbstractService


Copyright © 1999–2015 The Apache Software Foundation. All rights reserved.