Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
c419e7da
F
Flowable Engine
项目概览
开发团队
/
Flowable Engine
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Flowable Engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c419e7da
编写于
1月 10, 2013
作者:
F
Frederik Heremans
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed intermittent failing test + added ProcessEngine lifecycle listener
+ altere JTA-oracle configuration
上级
33c851b4
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
135 addition
and
13 deletion
+135
-13
modules/activiti-engine/pom.xml
modules/activiti-engine/pom.xml
+8
-6
modules/activiti-engine/src/main/java/org/activiti/engine/ProcessEngineConfiguration.java
.../java/org/activiti/engine/ProcessEngineConfiguration.java
+9
-2
modules/activiti-engine/src/main/java/org/activiti/engine/ProcessEngineLifecycleListener.java
...a/org/activiti/engine/ProcessEngineLifecycleListener.java
+37
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/ProcessEngineImpl.java
...main/java/org/activiti/engine/impl/ProcessEngineImpl.java
+10
-0
modules/activiti-engine/src/test/java/org/activiti/engine/test/api/runtime/ExecutionQueryTest.java
.../activiti/engine/test/api/runtime/ExecutionQueryTest.java
+4
-1
modules/activiti-engine/src/test/java/org/activiti/engine/test/api/runtime/ProcessInstanceQueryTest.java
...iti/engine/test/api/runtime/ProcessInstanceQueryTest.java
+4
-1
modules/activiti-engine/src/test/java/org/activiti/standalone/jta/CloseXADataSourceLifecycleListener.java
...ti/standalone/jta/CloseXADataSourceLifecycleListener.java
+55
-0
qa/jta/oracle/activiti.cfg.xml
qa/jta/oracle/activiti.cfg.xml
+8
-3
未找到文件。
modules/activiti-engine/pom.xml
浏览文件 @
c419e7da
...
...
@@ -129,6 +129,14 @@
<artifactId>
slf4j-log4j12
</artifactId>
<scope>
test
</scope>
</dependency>
<!-- Required for testing JTA -->
<dependency>
<groupId>
org.codehaus.btm
</groupId>
<artifactId>
btm
</artifactId>
<version>
2.1.3
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
...
...
@@ -472,12 +480,6 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>
org.codehaus.btm
</groupId>
<artifactId>
btm
</artifactId>
<version>
2.1.3
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-jdk14
</artifactId>
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/ProcessEngineConfiguration.java
浏览文件 @
c419e7da
...
...
@@ -128,6 +128,7 @@ public abstract class ProcessEngineConfiguration implements EngineServices {
protected
String
activityFontName
=
"Arial"
;
protected
ClassLoader
classLoader
;
protected
ProcessEngineLifecycleListener
processEngineLifecycleListener
;
/** use one of the static createXxxx methods instead */
protected
ProcessEngineConfiguration
()
{
...
...
@@ -510,6 +511,12 @@ public abstract class ProcessEngineConfiguration implements EngineServices {
public
void
setActivityFontName
(
String
activityFontName
)
{
this
.
activityFontName
=
activityFontName
;
}
public
void
setProcessEngineLifecycleListener
(
ProcessEngineLifecycleListener
processEngineLifecycleListener
)
{
this
.
processEngineLifecycleListener
=
processEngineLifecycleListener
;
}
public
ProcessEngineLifecycleListener
getProcessEngineLifecycleListener
()
{
return
processEngineLifecycleListener
;
}
}
modules/activiti-engine/src/main/java/org/activiti/engine/ProcessEngineLifecycleListener.java
0 → 100644
浏览文件 @
c419e7da
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.engine
;
/**
* Interface describing a listener that get's notified when certain event occurs,
* related to the process-engine lifecycle it is attached to.
*
* @author Frederik Heremans
*/
public
interface
ProcessEngineLifecycleListener
{
/**
* Called right after the process-engine has been built.
*
* @param processEngine engine that was built
*/
void
onProcessEngineBuilt
(
ProcessEngine
processEngine
);
/**
* Called right after the process-engine has been closed.
*
* @param processEngine engine that was closed
*/
void
onProcessEngineClosed
(
ProcessEngine
processEngine
);
}
modules/activiti-engine/src/main/java/org/activiti/engine/impl/ProcessEngineImpl.java
浏览文件 @
c419e7da
...
...
@@ -86,6 +86,11 @@ public class ProcessEngineImpl implements ProcessEngine {
if
((
jobExecutor
!=
null
)
&&
(
jobExecutor
.
isAutoActivate
()))
{
jobExecutor
.
start
();
}
if
(
processEngineConfiguration
.
getProcessEngineLifecycleListener
()
!=
null
)
{
processEngineConfiguration
.
getProcessEngineLifecycleListener
().
onProcessEngineBuilt
(
this
);
}
}
public
void
close
()
{
...
...
@@ -95,6 +100,11 @@ public class ProcessEngineImpl implements ProcessEngine {
}
commandExecutor
.
execute
(
new
SchemaOperationProcessEngineClose
());
if
(
processEngineConfiguration
.
getProcessEngineLifecycleListener
()
!=
null
)
{
processEngineConfiguration
.
getProcessEngineLifecycleListener
().
onProcessEngineClosed
(
this
);
}
}
public
DbSqlSessionFactory
getDbSqlSessionFactory
()
{
...
...
modules/activiti-engine/src/test/java/org/activiti/engine/test/api/runtime/ExecutionQueryTest.java
浏览文件 @
c419e7da
...
...
@@ -741,7 +741,10 @@ public class ExecutionQueryTest extends PluggableActivitiTestCase {
ProcessInstance
processInstance1
=
runtimeService
.
startProcessInstanceByKey
(
"oneTaskProcess"
,
vars
);
Date
date2
=
Calendar
.
getInstance
().
getTime
();
Calendar
cal2
=
Calendar
.
getInstance
();
cal2
.
add
(
Calendar
.
SECOND
,
1
);
Date
date2
=
cal2
.
getTime
();
vars
=
new
HashMap
<
String
,
Object
>();
vars
.
put
(
"dateVar"
,
date1
);
vars
.
put
(
"dateVar2"
,
date2
);
...
...
modules/activiti-engine/src/test/java/org/activiti/engine/test/api/runtime/ProcessInstanceQueryTest.java
浏览文件 @
c419e7da
...
...
@@ -723,7 +723,10 @@ public class ProcessInstanceQueryTest extends PluggableActivitiTestCase {
ProcessInstance
processInstance1
=
runtimeService
.
startProcessInstanceByKey
(
"oneTaskProcess"
,
vars
);
Date
date2
=
Calendar
.
getInstance
().
getTime
();
Calendar
cal2
=
Calendar
.
getInstance
();
cal2
.
add
(
Calendar
.
SECOND
,
1
);
Date
date2
=
cal2
.
getTime
();
vars
=
new
HashMap
<
String
,
Object
>();
vars
.
put
(
"dateVar"
,
date1
);
vars
.
put
(
"dateVar2"
,
date2
);
...
...
modules/activiti-engine/src/test/java/org/activiti/standalone/jta/CloseXADataSourceLifecycleListener.java
0 → 100644
浏览文件 @
c419e7da
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.standalone.jta
;
import
org.activiti.engine.ProcessEngine
;
import
org.activiti.engine.ProcessEngineLifecycleListener
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
bitronix.tm.resource.jdbc.PoolingDataSource
;
/**
* Used in JPA-tests to close the XA-datasource after engine is closed, due to internal caching
* of datasource, independant of process-enging/spring-context.
*
* @author Frederik Heremans
*/
public
class
CloseXADataSourceLifecycleListener
implements
ProcessEngineLifecycleListener
{
private
PoolingDataSource
dataSource
;
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
CloseXADataSourceLifecycleListener
.
class
);
@Override
public
void
onProcessEngineBuilt
(
ProcessEngine
processEngine
)
{
LOG
.
info
(
"--------------------- Callback for engine start"
);
}
@Override
public
void
onProcessEngineClosed
(
ProcessEngine
processEngine
)
{
LOG
.
info
(
"--------------------- Callback for engine end"
);
if
(
dataSource
!=
null
)
{
LOG
.
info
(
"--------------------- Closing datasource"
);
dataSource
.
close
();
}
}
public
void
setDataSource
(
PoolingDataSource
dataSource
)
{
this
.
dataSource
=
dataSource
;
}
}
qa/jta/oracle/activiti.cfg.xml
浏览文件 @
c419e7da
...
...
@@ -5,7 +5,7 @@
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
>
<bean
id=
"dataSource"
class=
"bitronix.tm.resource.jdbc.PoolingDataSource"
init-method=
"init"
destroy-method=
"close"
>
<bean
id=
"dataSource"
class=
"bitronix.tm.resource.jdbc.PoolingDataSource"
destroy-method=
"close"
>
<property
name=
"className"
value=
"oracle.jdbc.xa.client.OracleXADataSource"
/>
<property
name=
"uniqueName"
value=
"xaOracle"
/>
<property
name=
"maxPoolSize"
value=
"20"
/>
...
...
@@ -13,8 +13,6 @@
<property
name=
"driverProperties"
>
<!-- Oracle -->
<props>
<prop
key=
"serverName"
>
@jdbc.servername@
</prop>
<prop
key=
"databaseName"
>
@jdbc.databasename@
</prop>
<prop
key=
"user"
>
@jdbc.username@
</prop>
<prop
key=
"password"
>
@jdbc.password@
</prop>
<prop
key=
"URL"
>
@jdbc.url@
</prop>
...
...
@@ -29,6 +27,11 @@
<property
name=
"logPart1Filename"
value=
"target/btm1.log"
/>
<property
name=
"logPart2Filename"
value=
"target/btm2.log"
/>
</bean>
<!-- Listener to close datasource when engine is closed, spring's destroy-method is never called... -->
<bean
id=
"lifecycleListener"
class=
"org.activiti.standalone.jta.CloseXADataSourceLifecycleListener"
>
<property
name=
"dataSource"
ref=
"dataSource"
/>
</bean>
<!-- create BTM transaction manager -->
<bean
id=
"transactionManager"
factory-method=
"getTransactionManager"
class=
"bitronix.tm.TransactionManagerServices"
...
...
@@ -40,6 +43,8 @@
<property
name=
"databaseSchemaUpdate"
value=
"true"
/>
<property
name=
"jobExecutorActivate"
value=
"false"
/>
<property
name=
"mailServerPort"
value=
"5025"
/>
<property
name=
"processEngineLifecycleListener"
ref=
"lifecycleListener"
/>
</bean>
</beans>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录