提交 2c6cde93 authored 作者: Thomas Mueller's avatar Thomas Mueller

An OSGi BundleActivator is included in org.h2.util.

上级 b6405241
...@@ -19,8 +19,8 @@ Change Log ...@@ -19,8 +19,8 @@ Change Log
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>OSGi meta data is included in the manifest file. <ul><li>OSGi meta data is included in the manifest file.
An OSGi BundleActivator is included: it loads the database driver when starting the bundle, An OSGi BundleActivator is included: it loads the database driver when starting the bundle,
and unloads it when stopping the bundle. and unloads it when stopping the bundle.
</li><li>The default value for MAX_MEMORY_UNDO to 50000. </li><li>The default value for MAX_MEMORY_UNDO to 50000.
</li><li>For alias columns, ResultSetMetaData.getTableName() and getColumnName() now </li><li>For alias columns, ResultSetMetaData.getTableName() and getColumnName() now
return the real table and column name in the default mode. return the real table and column name in the default mode.
......
...@@ -5,7 +5,7 @@ Implementation-Version: ${version} ...@@ -5,7 +5,7 @@ Implementation-Version: ${version}
Build-Jdk: ${buildJdk} Build-Jdk: ${buildJdk}
Created-By: ${createdBy} Created-By: ${createdBy}
${mainClassTag} ${mainClassTag}
Bundle-Activator: org.h2.tools.DbDriverActivator Bundle-Activator: org.h2.util.DbDriverActivator
Bundle-Name: H2 Database Engine Bundle-Name: H2 Database Engine
Bundle-Vendor: H2 Group Bundle-Vendor: H2 Group
Bundle-Version: ${version} Bundle-Version: ${version}
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* (http://h2database.com/html/license.html). * (http://h2database.com/html/license.html).
* Initial Developer: H2 Group * Initial Developer: H2 Group
*/ */
package org.h2.tools; package org.h2.util;
import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext; import org.osgi.framework.BundleContext;
...@@ -15,10 +15,16 @@ import org.osgi.framework.BundleContext; ...@@ -15,10 +15,16 @@ import org.osgi.framework.BundleContext;
*/ */
public class DbDriverActivator implements BundleActivator { public class DbDriverActivator implements BundleActivator {
/**
* Start the bundle. This will load the database driver.
*/
public void start(BundleContext bundleContext) { public void start(BundleContext bundleContext) {
org.h2.Driver.load(); org.h2.Driver.load();
} }
/**
* Stop the bundle. This will unload the database driver.
*/
public void stop(BundleContext bundleContext) { public void stop(BundleContext bundleContext) {
org.h2.Driver.unload(); org.h2.Driver.unload();
} }
......
...@@ -103,6 +103,7 @@ public class Build extends BuildBase { ...@@ -103,6 +103,7 @@ public class Build extends BuildBase {
File.pathSeparator + "ext/servlet-api-2.4.jar" + File.pathSeparator + "ext/servlet-api-2.4.jar" +
File.pathSeparator + "ext/lucene-core-2.2.0.jar" + File.pathSeparator + "ext/lucene-core-2.2.0.jar" +
File.pathSeparator + "ext/slf4j-api-1.5.0.jar" + File.pathSeparator + "ext/slf4j-api-1.5.0.jar" +
File.pathSeparator + "ext/org.osgi.core-1.2.0.jar" +
File.pathSeparator + System.getProperty("java.home") + "/../lib/tools.jar"; File.pathSeparator + System.getProperty("java.home") + "/../lib/tools.jar";
FileList files; FileList files;
if (clientOnly) { if (clientOnly) {
...@@ -319,7 +320,8 @@ public class Build extends BuildBase { ...@@ -319,7 +320,8 @@ public class Build extends BuildBase {
"/../lib/tools.jar" + "/../lib/tools.jar" +
File.pathSeparator + "ext/slf4j-api-1.5.0.jar" + File.pathSeparator + "ext/slf4j-api-1.5.0.jar" +
File.pathSeparator + "ext/servlet-api-2.4.jar" + File.pathSeparator + "ext/servlet-api-2.4.jar" +
File.pathSeparator + "ext/lucene-core-2.2.0.jar", File.pathSeparator + "ext/lucene-core-2.2.0.jar" +
File.pathSeparator + "ext/org.osgi.core-1.2.0.jar",
"-subpackages", "org.h2", "-subpackages", "org.h2",
"-exclude", "org.h2.test.jaqu:org.h2.jaqu" }); "-exclude", "org.h2.test.jaqu:org.h2.jaqu" });
...@@ -330,7 +332,8 @@ public class Build extends BuildBase { ...@@ -330,7 +332,8 @@ public class Build extends BuildBase {
"-classpath", System.getProperty("java.home") + "/../lib/tools.jar" + "-classpath", System.getProperty("java.home") + "/../lib/tools.jar" +
File.pathSeparator + "ext/slf4j-api-1.5.0.jar" + File.pathSeparator + "ext/slf4j-api-1.5.0.jar" +
File.pathSeparator + "ext/servlet-api-2.4.jar" + File.pathSeparator + "ext/servlet-api-2.4.jar" +
File.pathSeparator + "ext/lucene-core-2.2.0.jar", File.pathSeparator + "ext/lucene-core-2.2.0.jar" +
File.pathSeparator + "ext/org.osgi.core-1.2.0.jar",
"-subpackages", "org.h2", "-subpackages", "org.h2",
"-exclude", "org.h2.test.jaqu:org.h2.jaqu", "-exclude", "org.h2.test.jaqu:org.h2.jaqu",
"-package", "-package",
......
...@@ -564,4 +564,4 @@ strictly greg germany abbreviates frontends cleversafe payload cloneable ...@@ -564,4 +564,4 @@ strictly greg germany abbreviates frontends cleversafe payload cloneable
scripting jaks reconnected serverlist safes somewhere anzo war contacts helpful scripting jaks reconnected serverlist safes somewhere anzo war contacts helpful
implies looping cataloguing mapper frees javaw geographic borges grass implies looping cataloguing mapper frees javaw geographic borges grass
somehow marcio groove roy gis matt targeted brazil dig opt deregister somehow marcio groove roy gis matt targeted brazil dig opt deregister
classname recaptcha classname recaptcha unload unloaded unloads activator
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论