public final synchronized void initialize() { if (!isInitialized()) { if (this.name == null) { this.name = this.getClass().getName(); } logger.info("[THYMELEAF] INITIALIZING MESSAGE RESOLVER: " + this.name); initializeSpecific(); this.initialized = true; logger.info("[THYMELEAF] MESSAGE RESOLVER INITIALIZED OK"); } }
/** * <p> * Check the message resolver is initialized, and throw an exception if it is not. * </p> * <p> * Calling this method allows to protect calls to methods that need the message * resolver to be already initialized. * </p> */ protected final void checkInitialized() { if (!isInitialized()) { throw new NotInitializedException("Message Resolver has not been initialized"); } }
/** * <p> * Check the message resolver is not initialized, and throw an exception if it is. * </p> * <p> * Calling this method allows to protect calls to methods that change the configuration, * ensuring the message resolver has not been initialized yet. * </p> */ protected final void checkNotInitialized() { if (isInitialized()) { throw new AlreadyInitializedException( "Cannot modify message resolver when it has already been initialized"); } }