com.objectwave.persist.properties
Class BrokerPropertySource

java.lang.Object
  |
  +--com.objectwave.configuration.BasicPropertySource
        |
        +--com.objectwave.persist.properties.BrokerPropertySource
All Implemented Interfaces:
PropertySource

public class BrokerPropertySource
extends BasicPropertySource

This class is stateless and really acts like a finder for property support.

Version:
$Id: BrokerPropertySource.java,v 2.7 2002/02/13 21:36:18 dave_hoag Exp $
Author:
David Hoag

Field Summary
 
Fields inherited from class com.objectwave.configuration.BasicPropertySource
configurationService, name
 
Constructor Summary
BrokerPropertySource()
          Constructor for the BrokerPropertySource object
BrokerPropertySource(BrokerPropertyDetail detail)
          Bypass the traditional initialization and use the provided parameter as the source of property values.
BrokerPropertySource(java.lang.String customCategory)
          A custom category allows user of this class to define the category.
 
Method Summary
protected  void customInitialize()
           
 SqlConnectionFactory getConnectionFactory()
          Get the connection factory
 java.lang.String getConnectUrl()
          Gets the ConnectUrl attribute of the BrokerPropertyDetail object
 java.lang.String getDatabaseImpl()
          Gets the DatabaseImpl attribute of the BrokerPropertyDetail object
 SQLConvertExceptionIF getExceptionConverter()
          Get the instance to use as the converter - null is a legal return type
 java.lang.Class getExpectedClass()
          Return the 'type' of the detail class to populate with configured values.
 java.sql.Driver getPersistDriver()
          Gets the PersistDriver attribute of the BrokerPropertyDetail object
 java.lang.String getPersistPassword()
          Gets the PersistPassword attribute of the BrokerPropertyDetail object
 java.lang.String getPersistUser()
          Gets the PersistUser attribute of the BrokerPropertyDetail object
 PrimaryKeyStrategy getPrimaryKeyStrategy()
          Get the primaryKeyStrategy.
 BrokerPropertyDetail getPropertyDetail()
          Return the instance holding the property values.
 boolean getUsePreparedStatements()
          Gets the UsePreparedStatements attribute of the BrokerPropertyDetail object
protected  void initialize()
          Find our LoggingPropertySourceDetail instance.
 boolean isShowingSql()
          Gets the ShowingSql attribute of the BrokerPropertyDetail object
 void setConnectionFactory(SqlConnectionFactory factory)
          Sets the SqlConnectionFactory attribute of the BrokerPropertySource object
 void setConnectionFactoryName(java.lang.String connectionFactoryName)
          Change the SqlConnectionFactory to an instance of the provided name.
 void setConnectUrl(java.lang.String aValue)
          Sets the ConnectUrl attribute of the BrokerPropertyDetail object
 void setDatabaseImpl(java.lang.String aValue)
          Sets the DatabaseImpl attribute of the BrokerPropertyDetail object
static void setDetailClass(java.lang.Class aBrokerPropertyDetailClass)
          Facilitate customization by allowing the default detail class to be set prior to instantiation.
 void setExceptionConverter(SQLConvertExceptionIF converter)
          Sets the ExceptionConverter attribute of the BrokerPropertySource object
 void setPersistDriver(java.sql.Driver driver)
          Force the driver to be a specific java.sql.Driver instance
 void setPersistDriverName(java.lang.String aValue)
          Sets the PersistDriver attribute of the BrokerPropertyDetail object
 void setPersistPassword(java.lang.String aValue)
          Sets the PersistPassword attribute of the BrokerPropertyDetail object
 void setPersistUser(java.lang.String aValue)
          Sets the PersistUser attribute of the BrokerPropertyDetail object
 void setPrimaryKeyStrategy(PrimaryKeyStrategy strategy)
          Force the strategy to be something specific.
 void setPropertyDetail(BrokerPropertyDetail detail)
          Allow one to programmatically set the values of a broker property source.
 void setUsePreparedStatements(boolean val)
          If this is true Java Grinder will create prepared statements for every sql call.
 
Methods inherited from class com.objectwave.configuration.BasicPropertySource
getCategoryId, getConfigObject, getConfigurationInstance, getConfigurationInstance, getConfigurationService, getName, setConfigurationService, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrokerPropertySource

public BrokerPropertySource()
Constructor for the BrokerPropertySource object


BrokerPropertySource

public BrokerPropertySource(BrokerPropertyDetail detail)
Bypass the traditional initialization and use the provided parameter as the source of property values.

Parameters:
detail -

BrokerPropertySource

public BrokerPropertySource(java.lang.String customCategory)
A custom category allows user of this class to define the category.

Parameters:
customCategory -
Method Detail

setDetailClass

public static void setDetailClass(java.lang.Class aBrokerPropertyDetailClass)
                           throws java.lang.IllegalArgumentException,
                                  java.lang.IllegalAccessException,
                                  java.lang.InstantiationException
Facilitate customization by allowing the default detail class to be set prior to instantiation. Makes it easy to change detail defaults.

