Was working on small change to add some consistency to logging output and
noticed a separate issue. The logging changes are so small that I hate to
create a JIRA issue unnecessarily. Would someone mind taking a look at the
attached diff file and letting me know if the issues are worth two separate
issues? I'll be able to use the answer as a future guide.
First issue:
Wanted to add consistency to the logging messages when deploying a new
process
1. When deploying, the term "Activated" is used. However when undeploying,
the term "Unregistered" is used.
2. When deploying a new process, the log says "Process foo-1 has been
unregistered", even if a no previous versions of foo were deployed. This
was due to accidentally putting the log call outside of a conditional
Second Issue:
I haven't seen any direct affects from this code, but it is a bit off. "p"
is never assigned a value before being referenced. From BpelServerImpl.java
:
------------------------------------
BpelProcess p = null;
if (_engine != null) {
_engine.unregisterProcess(pid);
_registeredProcesses.remove(p);
}
Seems it should be something like this:
------------------------------------
BpelProcess p = null;
if (_engine != null) {
p = _engine.unregisterProcess(pid);
if (p != null)
{
_registeredProcesses.remove(p);
}
}
Thanks! Rich
Index: bpel-runtime/src/main/java/org/apache/ode/bpel/engine/Messages.java
===================================================================
--- bpel-runtime/src/main/java/org/apache/ode/bpel/engine/Messages.java (revision 587310)
+++ bpel-runtime/src/main/java/org/apache/ode/bpel/engine/Messages.java (working copy)
@@ -55,9 +55,13 @@
return format("Unkown EPR: {0}", epr);
}
- String msgProcessUnregistered(QName process) {
- return format("Process {0} has been unregistered.", process);
+ String msgProcessRegistered(QName pid) {
+ return format("Registered process {0}.", pid);
}
+
+ String msgProcessUnregistered(QName pid) {
+ return format("Unregistered process {0}.", pid);
+ }
String msgProcessUnregisterFailed(QName process) {
return format("Failed to unregister process {0}! Check database for consistency!", process);
@@ -132,10 +136,6 @@
return format("Operation was interrupted.");
}
- String msgProcessRegistered(QName pid) {
- return format("Activated process {0}.", pid);
- }
-
String msgServerStarted() {
return format("BPEL Server Started.");
}
Index: bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
===================================================================
--- bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java (revision 587310)
+++ bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java (working copy)
@@ -296,12 +296,13 @@
try {
BpelProcess p = null;
if (_engine != null) {
- _engine.unregisterProcess(pid);
- _registeredProcesses.remove(p);
+ p = _engine.unregisterProcess(pid);
+ if (p != null)
+ {
+ _registeredProcesses.remove(p);
+ __log.info(__msgs.msgProcessUnregistered(pid));
+ }
}
-
- __log.info(__msgs.msgProcessUnregistered(pid));
-
} catch (Exception ex) {
__log.error(__msgs.msgProcessUnregisterFailed(pid), ex);
throw new BpelEngineException(ex);