private void executeHooks(boolean before, C context) {
        for (InvokerHook<C> hook : hooks) {
            if (context == null || context.isFailed()) {
                logger.error("Cannot execute the hook {}", hook.getClass());
                return;
            }
            try {
                if (before) {
                    hook.preHook(context);
                } else {
                    hook.postHook(context);
                }
            } catch (HyscaleException he) {
                context.setHyscaleException(he);
                hook.onError(context, he);
            }
        }
    }
Any class can extend this class to process.
Hooks can be implemented using @see {@link InvokerHook} and register
with component @see {@link #addHook(InvokerHook)}

@param <C> <p> Implementation Notes </p>
@see #doExecute(ComponentInvokerContext) to execute any process . This method
will be invoked after all {@link InvokerHook#preHook(Object)}.
After successful execution all {@link InvokerHook#postHook(Object)}
are executed. In case of error the execution is terminated, then
{@link #onError(ComponentInvokerContext, HyscaleException)} is invoked.
commons/src/main/java/io/hyscale/commons/component/ComponentInvoker.java