Tabnine Logo
ConfigurableBeanFactory.registerAlias
Code IndexAdd Tabnine to your IDE (free)

How to use
registerAlias
method
in
org.springframework.beans.factory.config.ConfigurableBeanFactory

Best Java code snippets using org.springframework.beans.factory.config.ConfigurableBeanFactory.registerAlias (Showing top 4 results out of 315)

origin: spring-projects/spring-framework

@Test
public void aliasing() {
  BeanFactory bf = getBeanFactory();
  if (!(bf instanceof ConfigurableBeanFactory)) {
    return;
  }
  ConfigurableBeanFactory cbf = (ConfigurableBeanFactory) bf;
  String alias = "rods alias";
  try {
    cbf.getBean(alias);
    fail("Shouldn't permit factory get on normal bean");
  }
  catch (NoSuchBeanDefinitionException ex) {
    // Ok
    assertTrue(alias.equals(ex.getBeanName()));
  }
  // Create alias
  cbf.registerAlias("rod", alias);
  Object rod = getBeanFactory().getBean("rod");
  Object aliasRod = getBeanFactory().getBean(alias);
  assertTrue(rod == aliasRod);
}
origin: org.springframework.data/spring-data-geode

void registerAlias(String beanName, String indexName) {
  Optional.ofNullable(getBeanFactory()).filter(it -> it instanceof ConfigurableBeanFactory)
    .filter(it -> (beanName != null && !beanName.equals(indexName)))
    .ifPresent(it -> ((ConfigurableBeanFactory) it).registerAlias(beanName, indexName));
}
origin: org.springframework.data/spring-data-gemfire

void registerAlias(String beanName, String indexName) {
  Optional.ofNullable(getBeanFactory()).filter(it -> it instanceof ConfigurableBeanFactory)
    .filter(it -> (beanName != null && !beanName.equals(indexName)))
    .ifPresent(it -> ((ConfigurableBeanFactory) it).registerAlias(beanName, indexName));
}
origin: org.springframework.session/spring-session-data-geode

@PostConstruct
public void init() {
  getBeanFactory().registerAlias(getSessionSerializerBeanName(), SESSION_SERIALIZER_BEAN_ALIAS);
}
org.springframework.beans.factory.configConfigurableBeanFactoryregisterAlias

Javadoc

Given a bean name, create an alias. We typically use this method to support names that are illegal within XML ids (used for bean names).

Typically invoked during factory configuration, but can also be used for runtime registration of aliases. Therefore, a factory implementation should synchronize alias access.

Popular methods of ConfigurableBeanFactory

  • resolveEmbeddedValue
    Resolve the given embedded value, e.g. an annotation attribute.
  • getBeanExpressionResolver
    Return the resolution strategy for expressions in bean definition values.
  • getBean
  • registerSingleton
    Register the given existing object as singleton in the bean factory, under the given bean name.The g
  • getTypeConverter
    Obtain a type converter as used by this BeanFactory. This may be a fresh instance for each call, sin
  • getBeanClassLoader
    Return this factory's class loader for loading bean classes (only null if even the system ClassLoade
  • containsBean
  • getConversionService
    Return the associated ConversionService, if any.
  • getMergedBeanDefinition
    Return a merged BeanDefinition for the given bean name, merging a child bean definition with its par
  • isCurrentlyInCreation
    Determine whether the specified bean is currently in creation.
  • getSingletonMutex
  • destroySingletons
    Destroy all cached singletons in this factory. To be called on shutdown of a factory.
  • getSingletonMutex,
  • destroySingletons,
  • getSingletonNames,
  • registerDependentBean,
  • containsSingleton,
  • destroyBean,
  • isFactoryBean,
  • isSingleton,
  • addBeanPostProcessor

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSharedPreferences (Context)
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Path (java.nio.file)
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now