Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
09406c99
提交
09406c99
authored
12月 12, 2012
作者:
noelgrandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improved OSGi support. H2 now registers itself as a DataSourceFactory service. Fixes issue 365.
上级
61f2493e
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
336 行增加
和
16 行删除
+336
-16
changelog.html
h2/src/docsrc/html/changelog.html
+1
-0
tutorial.html
h2/src/docsrc/html/tutorial.html
+16
-0
MANIFEST.MF
h2/src/main/META-INF/MANIFEST.MF
+30
-1
DbDriverActivator.java
h2/src/main/org/h2/util/DbDriverActivator.java
+19
-9
OsgiDataSourceFactory.java
h2/src/main/org/h2/util/OsgiDataSourceFactory.java
+258
-0
Build.java
h2/src/tools/org/h2/build/Build.java
+12
-6
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
09406c99
...
...
@@ -26,6 +26,7 @@ Change Log
</ul><li>
MVStore: compress is now disabled by default, and can be enabled on request.
</ul><li>
Support ALTER TABLE ADD ... AFTER. Patch from Andrew Gaul argaul@gmail.com. Fixes issue 401.
</ul><li>
support "SELECT version()". Patch from Andrew Gaul argaul@gmail.com. Fixes issue 406.
</ul><li>
Improved OSGi support. H2 now registers itself as a DataSourceFactory service. Fixes issue 365.
</li></ul>
<h2>
Version 1.3.170 (2012-11-30)
</h2>
...
...
h2/src/docsrc/html/tutorial.html
浏览文件 @
09406c99
...
...
@@ -66,6 +66,8 @@ Tutorial
Date and Time
</a><br
/>
<a
href=
"#spring"
>
Using Spring
</a><br
/>
<a
href=
"#osgi"
>
OSGi
</a><br
/>
<a
href=
"#jmx"
>
Java Management Extension (JMX)
</a><br
/>
...
...
@@ -1407,6 +1409,20 @@ The workaround is to add the following XML file to the root of the classpath:
<
/beans
>
</pre>
<h2
id=
"osgi"
>
OSGi
</h2>
<p>
The standard H2 jar can be dropped in as a bundle in an OSGi container. H2 implements the
JDBC Service defined in OSGi Service Platform Release 4 Version 4.2 Enterprise Specification.
The H2 Data Source Factory service is registered with the following properties
OSGI_JDBC_DRIVER_CLASS=org.h2.Driver and OSGI_JDBC_DRIVER_NAME=H2. The OSGI_JDBC_DRIVER_VERSION
property reflects the version of the driver as is.
</p>
<p>
The following standard configuration properties are supported: JDBC_USER, JDBC_PASSWORD, JDBC_DESCRIPTION,
JDBC_DATASOURCE_NAME, JDBC_NETWORK_PROTOCOL, JDBC_URL, JDBC_SERVER_NAME, JDBC_PORT_NUMBER. Any other standard
property will be rejected. Non-standard properties will be passed on to H2 in the connection URL.
</p>
<h2
id=
"jmx"
>
Java Management Extension (JMX)
</h2>
<p>
Management over JMX is supported, but not enabled by default.
...
...
h2/src/main/META-INF/MANIFEST.MF
浏览文件 @
09406c99
...
...
@@ -11,10 +11,39 @@ Bundle-Name: H2 Database Engine
Bundle-SymbolicName: org.h2
Bundle-Vendor: H2 Group
Bundle-Version: ${version}
DynamicImport-Package: *
Bundle-License: http://www.h2database.com/html/license.html
Bundle-Category: jdbc
Import-Package: javax.management,
javax.naming;resolution:=optional,
javax.naming.spi;resolution:=optional,
javax.net,
javax.net.ssl,
javax.servlet;resolution:=optional,
javax.servlet.http;resolution:=optional,
javax.sql,
javax.transaction.xa;resolution:=optional,
org.apache.lucene.analysis;version="[3.0.0,3.1.0)";resolution:=optional,
org.apache.lucene.analysis.standard;version="[3.0.0,3.1.0)";resolution:=optional,
org.apache.lucene.document;version="[3.0.0,3.1.0)";resolution:=optional,
org.apache.lucene.index;version="[3.0.0,3.1.0)";resolution:=optional,
org.apache.lucene.queryParser;version="[3.0.0,3.1.0)";resolution:=optional,
org.apache.lucene.search;version="[3.0.0,3.1.0)";resolution:=optional,
org.apache.lucene.store;version="[3.0.0,3.1.0)";resolution:=optional,
org.apache.lucene.util;version="[3.0.0,3.1.0)";resolution:=optional,
org.h2;version="[${version},1.4.0)",
org.h2.api;version="[${version},1.4.0)",
org.h2.fulltext;version="[${version},1.4.0)",
org.h2.jdbcx;version="[${version},1.4.0)",
org.h2.tools;version="[${version},1.4.0)",
org.h2.util;version="[${version},1.4.0)",
org.osgi.framework;version="1.5",
org.osgi.service.jdbc;version="1.0",
org.slf4j;version="[1.6.0,1.7.0)";resolution:=optional
Export-Package: org.h2;version="${version}",
org.h2.api;version="${version}",
org.h2.constant;version="${version}",
org.h2.fulltext;version="${version}",
org.h2.jdbc;version="${version}",
org.h2.jdbcx;version="${version}",
org.h2.tools;version="${version}",
org.h2.util;version="${version}"
...
...
h2/src/main/org/h2/util/DbDriverActivator.java
浏览文件 @
09406c99
/*
* Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package
org
.
h2
.
util
;
import
java.util.Properties
;
import
org.h2.engine.Constants
;
import
org.osgi.framework.BundleActivator
;
import
org.osgi.framework.BundleContext
;
import
org.osgi.service.jdbc.DataSourceFactory
;
/**
* The driver activator loads the H2 driver when starting the bundle.
*
The driver
is unloaded when stopping the bundle.
* The driver activator loads the H2 driver when starting the bundle.
The driver
* is unloaded when stopping the bundle.
*/
public
class
DbDriverActivator
implements
BundleActivator
{
/**
* Start the bundle. This will load and register the database driver.
* Start the bundle. This will load the database driver and register the
* DataSourceFactory service.
*
* @param bundleContext the bundle context
*/
public
void
start
(
BundleContext
bundleContext
)
{
org
.
h2
.
Driver
.
load
();
org
.
h2
.
Driver
driver
=
org
.
h2
.
Driver
.
load
();
Properties
properties
=
new
Properties
();
properties
.
put
(
DataSourceFactory
.
OSGI_JDBC_DRIVER_CLASS
,
org
.
h2
.
Driver
.
class
.
getName
());
properties
.
put
(
DataSourceFactory
.
OSGI_JDBC_DRIVER_NAME
,
"H2"
);
properties
.
put
(
DataSourceFactory
.
OSGI_JDBC_DRIVER_VERSION
,
Constants
.
getVersion
());
bundleContext
.
registerService
(
DataSourceFactory
.
class
.
getName
(),
new
OsgiDataSourceFactory
(
driver
),
properties
);
}
/**
* Stop the bundle. This will deregister the database driver.
* Stop the bundle. This will unload the database driver. The
* DataSourceFactory service is implicitly un-registered by the OSGi
* framework.
*
* @param bundleContext the bundle context
*/
...
...
h2/src/main/org/h2/util/OsgiDataSourceFactory.java
0 → 100644
浏览文件 @
09406c99
差异被折叠。
点击展开。
h2/src/tools/org/h2/build/Build.java
浏览文件 @
09406c99
...
...
@@ -112,7 +112,8 @@ public class Build extends BuildBase {
File
.
pathSeparator
+
"ext/servlet-api-2.4.jar"
+
File
.
pathSeparator
+
"ext/"
+
getLuceneJar
()
+
File
.
pathSeparator
+
"ext/h2mig_pagestore_addon.jar"
+
File
.
pathSeparator
+
"ext/org.osgi.core-1.2.0.jar"
+
File
.
pathSeparator
+
"ext/org.osgi.core-4.2.0.jar"
+
File
.
pathSeparator
+
"ext/org.osgi.enterprise-4.2.0.jar"
+
File
.
pathSeparator
+
"ext/slf4j-api-1.6.0.jar"
+
File
.
pathSeparator
+
"ext/slf4j-nop-1.6.0.jar"
+
File
.
pathSeparator
+
System
.
getProperty
(
"java.home"
)
+
"/../lib/tools.jar"
;
...
...
@@ -155,7 +156,8 @@ public class Build extends BuildBase {
File
.
pathSeparator
+
"ext/servlet-api-2.4.jar"
+
File
.
pathSeparator
+
"ext/"
+
getLuceneJar
()
+
File
.
pathSeparator
+
"ext/slf4j-api-1.6.0.jar"
+
File
.
pathSeparator
+
"ext/org.osgi.core-1.2.0.jar"
+
File
.
pathSeparator
+
"ext/org.osgi.core-4.2.0.jar"
+
File
.
pathSeparator
+
"ext/org.osgi.enterprise-4.2.0.jar"
+
File
.
pathSeparator
+
System
.
getProperty
(
"java.home"
)
+
"/../lib/tools.jar"
;
FileList
files
;
if
(
clientOnly
)
{
...
...
@@ -244,8 +246,10 @@ public class Build extends BuildBase {
}
downloadOrVerify
(
"ext/slf4j-api-1.6.0.jar"
,
"org/slf4j"
,
"slf4j-api"
,
"1.6.0"
,
"b353147a7d51fcfcd818d8aa6784839783db0915"
,
offline
);
downloadOrVerify
(
"ext/org.osgi.core-1.2.0.jar"
,
"org/apache/felix"
,
"org.osgi.core"
,
"1.2.0"
,
"3006beb1ca6a83449def6127dad3c060148a0209"
,
offline
);
downloadOrVerify
(
"ext/org.osgi.core-4.2.0.jar"
,
"org/osgi"
,
"org.osgi.core"
,
"4.2.0"
,
"66ab449ff3aa5c4adfc82c89025cc983b422eb95"
,
offline
);
downloadOrVerify
(
"ext/org.osgi.enterprise-4.2.0.jar"
,
"org/osgi"
,
"org.osgi.enterprise"
,
"4.2.0"
,
"8634dcb0fc62196e820ed0f1062993c377f74972"
,
offline
);
}
private
void
downloadOrVerify
(
String
target
,
String
group
,
String
artifact
,
...
...
@@ -506,7 +510,8 @@ public class Build extends BuildBase {
File
.
pathSeparator
+
"ext/slf4j-api-1.6.0.jar"
+
File
.
pathSeparator
+
"ext/servlet-api-2.4.jar"
+
File
.
pathSeparator
+
"ext/"
+
getLuceneJar
()
+
File
.
pathSeparator
+
"ext/org.osgi.core-1.2.0.jar"
,
File
.
pathSeparator
+
"ext/org.osgi.core-4.2.0.jar"
,
File
.
pathSeparator
+
"ext/org.osgi.enterprise-4.2.0.jar"
,
"-subpackages"
,
"org.h2"
,
"-exclude"
,
"org.h2.test.jaqu:org.h2.jaqu"
);
System
.
setProperty
(
"h2.interfacesOnly"
,
"false"
);
...
...
@@ -516,7 +521,8 @@ public class Build extends BuildBase {
File
.
pathSeparator
+
"ext/slf4j-api-1.6.0.jar"
+
File
.
pathSeparator
+
"ext/servlet-api-2.4.jar"
+
File
.
pathSeparator
+
"ext/"
+
getLuceneJar
()
+
File
.
pathSeparator
+
"ext/org.osgi.core-1.2.0.jar"
,
File
.
pathSeparator
+
"ext/org.osgi.core-4.2.0.jar"
+
File
.
pathSeparator
+
"ext/org.osgi.enterprise-4.2.0.jar"
,
"-subpackages"
,
"org.h2"
,
"-exclude"
,
"org.h2.test.jaqu:org.h2.jaqu"
,
"-package"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论