/** * Execute post-construct on managed instance. In order to perform instance post-construction, managed instance should * implement {@link ManagedPostConstruct} interface. * * @param managedClass managed class, * @param instance instance of given managed class. * @throws BugError if instance post-construction fails due to exception of user defined logic. */ @Override public void postProcessInstance(ManagedClassSPI managedClass, Object instance) { if (!(instance instanceof ManagedPostConstruct)) { return; } ManagedPostConstruct managedInstance = (ManagedPostConstruct) instance; log.debug("Post-construct managed instance |%s|", managedInstance.getClass()); try { managedInstance.postConstruct(); } catch (Throwable t) { throw new BugError("Managed instance |%s| post-construct fail: %s", instance, t); } } }