|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.lakesidetech.springxmldb.datasource.BasicXMLDBDataSource
A data source for XML:DB collections which uses a poolable collection factory to create pooled collections to an XML datasource
The data source follows the normal paradigms in creating connections and can be configured in the Spring context.
Im unsure as to the exact perforance increase provided by pooling collections to XML databases but it cant hurt. Because underlying connections can either be based on embedded access to the database or throught XML-RPC connections to remote databases performance can also be improved by using a pooling HttpClient such as the Apache Commons HttpClient
Field Summary | |
protected java.lang.String |
driverClassName
The fully qualified XMLDB class name of the XMLDB driver to be used. |
protected int |
initialSize
The initial number of default collection connections that are created when the pool is started. |
protected int |
maxActive
The maximum number of active connections that can be allocated from this pool at the same time, or zero for no limit. |
protected int |
maxIdle
The maximum number of active connections that can remain idle in the pool, without extra ones being released, or zero for no limit. |
protected long |
maxWait
The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, or -1 to wait indefinitely. |
protected long |
minEvictableIdleTimeMillis
The minimum amount of time an object may sit idle in the pool before it is eligable for eviction by the idle object evictor (if any). |
protected int |
numTestsPerEvictionRun
The number of objects to examine during each run of the idle object evictor thread (if any). |
protected java.lang.String |
password
The connection password to be passed to our JDBC driver to establish a connection. |
protected boolean |
testOnBorrow
The indication of whether objects will be validated before being borrowed from the pool. |
protected boolean |
testOnReturn
The indication of whether objects will be validated before being returned to the pool. |
protected boolean |
testWhileIdle
The indication of whether objects will be validated by the idle object evictor (if any). |
protected long |
timeBetweenEvictionRunsMillis
The number of milliseconds to sleep between runs of the idle object evictor thread. |
protected java.lang.String |
url
The connection URL to be passed to our JDBC driver to establish a connection. |
protected java.lang.String |
username
The connection username to be passed to our JDBC driver to establish a connection. |
Constructor Summary | |
BasicXMLDBDataSource()
|
Method Summary | |
org.xmldb.api.base.Collection |
getCollection()
get a collection with the default collection path |
org.xmldb.api.base.Collection |
getCollection(java.lang.String collectionPath)
get a collection connection to the XML database given the collection path |
org.xmldb.api.base.Collection |
getCollection(java.lang.String username,
java.lang.String password,
java.lang.String collectionPath)
get a collection connection to the XML database given a collectionpath and connect using supplied login details |
java.lang.String |
getDefaultCollectionPath()
|
java.lang.String |
getDriverClassName()
|
int |
getInitialSize()
|
int |
getMaxActive()
|
int |
getMaxIdle()
|
long |
getMaxWait()
|
long |
getMinEvictableIdleTimeMillis()
|
int |
getNumActive()
[Read Only] The current number of active connections that have been allocated from this data source. |
int |
getNumIdle()
[Read Only] The current number of idle connections that are waiting to be allocated from this data source. |
int |
getNumTestsPerEvictionRun()
|
java.lang.String |
getPassword()
|
boolean |
getTestOnBorrow()
|
boolean |
getTestOnReturn()
|
boolean |
getTestWhileIdle()
|
long |
getTimeBetweenEvictionRunsMillis()
|
java.lang.String |
getUrl()
|
java.lang.String |
getUsername()
|
void |
setDefaultCollectionPath(java.lang.String defaultCollectionPath)
|
void |
setDriverClassName(java.lang.String driverClassName)
|
void |
setInitialSize(int initialSize)
|
void |
setMaxActive(int maxActive)
|
void |
setMaxIdle(int maxIdle)
|
void |
setMaxWait(long maxWait)
|
void |
setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
|
void |
setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
|
void |
setPassword(java.lang.String password)
|
void |
setTestOnBorrow(boolean testOnBorrow)
|
void |
setTestOnReturn(boolean testOnReturn)
|
void |
setTestWhileIdle(boolean testWhileIdle)
|
void |
setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
|
void |
setUrl(java.lang.String url)
|
void |
setUsername(java.lang.String username)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String driverClassName
protected int maxActive
protected int maxIdle
protected int initialSize
protected long maxWait
protected boolean testOnBorrow
protected boolean testOnReturn
protected long timeBetweenEvictionRunsMillis
protected int numTestsPerEvictionRun
protected long minEvictableIdleTimeMillis
protected boolean testWhileIdle
protected java.lang.String password
protected java.lang.String url
protected java.lang.String username
Constructor Detail |
public BasicXMLDBDataSource()
Method Detail |
public java.lang.String getDriverClassName()
public void setDriverClassName(java.lang.String driverClassName)
public int getMaxActive()
public void setMaxActive(int maxActive)
public int getMaxIdle()
public void setMaxIdle(int maxIdle)
public int getInitialSize()
public void setInitialSize(int initialSize)
public long getMaxWait()
public void setMaxWait(long maxWait)
public boolean getTestOnBorrow()
public void setTestOnBorrow(boolean testOnBorrow)
public boolean getTestOnReturn()
public void setTestOnReturn(boolean testOnReturn)
public long getTimeBetweenEvictionRunsMillis()
public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
public int getNumTestsPerEvictionRun()
public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
public long getMinEvictableIdleTimeMillis()
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
public boolean getTestWhileIdle()
public void setTestWhileIdle(boolean testWhileIdle)
public int getNumActive()
public int getNumIdle()
public java.lang.String getPassword()
public void setPassword(java.lang.String password)
public java.lang.String getUrl()
public void setUrl(java.lang.String url)
public java.lang.String getUsername()
public void setUsername(java.lang.String username)
public org.xmldb.api.base.Collection getCollection(java.lang.String collectionPath) throws org.xmldb.api.base.XMLDBException
getCollection
in interface XMLDBDataSource
collectionPath
- the collection path to get a collection connection for
org.xmldb.api.base.XMLDBException
- if collection cant be connected toXMLDBDataSource.getCollection(java.lang.String)
public org.xmldb.api.base.Collection getCollection(java.lang.String username, java.lang.String password, java.lang.String collectionPath) throws org.xmldb.api.base.XMLDBException
getCollection
in interface XMLDBDataSource
username
- the connecting usernamepassword
- the connection passwordcollectionPath
- the collection path
org.xmldb.api.base.XMLDBException
- if the collection cant be connected toXMLDBDataSource.getCollection(java.lang.String, java.lang.String, java.lang.String)
public org.xmldb.api.base.Collection getCollection() throws org.xmldb.api.base.XMLDBException
getCollection
in interface XMLDBDataSource
org.xmldb.api.base.XMLDBException
XMLDBDataSource.getCollection()
public java.lang.String getDefaultCollectionPath()
public void setDefaultCollectionPath(java.lang.String defaultCollectionPath)
defaultCollectionPath
- The defaultCollectionPath to set.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |