public class SimpleFactoryConfiguration extends java.lang.Object implements ExtraFactoryConfiguration
ExtraFactoryConfiguration
implementation using reflection to configure fields on the
ConnectionFactory.
This implementation uses reflection to configure fields on the ConnectionFactory after it has been returned from the JNDI store. Generally speaking, this is not encouraged, as you are now keeping configuration in 2 separate locations (both JNDI and adapter config). The ConnectionFactory should be configured in JNDI with all the settings that are required for each connection.
As the name suggests, this is a very simple implementation, primitive values are supported along
with strings, but not objects. Every fieldname referenced is expected to have an associated
method set[fieldname] which has a single parameter; the match for which is case-insensitive. If
you have more more complex requirements then you will have to write your own implementation of
ExtraFactoryConfiguration
.
In the adapter configuration file this class is aliased as simple-jndi-factory-configuration which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
SimpleFactoryConfiguration() |
Modifier and Type | Method and Description |
---|---|
void |
applyConfiguration(java.lang.Object cf)
Apply any additional configuration to the XA/ConnectionFactory.
|
KeyValuePairSet |
getProperties() |
void |
setProperties(KeyValuePairSet extras)
Set any extra properties that need to be configured on the connection factory.
|
public void applyConfiguration(java.lang.Object cf) throws javax.jms.JMSException
ExtraFactoryConfiguration
applyConfiguration
in interface ExtraFactoryConfiguration
cf
- the connection factoryjavax.jms.JMSException
public KeyValuePairSet getProperties()
public void setProperties(KeyValuePairSet extras)
The key portion of the underlying KeyValuePair
should match the name of the underlying ConnectionFactory field, the
value is the parameter to the associated setter. Note that only primitive types are supported (long, string, boolean, int,
float, double).
If, for instance, you are looking up a Aurea SonicMQ connection factory from JNDI, and you wished to change the ConnectID field, then the following configuration would be appropriate.
<properties>
<key-value-pair>
<key>ConnectID</key>
<value>MyConnectId</value>
</key-value-pair>
</properties>
which will invoke the associated setConnectID(String), setting the ConnectID property to 'MyConnectId'.
*extras
-