From 59a08a842f389e3051eb7999bd3dc4078d89413c Mon Sep 17 00:00:00 2001 From: Gelin Luo Date: Thu, 25 Oct 2018 21:33:43 +1100 Subject: [PATCH] Entity class enhancement time sequence issue #5 --- CHANGELOG.md | 3 +++ src/main/java/act/storage/StorageServiceManager.java | 1 - src/main/java/act/storage/db/DbProbe.java | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fe63c9..95a0fa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # act-storage CHANGE LOG +0.13.5 +* Entity class enhancement time sequence issue #5 + 0.13.4 - 19/Jun/2018 * update act to 1.8.8-RC10 * update act-ebean to 1.7.2 diff --git a/src/main/java/act/storage/StorageServiceManager.java b/src/main/java/act/storage/StorageServiceManager.java index 49ed2f5..6d62eb9 100644 --- a/src/main/java/act/storage/StorageServiceManager.java +++ b/src/main/java/act/storage/StorageServiceManager.java @@ -315,7 +315,6 @@ public List managedFields(Class c) { public void addDbHooker(DbHooker dbHooker) { if (!this.dbHookers.contains(dbHooker)) { this.dbHookers.add(dbHooker); - dbHooker.hookLifecycleInterceptors(); logger.debug("DbHooker[%s] hooked", dbHooker.getClass()); } } diff --git a/src/main/java/act/storage/db/DbProbe.java b/src/main/java/act/storage/db/DbProbe.java index cb4f3a4..66e9ef2 100644 --- a/src/main/java/act/storage/db/DbProbe.java +++ b/src/main/java/act/storage/db/DbProbe.java @@ -56,22 +56,22 @@ public void run() { Class hookerClass = $.classForName(dbHookerClass(), app.classLoader()); final DbHooker hooker = app.getInstance(hookerClass); final StorageServiceManager ssm = StorageServiceManager.instance(); + ssm.addDbHooker(hooker); if (null != ssm) { app.jobManager().on(SysEventId.DB_SVC_LOADED, new Runnable() { @Override public void run() { - ssm.addDbHooker(hooker); + hooker.hookLifecycleInterceptors(); } }); } else { app.eventBus().bind(StorageServiceManagerInitialized.class, new ActEventListenerBase(getClass().getName() + ":hook-to-ssm") { @Override - public void on(StorageServiceManagerInitialized event) throws Exception { - final StorageServiceManager ssm = event.source(); + public void on(StorageServiceManagerInitialized event) { app.jobManager().on(SysEventId.DB_SVC_LOADED, new Runnable() { @Override public void run() { - ssm.addDbHooker(hooker); + hooker.hookLifecycleInterceptors(); } }); }