use of org.dbflute.hook.SqlFireHook in project lastaflute by lastaflute.
the class SimpleAsyncManager method doInheritCallbackContext.
protected CallbackContext doInheritCallbackContext(ConcurrentAsyncCall call) {
// null allowed
final CallbackContext src = CallbackContext.getCallbackContextOnThread();
if (src == null) {
return null;
}
final CallbackContext dest = newCallbackContext();
final ConcurrentAsyncOption option = call.option();
final ConcurrentAsyncOption defaultOption = defaultConcurrentAsyncOption;
if (isInherit(option.getBehaviorCommandHookType(), defaultOption.getBehaviorCommandHookType())) {
final BehaviorCommandHook hook = src.getBehaviorCommandHook();
if (hook != null) {
dest.setBehaviorCommandHook(hook);
}
}
if (isInherit(option.getSqlFireHookType(), defaultOption.getSqlFireHookType())) {
final SqlFireHook hook = src.getSqlFireHook();
if (hook != null) {
dest.setSqlFireHook(hook);
}
} else {
// as default
dest.setSqlFireHook(createDefaultSqlFireHook(call));
}
if (isInherit(option.getSqlLogHandlerType(), defaultOption.getSqlLogHandlerType())) {
final SqlLogHandler handler = src.getSqlLogHandler();
if (handler != null) {
dest.setSqlLogHandler(handler);
}
}
if (isInherit(option.getSqlResultHandlerType(), defaultOption.getSqlResultHandlerType())) {
final SqlResultHandler handler = src.getSqlResultHandler();
if (handler != null) {
dest.setSqlResultHandler(handler);
}
} else {
dest.setSqlResultHandler(createDefaultSqlResultHandler(call));
}
if (isInherit(option.getSqlStringFilterType(), defaultOption.getSqlStringFilterType())) {
final SqlStringFilter filter = src.getSqlStringFilter();
if (filter != null) {
dest.setSqlStringFilter(filter);
}
} else {
// as default
dest.setSqlStringFilter(createDefaultSqlStringFilter(call));
}
return dest;
}
Aggregations