Author: fhanik
Date: Fri Jul 10 17:16:25 2009
New Revision: 793042
URL: http://svn.apache.org/viewvc?rev=793042&view=rev
Log:
remove dbcp
add classpath to javadoc
start documenting DataSource
Modified:
tomcat/trunk/modules/jdbc-pool/build.xml
tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java
Modified: tomcat/trunk/modules/jdbc-pool/build.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/build.xml?rev=793042&r1=793041&r2=793042&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/build.xml (original)
+++ tomcat/trunk/modules/jdbc-pool/build.xml Fri Jul 10 17:16:25 2009
@@ -86,7 +86,9 @@
</target>
<target name="javadoc" depends="prepare">
- <javadoc sourcepath="${basedir}/java" destdir="${tomcat.api}"
verbose="false"/>
+ <javadoc sourcepath="${basedir}/java" destdir="${tomcat.api}"
verbose="false">
+ <classpath refid="tomcat.jdbc.classpath"/>
+ </javadoc>
<!-- connection pool API file-->
<jar jarfile="${tomcat-jdbc-api.jar}" update="true">
<fileset dir="${tomcat.api}"/>
Modified:
tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java?rev=793042&r1=793041&r2=793042&view=diff
==============================================================================
---
tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java
(original)
+++
tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSource.java
Fri Jul 10 17:16:25 2009
@@ -50,17 +50,34 @@
// Register the actual pool itself under the tomcat.jdbc domain
//===============================================================================
protected volatile ObjectName oname = null;
+
+ /**
+ * Unregisters the underlying connection pool mbean.<br/>
+ * {...@inheritdoc}
+ */
public void postDeregister() {
if (oname!=null) unregisterJmx();
}
+ /**
+ * no-op<br/>
+ * {...@inheritdoc}
+ */
public void postRegister(Boolean registrationDone) {
}
+ /**
+ * no-op<br/>
+ * {...@inheritdoc}
+ */
public void preDeregister() throws Exception {
}
+ /**
+ * If the connection pool MBean exists, it will be registered during this
operation.<br/>
+ * {...@inheritdoc}
+ */
public ObjectName preRegister(MBeanServer server, ObjectName name) throws
Exception {
try {
this.oname = createObjectName(name);
@@ -71,6 +88,12 @@
return name;
}
+ /**
+ * Creates the ObjectName for the ConnectionPoolMBean object to be
registered
+ * @param original the ObjectName for the DataSource
+ * @return the ObjectName for the ConnectionPoolMBean
+ * @throws MalformedObjectNameException
+ */
public ObjectName createObjectName(ObjectName original) throws
MalformedObjectNameException {
String domain = "tomcat.jdbc";
Hashtable<String,String> properties = original.getKeyPropertyList();
@@ -84,10 +107,15 @@
return name;
}
+ /**
+ * Registers the ConnectionPoolMBean
+ */
protected void registerJmx() {
try {
- MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
- mbs.registerMBean(pool.getJmxPool(), oname);
+ if (pool.getJmxPool()!=null) {
+ MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
+ mbs.registerMBean(pool.getJmxPool(), oname);
+ }
} catch (Exception e) {
log.error("Unable to register JDBC pool with JMX",e);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]