A sketch of what has to be done to add a typical property.
-
Define the property in
C3P0Defaults
:private final static boolean CANCEL_AUTOMATICALLY_CLOSED_STATEMENTS = false; public static boolean cancelAutomaticallyClosedStatements() { return CANCEL_AUTOMATICALLY_CLOSED_STATEMENTS; }
-
Define the property in
WrapperConnectionPoolDataSourceBase.beangen-xml
:<property> <type>boolean</type> <name>cancelAutomaticallyClosedStatements</name> <default-value>C3P0Config.initializeBooleanPropertyVar("cancelAutomaticallyClosedStatements", C3P0Defaults.cancelAutomaticallyClosedStatements())</default-value> <getter><modifiers><modifier>public</modifier><modifier>synchronized</modifier></modifiers></getter> <setter><modifiers><modifier>public</modifier><modifier>synchronized</modifier></modifiers></setter> </property>
-
Define user-overridable variant on property in
WrapperConnectionPoolDataSource.java
:private synchronized boolean isCancelAutomaticallyClosedStatements( String userName ) { if ( userName == null ) return this.isCancelAutomaticallyClosedStatements(); Boolean override = C3P0ConfigUtils.extractBooleanUserOverride( "cancelAutomaticallyClosedStatements", userName, userOverrides ); return ( override == null ? this.isCancelAutomaticallyClosedStatements() : override.booleanValue() ); }
-
Add the property to
AbstractComboPooledDataSource.java
:public boolean isCancelAutomaticallyClosedStatements() { return wcpds.isCancelAutomaticallyClosedStatements(); } public void setCancelAutomaticallyClosedStatements( boolean cancelAutomaticallyClosedStatements ) { if ( diff(wcpds.isCancelAutomaticallyClosedStatements(), cancelAutomaticallyClosedStatements) ) { wcpds.setCancelAutomaticallyClosedStatements( cancelAutomaticallyClosedStatements ); this.resetPoolManager( false ); } }
-
Add the property to
JndiRefConnectionPoolDataSource.java
:public boolean isCancelAutomaticallyClosedStatements() { return wcpds.isCancelAutomaticallyClosedStatements(); } public void setCancelAutomaticallyClosedStatements( boolean cancelAutomaticallyClosedStatements ) { wcpds.setCancelAutomaticallyClosedStatements( cancelAutomaticallyClosedStatements ); } // don't forget to include the new property in ReferenceMaker! referenceMaker.addReferenceProperty("cancelAutomaticallyClosedStatements");
-
Add the property to
jboss/C3P0PooledDataSource.java
:public boolean isCancelAutomaticallyClosedStatements() { return combods.isCancelAutomaticallyClosedStatements(); } public void setCancelAutomaticallyClosedStatements( boolean cancelAutomaticallyClosedStatements ) throws NamingException { combods.setCancelAutomaticallyClosedStatements( cancelAutomaticallyClosedStatements ); rebind(); }
-
Add the property to
jboss/C3P0PooledDataSource.java
:public boolean isCancelAutomaticallyClosedStatements() { return combods.isCancelAutomaticallyClosedStatements(); } public void setCancelAutomaticallyClosedStatements( boolean cancelAutomaticallyClosedStatements ) throws NamingException { combods.setCancelAutomaticallyClosedStatements( cancelAutomaticallyClosedStatements ); rebind(); }
-
Add the property to
jboss/C3P0PooledDataSourceMBean.java
:public boolean isCancelAutomaticallyClosedStatements(); public void setCancelAutomaticallyClosedStatements( boolean cancelAutomaticallyClosedStatements ) throws NamingException;
-
Add the property to
mbean/C3P0PooledDataSource.java
:public boolean isCancelAutomaticallyClosedStatements() { return combods.isCancelAutomaticallyClosedStatements(); } public void setCancelAutomaticallyClosedStatements( boolean cancelAutomaticallyClosedStatements ) throws NamingException { combods.setCancelAutomaticallyClosedStatements( cancelAutomaticallyClosedStatements ); rebind(); }
-
Add the property to
mbean/C3P0PooledDataSourceMBean.java
:public boolean isCancelAutomaticallyClosedStatements(); public void setCancelAutomaticallyClosedStatements( boolean cancelAutomaticallyClosedStatements ) throws NamingException;
-
Implement parameter-specific logic.
-
Document parameter in
index.html
: -
[optional] Add parameter to
example/c3p0-service.xml
<!-- <attribute name="CancelAutomaticallyClosedStatements">false</attribute> -->
-
[optional] Add parameter to
test/resources-local/c3p0.properties
andtest/resources-local-rough/c3p0.properties