Class ObjectAwareUtils

java.lang.Object
org.springframework.geode.core.util.ObjectAwareUtils

public abstract class ObjectAwareUtils extends Object
Abstract utility class used to process managed object aware objects, such as ApplicationContextAware objects in a Spring context.
Since:
1.3.1
See Also:
  • Consumer
  • BeanClassLoaderAware
  • BeanFactoryAware
  • BeanNameAware
  • ApplicationContextAware
  • ApplicationEventPublisherAware
  • EnvironmentAware
  • ResourceLoaderAware
  • Field Details

  • Constructor Details

    • ObjectAwareUtils

      public ObjectAwareUtils()
  • Method Details

    • applicationContextAwareObjectInitializer

      @NonNull public static Consumer<Object> applicationContextAwareObjectInitializer(@Nullable org.springframework.context.ApplicationContext applicationContext)
      Returns a Consumer capable of initializing an ApplicationContextAware Object with the given ApplicationContext. The ApplicationContextAware.setApplicationContext(ApplicationContext) method is only called on the ApplicationContextAware Object if the ApplicationContext is not null.
      Parameters:
      applicationContext - ApplicationContext set on the ApplicationContextAware Object by the Consumer.
      Returns:
      a Consumer capable of initializing an ApplicationContextAware Object with the given ApplicationContext; never null.
      See Also:
      • ApplicationContextAware
      • ApplicationContext
      • Consumer
    • applicationEventPublisherAwareObjectInitializer

      @NonNull public static Consumer<Object> applicationEventPublisherAwareObjectInitializer(@Nullable org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
      Returns a Consumer capable of initializing an ApplicationEventPublisherAware Object with the given ApplicationEventPublisher. The ApplicationEventPublisherAware.setApplicationEventPublisher(ApplicationEventPublisher) method is only called on the ApplicationEventPublisherAware Object if the ApplicationEventPublisherAware is not null.
      Parameters:
      applicationEventPublisher - ApplicationEventPublisher set on the ApplicationEventPublisherAware Object by the Consumer.
      Returns:
      a Consumer capable of initializing an ApplicationEventPublisherAware Object with the given ApplicationEventPublisher; never null.
      See Also:
      • ApplicationEventPublisherAware
      • ApplicationEventPublisher
      • Consumer
    • beanClassLoaderAwareObjectInitializer

      @NonNull public static Consumer<Object> beanClassLoaderAwareObjectInitializer(@Nullable ClassLoader beanClassLoader)
      Returns a Consumer capable of initializing an BeanClassLoaderAware Object with the given bean ClassLoader. The BeanClassLoaderAware.setBeanClassLoader(ClassLoader) method is only called on the BeanClassLoaderAware Object if the ClassLoader is not null.
      Parameters:
      beanClassLoader - ClassLoader set on the BeanClassLoaderAware Object by the Consumer.
      Returns:
      a Consumer capable of initializing an BeanClassLoaderAware Object with the given bean ClassLoader; never null.
      See Also:
    • beanFactoryAwareObjectInitializer

      @NonNull public static Consumer<Object> beanFactoryAwareObjectInitializer(@Nullable org.springframework.beans.factory.BeanFactory beanFactory)
      Returns a Consumer capable of initializing an BeanFactoryAware Object with the given BeanFactory. The BeanFactoryAware.setBeanFactory(BeanFactory) method is only called on the BeanFactoryAware Object if the BeanFactory is not null.
      Parameters:
      beanFactory - BeanFactory set on the BeanFactoryAware Object by the Consumer.
      Returns:
      a Consumer capable of initializing an BeanFactoryAware Object with the given BeanFactory; never null.
      See Also:
    • beanNameAwareObjectInitializer

      @NonNull public static Consumer<Object> beanNameAwareObjectInitializer(@Nullable String beanName)
      Returns a Consumer capable of initializing an BeanNameAware Object with the given bean name. The BeanNameAware.setBeanName(String) method is only called on the BeanNameAware Object if the bean name is not null.
      Parameters:
      beanName - String containing the bean name to set on the BeanNameAware Object by the Consumer.
      Returns:
      a Consumer capable of initializing an BeanNameAware Object with the given bean name; never null.
      See Also:
    • environmentAwareObjectInitializer

      @NonNull public static Consumer<Object> environmentAwareObjectInitializer(@Nullable org.springframework.core.env.Environment environment)
      Returns a Consumer capable of initializing an EnvironmentAware Object with the given Environment. The EnvironmentAware.setEnvironment(Environment) method is only called on the EnvironmentAware Object if the Environment is not null.
      Parameters:
      environment - Environment set on the EnvironmentAware Object by the Consumer.
      Returns:
      a Consumer capable of initializing an EnvironmentAware Object with the given Environment; never null.
      See Also:
    • resourceLoaderAwareObjectInitializer

      @NonNull public static Consumer<Object> resourceLoaderAwareObjectInitializer(@Nullable org.springframework.core.io.ResourceLoader resourceLoader)
      Returns a Consumer capable of initializing an ResourceLoaderAware Object with the given ResourceLoader. The ResourceLoaderAware.setResourceLoader(ResourceLoader) method is only called on the ResourceLoaderAware Object if the ResourceLoader is not null.
      Parameters:
      resourceLoader - ResourceLoader set on the ResourceLoaderAware Object by the Consumer.
      Returns:
      a Consumer capable of initializing an ResourceLoaderAware Object with the given ResourceLoader; never null.
      See Also:
      • ResourceLoaderAware
      • ResourceLoader
      • Consumer