Parameters:
aBrokerPropertyDetailClass - The new DetailClass value
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.InstantiationException

setPropertyDetail

public void setPropertyDetail(BrokerPropertyDetail detail)
Allow one to programmatically set the values of a broker property source.

Parameters:
detail - The new PropertyDetail value

setDatabaseImpl

public void setDatabaseImpl(java.lang.String aValue)
Sets the DatabaseImpl attribute of the BrokerPropertyDetail object

Parameters:
aValue - The new DatabaseImpl value

setConnectUrl

public void setConnectUrl(java.lang.String aValue)
Sets the ConnectUrl attribute of the BrokerPropertyDetail object

Parameters:
aValue - The new ConnectUrl value

setPersistUser

public void setPersistUser(java.lang.String aValue)
Sets the PersistUser attribute of the BrokerPropertyDetail object

Parameters:
aValue - The new PersistUser value

setPersistPassword

public void setPersistPassword(java.lang.String aValue)
Sets the PersistPassword attribute of the BrokerPropertyDetail object

Parameters:
aValue - The new PersistPassword value

setPersistDriverName

public void setPersistDriverName(java.lang.String aValue)
                          throws java.lang.ClassNotFoundException
Sets the PersistDriver attribute of the BrokerPropertyDetail object

Parameters:
aValue - The new PersistDriver value
Throws:
java.lang.ClassNotFoundException

setPersistDriver

public void setPersistDriver(java.sql.Driver driver)
Force the driver to be a specific java.sql.Driver instance

Parameters:
driver - The new PersistDriver value

setConnectionFactoryName

public void setConnectionFactoryName(java.lang.String connectionFactoryName)
                              throws java.lang.ClassNotFoundException
Change the SqlConnectionFactory to an instance of the provided name. Since the result of the getConnectionFactory will be cached, changes to this value must be done prior to an RDBBroker being initialized.

Parameters:
connectionFactoryName - The new ConnectionFactoryName value
Throws:
java.lang.ClassNotFoundException

setExceptionConverter

public void setExceptionConverter(SQLConvertExceptionIF converter)
Sets the ExceptionConverter attribute of the BrokerPropertySource object

Parameters:
converter - The new ExceptionConverter value

setUsePreparedStatements

public void setUsePreparedStatements(boolean val)
If this is true Java Grinder will create prepared statements for every sql call. When a duplicate SQL call is invoked the already prepared statement is used opposed to generating a new SQL statement.

Parameters:
val - boolean

setPrimaryKeyStrategy

public void setPrimaryKeyStrategy(PrimaryKeyStrategy strategy)
Force the strategy to be something specific.

Parameters:
strategy - The new PrimaryKeyStrategy value

setConnectionFactory

public void setConnectionFactory(SqlConnectionFactory factory)
Sets the SqlConnectionFactory attribute of the BrokerPropertySource object

Parameters:
factory - The new SqlConnectionFactory value

getPropertyDetail

public BrokerPropertyDetail getPropertyDetail()
Return the instance holding the property values.

Returns:
The PropertyDetail value

getPersistPassword

public java.lang.String getPersistPassword()
Gets the PersistPassword attribute of the BrokerPropertyDetail object

Returns:
The PersistPassword value

getPersistUser

public java.lang.String getPersistUser()
Gets the PersistUser attribute of the BrokerPropertyDetail object

Returns:
The PersistUser value

getExpectedClass

public java.lang.Class getExpectedClass()
Return the 'type' of the detail class to populate with configured values.

Returns:

getDatabaseImpl

public java.lang.String getDatabaseImpl()
Gets the DatabaseImpl attribute of the BrokerPropertyDetail object

Returns:
The DatabaseImpl value

getConnectUrl

public java.lang.String getConnectUrl()
Gets the ConnectUrl attribute of the BrokerPropertyDetail object

Returns:
The ConnectUrl value

getUsePreparedStatements

public boolean getUsePreparedStatements()
Gets the UsePreparedStatements attribute of the BrokerPropertyDetail object

Returns:
The UsePreparedStatements value

getExceptionConverter

public SQLConvertExceptionIF getExceptionConverter()
Get the instance to use as the converter - null is a legal return type

Returns:
The ExceptionConverter value

getPersistDriver

public java.sql.Driver getPersistDriver()
Gets the PersistDriver attribute of the BrokerPropertyDetail object

Returns:
The PersistDriver value

getConnectionFactory

public SqlConnectionFactory getConnectionFactory()
Get the connection factory

Returns:
The ConnectionFactory value

isShowingSql

public boolean isShowingSql()
Gets the ShowingSql attribute of the BrokerPropertyDetail object

Returns:
The ShowingSql value

getPrimaryKeyStrategy

public PrimaryKeyStrategy getPrimaryKeyStrategy()
Get the primaryKeyStrategy. This is the mechanism that will know how to figure out the primary key of the provided object.

Returns:
The PrimaryKeyStrategy value

customInitialize

protected void customInitialize()

initialize

protected void initialize()
Find our LoggingPropertySourceDetail instance. The PropertyDetail object will actually contain the property values.