User: patriot1burke
Date: 01/07/18 20:42:37
Modified: src/main/org/jboss/jdbc Tag: Branch_2_4
XADataSourceLoaderMBean.java
XADataSourceLoader.java
Log:
merged jbosspool TransactionIsolation, block timeout, and PS cache size settings
Revision Changes Path
No revision
No revision
1.5.6.1 +43 -36 jboss/src/main/org/jboss/jdbc/XADataSourceLoaderMBean.java
Index: XADataSourceLoaderMBean.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jdbc/XADataSourceLoaderMBean.java,v
retrieving revision 1.5
retrieving revision 1.5.6.1
diff -u -r1.5 -r1.5.6.1
--- XADataSourceLoaderMBean.java 2000/12/07 15:44:51 1.5
+++ XADataSourceLoaderMBean.java 2001/07/19 03:42:37 1.5.6.1
@@ -13,40 +13,47 @@
public static final String OBJECT_NAME = ":service=XADataSource";
// Public --------------------------------------------------------
- public void setPoolName(String name);
- public String getPoolName();
- public void setDataSourceClass(String clazz);
- public String getDataSourceClass();
- public void setURL(String url);
- public String getURL();
- public void setJDBCUser(String userName);
- public String getJDBCUser();
- public void setPassword(String password);
- public String getPassword();
- public void setProperties(String properties);
- public String getProperties();
- public void setLoggingEnabled(boolean enabled);
- public boolean getLoggingEnabled();
- public void setMinSize(int minSize);
- public int getMinSize();
- public void setMaxSize(int maxSize);
- public int getMaxSize();
- public void setBlocking(boolean blocking);
- public boolean getBlocking();
- public void setGCEnabled(boolean gcEnabled);
- public boolean getGCEnabled();
- public void setGCInterval(long interval);
- public long getGCInterval();
- public void setGCMinIdleTime(long idleMillis);
- public long getGCMinIdleTime();
- public void setIdleTimeoutEnabled(boolean enabled);
- public boolean getIdleTimeoutEnabled();
- public void setIdleTimeout(long idleMillis);
- public long getIdleTimeout();
- public void setMaxIdleTimeoutPercent(float percent);
- public float getMaxIdleTimeoutPercent();
- public void setInvalidateOnError(boolean invalidate);
- public boolean getInvalidateOnError();
- public void setTimestampUsed(boolean timestamp);
- public boolean getTimestampUsed();
+ public void setPoolName(String name);
+ public String getPoolName();
+ public void setDataSourceClass(String clazz);
+ public String getDataSourceClass();
+ public void setURL(String url);
+ public String getURL();
+ public void setJDBCUser(String userName);
+ public String getJDBCUser();
+ public void setPassword(String password);
+ public String getPassword();
+ public void setProperties(String properties);
+ public String getProperties();
+ public void setLoggingEnabled(boolean enabled);
+ public boolean getLoggingEnabled();
+ public void setMinSize(int minSize);
+ public int getMinSize();
+ public void setMaxSize(int maxSize);
+ public int getMaxSize();
+ public void setBlocking(boolean blocking);
+ public boolean getBlocking();
+ public void setBlockingTimeout(int blockingTimeout);
+ public int getBlockingTimeout();
+ public void setGCEnabled(boolean gcEnabled);
+ public boolean getGCEnabled();
+ public void setGCInterval(long interval);
+ public long getGCInterval();
+ public void setGCMinIdleTime(long idleMillis);
+ public long getGCMinIdleTime();
+ public void setIdleTimeoutEnabled(boolean enabled);
+ public boolean getIdleTimeoutEnabled();
+ public void setIdleTimeout(long idleMillis);
+ public long getIdleTimeout();
+ public void setMaxIdleTimeoutPercent(float percent);
+ public float getMaxIdleTimeoutPercent();
+ public void setInvalidateOnError(boolean invalidate);
+ public boolean getInvalidateOnError();
+ public void setTimestampUsed(boolean timestamp);
+ public boolean getTimestampUsed();
+ public String getTransactionIsolation();
+ public void setTransactionIsolation(String iso);
+ public int getPSCacheSize();
+ public void setPSCacheSize(int size);
+
}
1.16.4.1 +79 -2 jboss/src/main/org/jboss/jdbc/XADataSourceLoader.java
Index: XADataSourceLoader.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jdbc/XADataSourceLoader.java,v
retrieving revision 1.16
retrieving revision 1.16.4.1
diff -u -r1.16 -r1.16.4.1
--- XADataSourceLoader.java 2001/05/15 08:00:49 1.16
+++ XADataSourceLoader.java 2001/07/19 03:42:37 1.16.4.1
@@ -24,14 +24,21 @@
import org.jboss.logging.LogWriter;
import org.jboss.util.ServiceMBeanSupport;
import org.jboss.logging.Log;
+import java.sql.Connection;
/**
* Service that loads a JDBC 2 std. extension-compliant connection pool. This
* pool generates connections that are registered with the current Transaction
* and support two-phase commit. The constructors are called by the JMX engine
* based on your MLET tags.
- * @version $Revision: 1.16 $
- * @author Aaron Mulder ([EMAIL PROTECTED])
+ * @version $Revision: 1.16.4.1 $
+ * @author <a href="mailto:[EMAIL PROTECTED]">Aaron Mulder</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">danch (Dan Christopherson)</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">Bill Burke</a>
+ *
+ * Revision:<br>
+ * 20010701 danch added support for timeout in blocking.
+ * 20010703 bill added support for transaction isolation and ps cache size.
*/
public class XADataSourceLoader
extends ServiceMBeanSupport
@@ -56,6 +63,9 @@
float maxIdleTimeoutPercent;
boolean invalidateOnError;
boolean timestampUsed;
+ int blockingTimeout;
+ int transactionIsolation = -1; // use default of driver
+ int psCacheSize = 10;
XAPoolDataSource source;
@@ -169,6 +179,60 @@
return blocking;
}
+ public void setBlockingTimeout(int blockingTimeout) {
+ this.blockingTimeout = blockingTimeout;
+ }
+
+ public int getBlockingTimeout() {
+ return blockingTimeout;
+ }
+
+ public void setTransactionIsolation(String iso)
+ {
+ if (iso.equals("TRANSACTION_NONE"))
+ {
+ this.transactionIsolation = Connection.TRANSACTION_NONE;
+ }
+ else if (iso.equals("TRANSACTION_READ_COMMITTED"))
+ {
+ this.transactionIsolation = Connection.TRANSACTION_READ_COMMITTED;
+ }
+ else if (iso.equals("TRANSACTION_READ_UNCOMMITTED"))
+ {
+ this.transactionIsolation = Connection.TRANSACTION_READ_UNCOMMITTED;
+ }
+ else if (iso.equals("TRANSACTION_REPEATABLE_READ"))
+ {
+ this.transactionIsolation = Connection.TRANSACTION_REPEATABLE_READ;
+ }
+ else if (iso.equals("TRANSACTION_SERIALIZABLE"))
+ {
+ this.transactionIsolation = Connection.TRANSACTION_SERIALIZABLE;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Setting Isolation level to unknown
state: " + iso);
+ }
+ }
+
+ public String getTransactionIsolation() {
+ switch (this.transactionIsolation)
+ {
+ case Connection.TRANSACTION_NONE:
+ return "TRANSACTION_NONE";
+ case Connection.TRANSACTION_READ_COMMITTED:
+ return "TRANSACTION_READ_COMMITTED";
+ case Connection.TRANSACTION_READ_UNCOMMITTED:
+ return "TRANSACTION_READ_UNCOMMITTED";
+ case Connection.TRANSACTION_REPEATABLE_READ:
+ return "TRANSACTION_REPEATABLE_READ";
+ case Connection.TRANSACTION_SERIALIZABLE:
+ return "TRANSACTION_SERIALIZABLE";
+ default:
+ return "DEFAULT";
+ }
+ }
+
public void setGCEnabled(boolean gcEnabled)
{
this.gcEnabled = gcEnabled;
@@ -249,6 +313,16 @@
return timestampUsed;
}
+ public int getPSCacheSize()
+ {
+ return psCacheSize;
+ }
+
+ public void setPSCacheSize(int size)
+ {
+ psCacheSize = size;
+ }
+
// ServiceMBeanSupport implementation ----------------------------
public ObjectName getObjectName(MBeanServer server, ObjectName objectName)
throws javax.management.MalformedObjectNameException
@@ -298,6 +372,7 @@
getSource().setMinSize(minSize);
getSource().setMaxSize(maxSize);
getSource().setBlocking(blocking);
+ getSource().setBlockingTimeout(blockingTimeout);
getSource().setGCEnabled(gcEnabled);
getSource().setGCInterval(gcInterval);
getSource().setGCMinIdleTime(gcMinIdleTime);
@@ -306,6 +381,8 @@
getSource().setMaxIdleTimeoutPercent(maxIdleTimeoutPercent);
getSource().setInvalidateOnError(invalidateOnError);
getSource().setTimestampUsed(timestampUsed);
+ getSource().setTransactionIsolation(transactionIsolation);
+ getSource().setPSCacheSize(psCacheSize);
// Initialize pool
Context ctx = null;
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development