Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
f1482f1d
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,发现更多精彩内容 >>
提交
f1482f1d
编写于
1月 07, 2018
作者:
A
Alexander Fedorov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#2556 remove SESSION_INFO extends DBGSessionInfo from template
Former-commit-id:
db1b56b8
上级
0278cd89
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
65 addition
and
38 deletion
+65
-38
plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/DBGBaseController.java
...g.core/src/org/jkiss/dbeaver/debug/DBGBaseController.java
+5
-5
plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/DBGController.java
...debug.core/src/org/jkiss/dbeaver/debug/DBGController.java
+4
-7
plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/DBGSession.java
...er.debug.core/src/org/jkiss/dbeaver/debug/DBGSession.java
+3
-2
plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/DBGSessionManager.java
...g.core/src/org/jkiss/dbeaver/debug/DBGSessionManager.java
+3
-3
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/PostgreDebugController.java
...ext/postgresql/debug/internal/PostgreDebugController.java
+2
-2
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/console/Debugger.java
...eaver/ext/postgresql/debug/internal/console/Debugger.java
+11
-6
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugSession.java
...t/postgresql/debug/internal/impl/PostgreDebugSession.java
+20
-10
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugSessionInfo.java
...stgresql/debug/internal/impl/PostgreDebugSessionInfo.java
+14
-0
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugSessionManager.java
...resql/debug/internal/impl/PostgreDebugSessionManager.java
+3
-3
未找到文件。
plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/DBGBaseController.java
浏览文件 @
f1482f1d
...
...
@@ -40,7 +40,7 @@ public abstract class DBGBaseController implements DBGController {
}
@Override
public
DBGSession
connect
(
DBRProgressMonitor
monitor
)
throws
DBGException
{
public
DBGSession
<?>
connect
(
DBRProgressMonitor
monitor
)
throws
DBGException
{
DBPDataSource
dataSource
=
dataSourceContainer
.
getDataSource
();
if
(!
dataSourceContainer
.
isConnected
())
{
throw
new
DBGException
(
"Not connected to database"
);
...
...
@@ -55,22 +55,22 @@ public abstract class DBGBaseController implements DBGController {
}
}
protected
abstract
DBGSession
createSession
(
DBRProgressMonitor
monitor
,
DBPDataSource
dataSource
)
throws
DBGException
;
protected
abstract
DBGSession
<?>
createSession
(
DBRProgressMonitor
monitor
,
DBPDataSource
dataSource
)
throws
DBGException
;
@Override
public
void
resume
(
DBRProgressMonitor
monitor
,
DBGSession
session
)
throws
DBGException
{
public
void
resume
(
DBRProgressMonitor
monitor
,
DBGSession
<?>
session
)
throws
DBGException
{
// TODO Auto-generated method stub
}
@Override
public
void
suspend
(
DBRProgressMonitor
monitor
,
DBGSession
session
)
throws
DBGException
{
public
void
suspend
(
DBRProgressMonitor
monitor
,
DBGSession
<?>
session
)
throws
DBGException
{
// TODO Auto-generated method stub
}
@Override
public
void
terminate
(
DBRProgressMonitor
monitor
,
DBGSession
session
)
throws
DBGException
{
public
void
terminate
(
DBRProgressMonitor
monitor
,
DBGSession
<?>
session
)
throws
DBGException
{
}
...
...
plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/DBGController.java
浏览文件 @
f1482f1d
...
...
@@ -17,23 +17,20 @@
*/
package
org.jkiss.dbeaver.debug
;
import
java.util.Map
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.registry.DataSourceDescriptor
;
/**
* This interface is expected to be used in synch manner
*/
public
interface
DBGController
{
DBGSession
connect
(
DBRProgressMonitor
monitor
)
throws
DBGException
;
DBGSession
<?>
connect
(
DBRProgressMonitor
monitor
)
throws
DBGException
;
void
resume
(
DBRProgressMonitor
monitor
,
DBGSession
session
)
throws
DBGException
;
void
resume
(
DBRProgressMonitor
monitor
,
DBGSession
<?>
session
)
throws
DBGException
;
void
suspend
(
DBRProgressMonitor
monitor
,
DBGSession
session
)
throws
DBGException
;
void
suspend
(
DBRProgressMonitor
monitor
,
DBGSession
<?>
session
)
throws
DBGException
;
void
terminate
(
DBRProgressMonitor
monitor
,
DBGSession
session
)
throws
DBGException
;
void
terminate
(
DBRProgressMonitor
monitor
,
DBGSession
<?>
session
)
throws
DBGException
;
void
dispose
()
throws
DBGException
;
...
...
plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/DBGSession.java
浏览文件 @
f1482f1d
...
...
@@ -19,10 +19,11 @@
package
org.jkiss.dbeaver.debug
;
import
java.util.List
;
import
java.util.Map
;
public
interface
DBGSession
<
SESSION_INFO
extends
DBGSessionInfo
,
DEBUG_OBJECT
extends
DBGObject
>
{
public
interface
DBGSession
<
DEBUG_OBJECT
extends
DBGObject
>
{
SESSION_INFO
getSessionInfo
();
Map
<
String
,
Object
>
getSessionInfo
();
String
getTitle
();
...
...
plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/DBGSessionManager.java
浏览文件 @
f1482f1d
...
...
@@ -27,13 +27,13 @@ public interface DBGSessionManager {
List
<?
extends
DBGSessionInfo
>
getSessions
()
throws
DBGException
;
DBGSession
<?
extends
DBG
SessionInfo
,
?
extends
DBG
Object
>
getDebugSession
(
Object
id
)
throws
DBGException
;
DBGSession
<?
extends
DBGObject
>
getDebugSession
(
Object
id
)
throws
DBGException
;
List
<
DBGSession
<?
,
?
>>
getDebugSessions
()
throws
DBGException
;
List
<
DBGSession
<?>>
getDebugSessions
()
throws
DBGException
;
void
terminateSession
(
Object
id
);
DBGSession
<?
extends
DBG
SessionInfo
,
?
extends
DBG
Object
>
createDebugSession
(
DBCExecutionContext
connection
)
throws
DBGException
;
DBGSession
<?
extends
DBGObject
>
createDebugSession
(
DBCExecutionContext
connection
)
throws
DBGException
;
boolean
isSessionExists
(
Object
id
);
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/PostgreDebugController.java
浏览文件 @
f1482f1d
...
...
@@ -48,11 +48,11 @@ public class PostgreDebugController extends DBGBaseController {
}
@Override
protected
DBGSession
createSession
(
DBRProgressMonitor
monitor
,
DBPDataSource
dataSource
)
throws
DBGException
{
protected
DBGSession
<?>
createSession
(
DBRProgressMonitor
monitor
,
DBPDataSource
dataSource
)
throws
DBGException
{
PostgreDebugSessionManager
sessionManager
=
getSessionManager
(
monitor
);
try
{
JDBCExecutionContext
sessionContext
=
(
JDBCExecutionContext
)
getDataSourceContainer
().
getDataSource
().
openIsolatedContext
(
monitor
,
"Debug session"
);
return
this
.
sessionManager
.
createDebugSession
(
sessionContext
);
return
sessionManager
.
createDebugSession
(
sessionContext
);
}
catch
(
DBException
e
)
{
throw
new
DBGException
(
"Can't initiate debug session"
,
e
);
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/console/Debugger.java
浏览文件 @
f1482f1d
...
...
@@ -27,8 +27,13 @@ import org.jkiss.dbeaver.debug.DBGException;
import
org.jkiss.dbeaver.debug.DBGSession
;
import
org.jkiss.dbeaver.debug.DBGStackFrame
;
import
org.jkiss.dbeaver.debug.DBGVariable
;
import
org.jkiss.dbeaver.ext.postgresql.debug.internal.impl.*
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext
;
import
org.jkiss.dbeaver.ext.postgresql.debug.internal.impl.PostgreDebugBreakpoint
;
import
org.jkiss.dbeaver.ext.postgresql.debug.internal.impl.PostgreDebugBreakpointProperties
;
import
org.jkiss.dbeaver.ext.postgresql.debug.internal.impl.PostgreDebugObject
;
import
org.jkiss.dbeaver.ext.postgresql.debug.internal.impl.PostgreDebugSession
;
import
org.jkiss.dbeaver.ext.postgresql.debug.internal.impl.PostgreDebugSessionInfo
;
import
org.jkiss.dbeaver.ext.postgresql.debug.internal.impl.PostgreDebugSessionManager
;
import
org.jkiss.dbeaver.ext.postgresql.debug.internal.impl.PostgreDebugVariable
;
@SuppressWarnings
(
"nls"
)
public
class
Debugger
{
...
...
@@ -206,7 +211,7 @@ public class Debugger {
PostgreDebugSession
debugSession
=
null
;
List
<
DBGSession
<?
,
?
>>
sessions
=
pgDbgManager
.
getDebugSessions
();
List
<
DBGSession
<?>>
sessions
=
pgDbgManager
.
getDebugSessions
();
Scanner
scArg
;
...
...
@@ -220,7 +225,7 @@ public class Debugger {
int
sessNo
=
1
;
for
(
DBGSession
<?
,
?
>
s
:
sessions
)
{
for
(
DBGSession
<?>
s
:
sessions
)
{
System
.
out
.
println
(
String
.
format
(
" (%d) %s"
,
sessNo
++,
s
.
toString
()));
}
...
...
@@ -333,7 +338,7 @@ public class Debugger {
break
;
}
pgDbgManager
.
terminateSession
(
debugSessionC
.
getSessionI
nfo
().
getPi
d
());
pgDbgManager
.
terminateSession
(
debugSessionC
.
getSessionId
());
System
.
out
.
println
(
"Session closed"
);
...
...
@@ -657,7 +662,7 @@ public class Debugger {
System
.
out
.
println
(
"no debug sessions"
);
break
;
}
for
(
DBGSession
<?
,
?
>
s
:
pgDbgManager
.
getDebugSessions
())
{
for
(
DBGSession
<?>
s
:
pgDbgManager
.
getDebugSessions
())
{
System
.
out
.
println
(
s
);
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugSession.java
浏览文件 @
f1482f1d
...
...
@@ -18,21 +18,31 @@
package
org.jkiss.dbeaver.ext.postgresql.debug.internal.impl
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.debug.*
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContext
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext
;
import
org.jkiss.dbeaver.model.runtime.VoidProgressMonitor
;
import
java.sql.*
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.FutureTask
;
import
java.util.concurrent.locks.ReentrantReadWriteLock
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.debug.DBGBreakpoint
;
import
org.jkiss.dbeaver.debug.DBGBreakpointProperties
;
import
org.jkiss.dbeaver.debug.DBGException
;
import
org.jkiss.dbeaver.debug.DBGSession
;
import
org.jkiss.dbeaver.debug.DBGStackFrame
;
import
org.jkiss.dbeaver.debug.DBGVariable
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContext
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext
;
import
org.jkiss.dbeaver.model.runtime.VoidProgressMonitor
;
@SuppressWarnings
(
"nls"
)
public
class
PostgreDebugSession
implements
DBGSession
<
PostgreDebug
SessionInfo
,
PostgreDebug
Object
>
{
public
class
PostgreDebugSession
implements
DBGSession
<
PostgreDebugObject
>
{
private
static
final
Log
log
=
Log
.
getLog
(
PostgreDebugSession
.
class
);
...
...
@@ -140,9 +150,9 @@ public class PostgreDebugSession implements DBGSession<PostgreDebugSessionInfo,
}
@Override
public
PostgreDebugSessionInfo
getSessionInfo
()
{
public
Map
<
String
,
Object
>
getSessionInfo
()
{
return
sessionDebugInfo
;
return
sessionDebugInfo
.
toMap
()
;
}
@Override
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugSessionInfo.java
浏览文件 @
f1482f1d
...
...
@@ -18,6 +18,9 @@
package
org.jkiss.dbeaver.ext.postgresql.debug.internal.impl
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.jkiss.dbeaver.debug.DBGSessionInfo
;
@SuppressWarnings
(
"nls"
)
...
...
@@ -72,4 +75,15 @@ public class PostgreDebugSessionInfo implements DBGSessionInfo {
+
state
+
", query: "
+
query
.
replace
(
'\n'
,
'\\'
);
}
public
Map
<
String
,
Object
>
toMap
()
{
//FIXME: declare constants elsewhere, it is the part of metadata
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"pid"
,
pid
);
map
.
put
(
"user"
,
user
);
map
.
put
(
"application"
,
application
);
map
.
put
(
"state"
,
state
);
map
.
put
(
"query"
,
query
);
return
map
;
}
}
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugSessionManager.java
浏览文件 @
f1482f1d
...
...
@@ -131,7 +131,7 @@ public class PostgreDebugSessionManager implements DBGSessionManager {
}
@Override
public
DBGSession
<
PostgreDebug
SessionInfo
,
PostgreDebug
Object
>
getDebugSession
(
Object
id
)
public
DBGSession
<
PostgreDebugObject
>
getDebugSession
(
Object
id
)
throws
DBGException
{
return
sessions
.
get
(
id
);
}
...
...
@@ -174,8 +174,8 @@ public class PostgreDebugSessionManager implements DBGSessionManager {
}
@Override
public
List
<
DBGSession
<?
,
?
>>
getDebugSessions
()
throws
DBGException
{
return
new
ArrayList
<
DBGSession
<?
,
?
>>(
sessions
.
values
());
public
List
<
DBGSession
<?>>
getDebugSessions
()
throws
DBGException
{
return
new
ArrayList
<
DBGSession
<?>>(
sessions
.
values
());
}
@Override
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录