Permalink
Browse files

[OPENENGSB-2720] renamed EDBStartCommitHook into EDBBeginCommitHook

  • Loading branch information...
1 parent db04834 commit 52c6343986b94841eab725599def9e05ef2eb62c Felix Mayerhuber committed Apr 10, 2012
@@ -21,11 +21,11 @@
import org.openengsb.core.api.edb.EDBException;
/**
- * Defines the functions of the start-commit hook for the EDB component. All services in the OSGi environment providing
+ * Defines the functions of the begin-commit hook for the EDB component. All services in the OSGi environment providing
* this interface which are exported by any bundle, will be called when the EDB gets an EDBCommit to persist. It is the
* first hook that is called in the commit procedure.
*/
-public interface EDBStartCommitHook {
+public interface EDBBeginCommitHook {
/**
* This function is called when the EDB gets an EDBCommit object to persist and before the pre-commit hook is
@@ -30,10 +30,10 @@
import org.openengsb.core.api.edb.EDBException;
import org.openengsb.core.api.edb.EDBLogEntry;
import org.openengsb.core.api.edb.EDBObject;
+import org.openengsb.core.api.edb.hooks.EDBBeginCommitHook;
import org.openengsb.core.api.edb.hooks.EDBErrorHook;
import org.openengsb.core.api.edb.hooks.EDBPostCommitHook;
import org.openengsb.core.api.edb.hooks.EDBPreCommitHook;
-import org.openengsb.core.api.edb.hooks.EDBStartCommitHook;
import org.openengsb.core.edb.internal.dao.DefaultJPADao;
import org.openengsb.core.edb.internal.dao.JPADao;
import org.openengsb.core.security.SecurityContext;
@@ -50,7 +50,7 @@
private List<EDBErrorHook> errorHooks;
private List<EDBPostCommitHook> postCommitHooks;
private List<EDBPreCommitHook> preCommitHooks;
- private List<EDBStartCommitHook> startCommitHooks;
+ private List<EDBBeginCommitHook> beginCommitHooks;
/**
* this is just for testing the JPADatabase. Should only be called in the corresponding test class.
@@ -82,7 +82,7 @@ public Long commit(EDBCommit commit) throws EDBException {
if (commit.isCommitted()) {
throw new EDBException("EDBCommit was already commitet!");
}
- runStartCommitHooks(commit);
+ runBeginCommitHooks(commit);
EDBException exception = runPreCommitHooks(commit);
if (exception != null) {
return runErrorHooks(commit, exception);
@@ -139,18 +139,18 @@ private Long performCommit(EDBCommit commit) throws EDBException {
}
/**
- * Runs all registered start commit hooks on the EDBCommit object. Logs exceptions which occurs in the hooks, except
+ * Runs all registered begin commit hooks on the EDBCommit object. Logs exceptions which occurs in the hooks, except
* for ServiceUnavailableExceptions.
*/
- private void runStartCommitHooks(EDBCommit commit) {
- if (startCommitHooks != null) {
- for (EDBStartCommitHook hook : startCommitHooks) {
+ private void runBeginCommitHooks(EDBCommit commit) {
+ if (beginCommitHooks != null) {
+ for (EDBBeginCommitHook hook : beginCommitHooks) {
try {
hook.onStartCommit(commit);
} catch (ServiceUnavailableException e) {
// Ignore
} catch (Exception e) {
- LOGGER.error("Error while performing EDBStartCommitHook", e);
+ LOGGER.error("Error while performing EDBBeginCommitHook", e);
}
}
}
@@ -461,7 +461,7 @@ public void setPreCommitHooks(List<EDBPreCommitHook> preCommitHooks) {
this.preCommitHooks = preCommitHooks;
}
- public void setStartCommitHooks(List<EDBStartCommitHook> startCommitHooks) {
- this.startCommitHooks = startCommitHooks;
+ public void setBeginCommitHooks(List<EDBBeginCommitHook> beginCommitHooks) {
+ this.beginCommitHooks = beginCommitHooks;
}
}
@@ -29,7 +29,7 @@
<property name="errorHooks" ref="errorHooks" />
<property name="postCommitHooks" ref="postCommitHooks" />
<property name="preCommitHooks" ref="preCommitHooks" />
- <property name="startCommitHooks" ref="startCommitHooks" />
+ <property name="beginCommitHooks" ref="beginCommitHooks" />
</bean>
<bean id="preCommitHook" class="org.openengsb.core.edb.internal.CheckPreCommitHook">
@@ -47,6 +47,6 @@
<reference-list id="errorHooks" interface="org.openengsb.core.api.edb.hooks.EDBErrorHook" availability="optional" />
<reference-list id="postCommitHooks" interface="org.openengsb.core.api.edb.hooks.EDBPostCommitHook" availability="optional"/>
<reference-list id="preCommitHooks" interface="org.openengsb.core.api.edb.hooks.EDBPreCommitHook" availability="optional"/>
- <reference-list id="startCommitHooks" interface="org.openengsb.core.api.edb.hooks.EDBStartCommitHook" availability="optional"/>
+ <reference-list id="beginCommitHooks" interface="org.openengsb.core.api.edb.hooks.EDBBeginCommitHook" availability="optional"/>
</blueprint>

0 comments on commit 52c6343

Please sign in to comment.