Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
016a7adf
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
016a7adf
编写于
6月 25, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Plugin services model
Former-commit-id:
111f684d
上级
814f5610
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
275 addition
and
3 deletion
+275
-3
docs/todo.txt
docs/todo.txt
+1
-0
plugins/org.jkiss.dbeaver.core/plugin.xml
plugins/org.jkiss.dbeaver.core/plugin.xml
+1
-0
plugins/org.jkiss.dbeaver.core/schema/org.jkiss.dbeaver.pluginService.exsd
....dbeaver.core/schema/org.jkiss.dbeaver.pluginService.exsd
+143
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverCore.java
....dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverCore.java
+24
-3
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/PluginServiceRegistry.java
...src/org/jkiss/dbeaver/registry/PluginServiceRegistry.java
+74
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/ProjectRegistry.java
....core/src/org/jkiss/dbeaver/registry/ProjectRegistry.java
+1
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/IPluginService.java
...er.core/src/org/jkiss/dbeaver/runtime/IPluginService.java
+31
-0
未找到文件。
docs/todo.txt
浏览文件 @
016a7adf
DBeaver features usage model
Data transfer DECIMAL(x,y) types convert.
Extract non-visual part to a separate plugin (preferences + editors)
RSV find/replace action
...
...
plugins/org.jkiss.dbeaver.core/plugin.xml
浏览文件 @
016a7adf
...
...
@@ -21,6 +21,7 @@
-->
<plugin>
<extension-point
id=
"org.jkiss.dbeaver.pluginService"
name=
"Plugin service"
schema=
"schema/org.jkiss.dbeaver.pluginService.exsd"
/>
<extension-point
id=
"org.jkiss.dbeaver.dataSourceProvider"
name=
"DataSource provider"
schema=
"schema/org.jkiss.dbeaver.dataSourceProvider.exsd"
/>
<extension-point
id=
"org.jkiss.dbeaver.databaseEditor"
name=
"Custom Entity Editor"
schema=
"schema/org.jkiss.dbeaver.databaseEditor.exsd"
/>
<extension-point
id=
"org.jkiss.dbeaver.dataTypeProvider"
name=
"DataType provider"
schema=
"schema/org.jkiss.dbeaver.dataTypeProvider.exsd"
/>
...
...
plugins/org.jkiss.dbeaver.core/schema/org.jkiss.dbeaver.pluginService.exsd
0 → 100644
浏览文件 @
016a7adf
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema
targetNamespace=
"org.jkiss.dbeaver.core"
xmlns=
"http://www.w3.org/2001/XMLSchema"
>
<annotation>
<appInfo>
<meta.schema
plugin=
"org.jkiss.dbeaver.core"
id=
"org.jkiss.dbeaver.pluginService"
name=
"Plugin Service"
/>
</appInfo>
<documentation>
Plugin Service
</documentation>
</annotation>
<element
name=
"extension"
>
<annotation>
<appInfo>
<meta.element
/>
</appInfo>
</annotation>
<complexType>
<sequence>
<element
ref=
"service"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
</sequence>
<attribute
name=
"point"
type=
"string"
use=
"required"
>
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute
name=
"class"
type=
"string"
>
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<element
name=
"handler"
>
<complexType>
<attribute
name=
"id"
type=
"string"
>
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute
name=
"label"
type=
"string"
>
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute
translatable=
"true"
/>
</appInfo>
</annotation>
</attribute>
<attribute
name=
"description"
type=
"string"
>
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute
translatable=
"true"
/>
</appInfo>
</annotation>
</attribute>
<attribute
name=
"type"
type=
"string"
use=
"required"
>
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute
name=
"secured"
type=
"boolean"
>
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute
name=
"handlerClass"
type=
"string"
>
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute
kind=
"java"
basedOn=
":org.jkiss.dbeaver.model.net.DBWNetworkHandler"
/>
</appInfo>
</annotation>
</attribute>
<attribute
name=
"uiClass"
type=
"string"
>
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute
kind=
"java"
basedOn=
":org.jkiss.dbeaver.ui.IObjectPropertyConfigurator"
/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section
type=
"since"
/>
</appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section
type=
"examples"
/>
</appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section
type=
"apiinfo"
/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section
type=
"implementation"
/>
</appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverCore.java
浏览文件 @
016a7adf
...
...
@@ -24,6 +24,8 @@ import org.jkiss.code.NotNull;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.DBPApplication
;
import
org.jkiss.dbeaver.model.DBPPreferenceStore
;
import
org.jkiss.dbeaver.registry.PluginServiceRegistry
;
import
org.jkiss.dbeaver.runtime.IPluginService
;
import
org.jkiss.dbeaver.runtime.net.GlobalProxyAuthenticator
;
import
org.jkiss.dbeaver.runtime.net.GlobalProxySelector
;
import
org.jkiss.dbeaver.model.navigator.DBNModel
;
...
...
@@ -67,6 +69,8 @@ public class DBeaverCore implements DBPApplication {
private
QMLogFileWriter
qmLogWriter
;
private
ProjectRegistry
projectRegistry
;
private
final
List
<
IPluginService
>
activatedServices
=
new
ArrayList
<
IPluginService
>();
private
static
boolean
disposed
=
false
;
public
static
DBeaverCore
getInstance
()
...
...
@@ -156,8 +160,6 @@ public class DBeaverCore implements DBPApplication {
this
.
localSystem
=
new
OSDescriptor
(
Platform
.
getOS
(),
Platform
.
getOSArch
());
IExtensionRegistry
extensionRegistry
=
Platform
.
getExtensionRegistry
();
this
.
queryManager
=
new
QMControllerImpl
();
this
.
qmLogWriter
=
new
QMLogFileWriter
();
this
.
queryManager
.
registerMetaListener
(
qmLogWriter
);
...
...
@@ -168,7 +170,6 @@ public class DBeaverCore implements DBPApplication {
// Init project registry
this
.
projectRegistry
=
new
ProjectRegistry
(
workspace
);
this
.
projectRegistry
.
loadExtensions
(
extensionRegistry
);
// Projects registry
initializeProjects
();
...
...
@@ -176,6 +177,16 @@ public class DBeaverCore implements DBPApplication {
// Navigator model
this
.
navigatorModel
=
new
DBNModel
();
this
.
navigatorModel
.
initialize
();
// Activate plugin services
for
(
IPluginService
pluginService
:
PluginServiceRegistry
.
getInstance
().
getServices
())
{
try
{
pluginService
.
activateService
();
activatedServices
.
add
(
pluginService
);
}
catch
(
Exception
e
)
{
log
.
error
(
"Error activating plugin service"
,
e
);
}
}
}
private
void
initializeProjects
()
...
...
@@ -219,6 +230,16 @@ public class DBeaverCore implements DBPApplication {
DBeaverCore
.
setClosing
(
true
);
// Deactivate plugin services
for
(
IPluginService
pluginService
:
activatedServices
)
{
try
{
pluginService
.
deactivateService
();
}
catch
(
Exception
e
)
{
log
.
error
(
"Error deactivating plugin service"
,
e
);
}
}
activatedServices
.
clear
();
// Dispose navigator model first
// It is a part of UI
if
(
this
.
navigatorModel
!=
null
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/PluginServiceRegistry.java
0 → 100644
浏览文件 @
016a7adf
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2015 Serge Rieder (serge@jkiss.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2)
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package
org.jkiss.dbeaver.registry
;
import
org.eclipse.core.runtime.IConfigurationElement
;
import
org.eclipse.core.runtime.IExtensionRegistry
;
import
org.eclipse.core.runtime.Platform
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.runtime.IPluginService
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
PluginServiceRegistry
{
public
static
final
String
EXTENSION_ID
=
"org.jkiss.dbeaver.pluginService"
;
//$NON-NLS-1$
private
static
PluginServiceRegistry
instance
=
null
;
private
class
ServiceDescriptor
extends
AbstractDescriptor
{
private
final
ObjectType
type
;
protected
ServiceDescriptor
(
IConfigurationElement
config
)
{
super
(
config
);
type
=
new
ObjectType
(
config
.
getAttribute
(
RegistryConstants
.
ATTR_CLASS
));
}
}
public
synchronized
static
PluginServiceRegistry
getInstance
()
{
if
(
instance
==
null
)
{
instance
=
new
PluginServiceRegistry
(
Platform
.
getExtensionRegistry
());
}
return
instance
;
}
private
final
List
<
IPluginService
>
services
=
new
ArrayList
<
IPluginService
>();
private
PluginServiceRegistry
(
IExtensionRegistry
registry
)
{
IConfigurationElement
[]
extElements
=
registry
.
getConfigurationElementsFor
(
EXTENSION_ID
);
for
(
IConfigurationElement
ext
:
extElements
)
{
ServiceDescriptor
serviceDescriptor
=
new
ServiceDescriptor
(
ext
);
try
{
IPluginService
pluginService
=
serviceDescriptor
.
type
.
createInstance
(
IPluginService
.
class
);
services
.
add
(
pluginService
);
}
catch
(
DBException
e
)
{
ServiceDescriptor
.
log
.
error
(
"Can't create plugin service"
,
e
);
}
}
}
public
List
<
IPluginService
>
getServices
()
{
return
services
;
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/ProjectRegistry.java
浏览文件 @
016a7adf
...
...
@@ -56,6 +56,7 @@ public class ProjectRegistry {
public
ProjectRegistry
(
IWorkspace
workspace
)
{
this
.
workspace
=
workspace
;
loadExtensions
(
Platform
.
getExtensionRegistry
());
}
public
void
loadExtensions
(
IExtensionRegistry
registry
)
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/IPluginService.java
0 → 100644
浏览文件 @
016a7adf
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2015 Serge Rieder (serge@jkiss.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2)
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package
org.jkiss.dbeaver.runtime
;
/**
* Plugin service.
* Activated/deactivated by DBeaver core on startup/shutdown.
*/
public
interface
IPluginService
{
void
activateService
();
void
deactivateService
();
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录