public abstract class AbstractFactoryBeanSupport<T> extends Object implements FactoryBean<T>, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware
FactoryBean base class implementation encapsulating operations common to all
Spring Data for Apache Geode (SDG) FactoryBean implementations.Logger,
LoggerFactory,
BeanClassLoaderAware,
BeanFactory,
BeanFactoryAware,
BeanNameAware,
FactoryBean| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
DEFAULT_SINGLETON |
OBJECT_TYPE_ATTRIBUTE| Modifier | Constructor and Description |
|---|---|
protected |
AbstractFactoryBeanSupport()
Constructs a new instance of
AbstractFactoryBeanSupport initializing a Logger to log operations
performed by this FactoryBean. |
| Modifier and Type | Method and Description |
|---|---|
ClassLoader |
getBeanClassLoader()
Returns a reference to the
ClassLoader used by the Spring container to load bean classes. |
BeanFactory |
getBeanFactory()
Returns a reference to the Spring
BeanFactory in which this FactoryBean was declared. |
String |
getBeanName()
Returns the
bean name assigned to this FactoryBean as declared in the Spring container. |
protected org.slf4j.Logger |
getLogger()
|
protected Optional<org.slf4j.Logger> |
getOptionalLogger()
|
boolean |
isDebugLoggingEnabled()
Determines whether DEBUG logging is enabled.
|
boolean |
isErrorLoggingEnabled()
Determines whether ERROR logging is enabled.
|
boolean |
isInfoLoggingEnabled()
Determines whether INFO logging is enabled.
|
boolean |
isSingleton()
Indicates that this
FactoryBean produces a single bean instance. |
boolean |
isWarnLoggingEnabled()
Determines whether WARN logging is enabled.
|
protected void |
logDebug(String message,
Object... args)
|
protected void |
logDebug(Supplier<String> message)
|
protected void |
logError(String message,
Object... args)
|
protected void |
logError(Supplier<String> message)
|
protected void |
logInfo(String message,
Object... args)
|
protected void |
logInfo(Supplier<String> message)
|
protected void |
logWarning(String message,
Object... args)
|
protected void |
logWarning(Supplier<String> message)
|
protected org.slf4j.Logger |
newLogger()
Constructs a new instance of
Logger to log statements printed by Spring Data for Apache Geode. |
void |
setBeanClassLoader(ClassLoader classLoader)
Sets a reference to the
ClassLoader used by the Spring container to load bean classes. |
void |
setBeanFactory(BeanFactory beanFactory)
Sets a reference to the Spring
BeanFactory in which this FactoryBean was declared. |
void |
setBeanName(String name)
Sets the
bean name assigned to this FactoryBean as declared in the Spring container. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetObject, getObjectTypeprotected static final boolean DEFAULT_SINGLETON
protected AbstractFactoryBeanSupport()
AbstractFactoryBeanSupport initializing a Logger to log operations
performed by this FactoryBean.newLogger()@NonNull protected org.slf4j.Logger newLogger()
Logger to log statements printed by Spring Data for Apache Geode.Logger.LogFactory,
Logpublic void setBeanClassLoader(@Nullable ClassLoader classLoader)
ClassLoader used by the Spring container to load bean classes.setBeanClassLoader in interface BeanClassLoaderAwareclassLoader - ClassLoader used by the Spring container to load bean classes.BeanClassLoaderAware.setBeanClassLoader(ClassLoader),
ClassLoader,
Class@Nullable public ClassLoader getBeanClassLoader()
ClassLoader used by the Spring container to load bean classes.ClassLoader used by the Spring container to load bean classes.BeanClassLoaderAware.setBeanClassLoader(ClassLoader),
ClassLoader,
Classpublic void setBeanFactory(@Nullable BeanFactory beanFactory) throws BeansException
BeanFactory in which this FactoryBean was declared.setBeanFactory in interface BeanFactoryAwarebeanFactory - reference to the declaring Spring BeanFactory.BeansExceptionBeanFactoryAware.setBeanFactory(BeanFactory),
BeanFactory@Nullable public BeanFactory getBeanFactory()
BeanFactory in which this FactoryBean was declared.BeanFactory.BeanFactoryAware.setBeanFactory(BeanFactory),
BeanFactorypublic void setBeanName(@Nullable String name)
bean name assigned to this FactoryBean as declared in the Spring container.setBeanName in interface BeanNameAwarename - bean name assigned to this FactoryBean as declared in the Spring container.BeanNameAware.setBeanName(String),
String@Nullable public String getBeanName()
bean name assigned to this FactoryBean as declared in the Spring container.bean name assigned to this FactoryBean as declared in the Spring container.BeanNameAware.setBeanName(String),
String@NonNull protected org.slf4j.Logger getLogger()
Logger used by this FactoryBean
to log messages.Logprotected Optional<org.slf4j.Logger> getOptionalLogger()
Optional reference to the Logger used by this FactoryBean
to log messages.Optional,
Logger,
getLogger()public boolean isDebugLoggingEnabled()
Logger.isDebugEnabled(),
getOptionalLogger()public boolean isInfoLoggingEnabled()
Logger.isInfoEnabled(),
getOptionalLogger()public boolean isWarnLoggingEnabled()
Logger.isWarnEnabled(),
getOptionalLogger()public boolean isErrorLoggingEnabled()
Logger.isErrorEnabled(),
getOptionalLogger()public boolean isSingleton()
FactoryBean produces a single bean instance.isSingleton in interface FactoryBean<T>FactoryBean.isSingleton()protected void logDebug(String message, Object... args)
message - String containing the message to log.args - array of arguments used to format the message.logDebug(Supplier)protected void logDebug(Supplier<String> message)
message - Supplier containing the message and arguments to log.Log.isDebugEnabled(),
Log.debug(Object),
getLogger()protected void logInfo(String message, Object... args)
message - String containing the message to log.args - array of arguments used to format the message.logInfo(Supplier)protected void logInfo(Supplier<String> message)
message - Supplier containing the message and arguments to log.Log.isInfoEnabled(),
Log.info(Object),
getLogger()protected void logWarning(String message, Object... args)
message - String containing the message to log.args - array of arguments used to format the message.logWarning(Supplier)protected void logWarning(Supplier<String> message)
message - Supplier containing the message and arguments to log.Log.isWarnEnabled(),
Log.warn(Object),
getLogger()protected void logError(String message, Object... args)
message - String containing the message to log.args - array of arguments used to format the message.logError(Supplier)protected void logError(Supplier<String> message)
message - Supplier containing the message and arguments to log.Log.isErrorEnabled(),
Log.error(Object),
getLogger()Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.