|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.fostore.FOStoreConnectionFactory
A connection factory for FOStore. Allows both same- and remote-address space connections. For the same address space-connections, the URL must not include the Host (Server) parameter. For remote address space connections, the URL's protocol is ignored.
This class is public
so that clients can create instances of it
with new
.
Nested Class Summary | |
(package private) static interface |
FOStoreConnectionFactory.CFAccessor
CFAccessor implementation instances allow copying values to/from a FOStoreConnectionFactory and a Properties. |
Field Summary | |
protected static java.util.HashMap |
CFpropsAccessors
This table maps from names to CFAccessors. |
private boolean |
configurable
True until setConfigured has been invoked. |
private java.util.HashMap |
connectionMap
Connections are pooled. |
private boolean |
create
|
private FOStoreConnectionId |
defaultConnectionId
|
private java.lang.String |
driverName
|
(package private) static org.apache.commons.logging.Log |
logger
Logger |
private int |
loginTimeout
|
private java.io.PrintWriter |
logWriter
|
private static org.apache.jdo.util.I18NHelper |
msg
I18N support. |
private java.lang.String |
password
|
private FOStorePMF |
pmf
|
private static int |
poolSize
For now, set the pool size to 1. |
private FOStoreURLStreamHandler |
streamHandler
Connections are created by the FOStoreURLStreamHandler. |
private java.lang.String |
url
|
private FOStoreConnectionId |
userConnectionId
|
private java.lang.String |
userName
|
Constructor Summary | |
FOStoreConnectionFactory()
First time a FOStoreConnectionFactory is created, initialize accessors which are used to store/save instances via JNDI. |
Method Summary | |
private void |
assertConfigurable()
|
(package private) void |
closeConnection(FOStoreClientConnection connection)
Returns a connection to the pool |
void |
closeDatabase()
Close the database. |
private FOStoreClientConnection |
createConnection(FOStoreConnectionId id)
This method requires permission to perform the following requests: Create new URL with the specified StreamHandler. |
(package private) org.apache.jdo.util.Pool |
createPool(FOStoreConnectionId id)
Create a new pool of connections for this combination of url, user, and password. |
FOStoreClientConnection |
getConnection()
Provides a connection to the database using the configured userName, password, and url. |
FOStoreClientConnection |
getConnection(java.lang.String user,
java.lang.String password)
Provides a connection to the database using the given userName and password. |
boolean |
getCreate()
Returns whether to create the database. |
java.lang.String |
getDriverName()
Provides name of driver used for connections |
int |
getLoginTimeout()
Returns the number of seconds to wait for a new connection to be established to the data source |
java.io.PrintWriter |
getLogWriter()
Returns the LogWriter to which messages should be sent |
int |
getMaxPool()
Returns maximum number of connections in the connection pool |
int |
getMinPool()
Returns minimum number of connections in the connection pool |
int |
getMsInterval()
Returns the amount of time, in milliseconds, between the connection manager's attempts to get a pooled connection. |
int |
getMsWait()
Returns the number of milliseconds to wait for an available connection from the connection pool before throwing an exception |
FOStorePMF |
getPMF()
Provides PersistenceManagerFactory for connections |
java.lang.String |
getURL()
Returns connection URL |
java.lang.String |
getUserName()
Returns database user name |
protected static void |
initPropsAccessors()
|
boolean |
isConfigured()
Returns true if this connection factory has been configured with a URL. |
private void |
setConfigured()
Set the url, user, and password into the ConnectionIds for this connection factory. |
void |
setCreate(boolean create)
Sets whether to create the database. |
void |
setCreate(java.lang.String create)
Sets whether to create the database. |
void |
setDriverName(java.lang.String driverName)
Sets name of the driver for connections |
void |
setFromProperties(java.util.Properties p)
Configures a FOStoreConnectionFactory from the given Properties. |
void |
setLoginTimeout(int loginTimeout)
Sets the number of seconds to wait for a new connection to be established to the data source |
void |
setLogWriter(java.io.PrintWriter logWriter)
Sets the LogWriter to which messages should be sent |
void |
setMaxPool(int maxPool)
Sets maximum number of connections in the connection pool |
void |
setMinPool(int minPool)
Sets minimum number of connections in the connection pool |
void |
setMsInterval(int msInterval)
Sets the amount of time, in milliseconds, between the connection manager's attempts to get a pooled connection. |
void |
setMsWait(int msWait)
Sets the number of milliseconds to wait for an available connection from the connection pool before throwing an exception |
void |
setPassword(java.lang.String password)
Sets database user password |
void |
setPMF(FOStorePMF pmf)
Sets PersistenceManagerFactory for connections |
(package private) void |
setProperties(java.util.Properties p)
Sets properties as per the property values in the connection factory. |
void |
setURL(java.lang.String url)
Sets connection URL |
void |
setUserName(java.lang.String userName)
Sets database user |
private static int |
toInt(java.lang.String s)
It should *never* be the case that our translation process encounters a NumberFormatException. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.lang.String url
private java.lang.String userName
private java.lang.String password
private java.lang.String driverName
private boolean create
private FOStorePMF pmf
private int loginTimeout
private transient java.io.PrintWriter logWriter
private final FOStoreURLStreamHandler streamHandler
private final java.util.HashMap connectionMap
private static final int poolSize
private FOStoreConnectionId defaultConnectionId
private FOStoreConnectionId userConnectionId
private boolean configurable
protected static java.util.HashMap CFpropsAccessors
private static final org.apache.jdo.util.I18NHelper msg
static final org.apache.commons.logging.Log logger
Constructor Detail |
public FOStoreConnectionFactory()
Method Detail |
private void setConfigured()
private void assertConfigurable()
public FOStoreClientConnection getConnection(java.lang.String user, java.lang.String password)
org.apache.jdo.util.Pool createPool(FOStoreConnectionId id)
public FOStoreClientConnection getConnection()
private FOStoreClientConnection createConnection(FOStoreConnectionId id)
void closeConnection(FOStoreClientConnection connection)
connection
- Connection to be returned to the pool.public void closeDatabase()
public void setDriverName(java.lang.String driverName)
driverName
- driver namepublic FOStorePMF getPMF()
public void setPMF(FOStorePMF pmf)
pmf
- PersistenceManagerFactorypublic java.lang.String getDriverName()
public void setURL(java.lang.String url)
url
- connection URLpublic java.lang.String getURL()
public void setUserName(java.lang.String userName)
userName
- database userpublic java.lang.String getUserName()
public void setPassword(java.lang.String password)
password
- database user passwordpublic void setMinPool(int minPool)
minPool
- minimum number of connectionspublic int getMinPool()
public void setMaxPool(int maxPool)
maxPool
- maximum number of connectionspublic int getMaxPool()
public void setMsInterval(int msInterval)
msInterval
- the interval between attempts to get a database
connection, in milliseconds.public int getMsInterval()
public void setMsWait(int msWait)
msWait
- number in millisecondspublic int getMsWait()
public void setLogWriter(java.io.PrintWriter logWriter)
logWriter
- logWriterpublic java.io.PrintWriter getLogWriter()
public void setLoginTimeout(int loginTimeout)
loginTimeout
- wait time in secondspublic int getLoginTimeout()
public void setCreate(boolean create)
create
- whether to create the database.public void setCreate(java.lang.String create)
create
- whether to create the database.public boolean getCreate()
protected static void initPropsAccessors()
private static int toInt(java.lang.String s)
void setProperties(java.util.Properties p)
public void setFromProperties(java.util.Properties p)
public boolean isConfigured()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |