weaver 2004/05/27 12:40:28
Modified: components/rdbms/src/java/org/apache/jetspeed/components/datasource
BoundDBCPDatasourceComponent.java
Log:
stop() now unbinds the DS
Revision Changes Path
1.2 +24 -1
jakarta-jetspeed-2/components/rdbms/src/java/org/apache/jetspeed/components/datasource/BoundDBCPDatasourceComponent.java
Index: BoundDBCPDatasourceComponent.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/components/rdbms/src/java/org/apache/jetspeed/components/datasource/BoundDBCPDatasourceComponent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BoundDBCPDatasourceComponent.java 27 Feb 2004 19:35:02 -0000 1.1
+++ BoundDBCPDatasourceComponent.java 27 May 2004 19:40:27 -0000 1.2
@@ -23,6 +23,14 @@
private String bindName;
+ /* (non-Javadoc)
+ * @see java.lang.Object#finalize()
+ */
+ protected void finalize() throws Throwable
+ {
+ stop();
+ super.finalize();
+ }
/**
*
* @param user
@@ -71,8 +79,23 @@
}
catch (NamingException e)
{
- new IllegalStateException("Naming exception "+e.toString());
+ throw new IllegalStateException("Naming exception "+e.toString());
}
}
+ /* (non-Javadoc)
+ * @see org.picocontainer.Startable#stop()
+ */
+ public void stop()
+ {
+ try
+ {
+ jndi.unbindObject("comp/env/jdbc/"+bindName);
+ }
+ catch (NamingException e)
+ {
+ throw new IllegalStateException("Naming exception "+e.toString());
+ }
+ super.stop();
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]