Package com.foreach.across.core.context.beans

Examples of com.foreach.across.core.context.beans.ProvidedBeansMap


  private final AcrossContextInfo contextInfo;

  public AcrossTestContext( AcrossContextConfigurer... configurers ) {
    applicationContext = createApplicationContext();

    ProvidedBeansMap providedBeans = new ProvidedBeansMap();

    for ( int i = 0; i < configurers.length; i++ ) {
      providedBeans.put(
          "QueryableAcrossTestContext.AcrossContextConfigurer~" + i,
          new SingletonBean( configurers[i] )
      );
    }
View Full Code Here


  private AcrossApplicationContextHolder createRootContext( ConfigurableAcrossContextInfo contextInfo ) {
    AbstractApplicationContext rootApplicationContext =
        applicationContextFactory.createApplicationContext( context,
                                                            context.getParentApplicationContext() );

    ProvidedBeansMap providedBeans = new ProvidedBeansMap();

    // Create the AcrossContextBeanRegistry
    AcrossContextBeanRegistry contextBeanRegistry = new DefaultAcrossContextBeanRegistry( contextInfo );
    providedBeans.put( contextBeanRegistry.getFactoryName(),
                       new PrimarySingletonBean(
                           new DefaultAcrossContextBeanRegistry( contextInfo ),
                           new AutowireCandidateQualifier( Qualifier.class.getName(),
                                                           AcrossContextBeanRegistry.BEAN )
                       ) );

    // Put the context and its info as fixed singletons
    providedBeans.put( AcrossContext.BEAN, new PrimarySingletonBean( context ) );
    providedBeans.put( AcrossContextInfo.BEAN, new PrimarySingletonBean( contextInfo ) );

    // Put the module info as singletons in the context
    for ( AcrossModuleInfo moduleInfo : contextInfo.getConfiguredModules() ) {
      // Create the module instances as primary beans so they do not clash with modules
      // configured as beans in a parent application context
      providedBeans.put( "across.module." + moduleInfo.getName(),
                         new PrimarySingletonBean(
                             moduleInfo.getModule(),
                             new AutowireCandidateQualifier( Module.class.getName(),
                                                             moduleInfo.getName() )
                         )
      );
      providedBeans.put( moduleInfo.getName(),
                         new SingletonBean(
                             moduleInfo,
                             new AutowireCandidateQualifier( Module.class.getName(),
                                                             moduleInfo.getName() )
                         )
      );
      providedBeans.put( "across.moduleSettings." + moduleInfo.getName(),
                         new SingletonBean(
                             moduleInfo.getSettings(),
                             new AutowireCandidateQualifier( Module.class.getName(),
                                                             moduleInfo.getName() )
                         ) );
View Full Code Here

public class ProvidedBeansConfigurer extends ApplicationContextConfigurerAdapter
{
  private ProvidedBeansMap providedBeans;

  public ProvidedBeansConfigurer() {
    this( new ProvidedBeansMap() );
  }
View Full Code Here

  public ProvidedBeansConfigurer() {
    this( new ProvidedBeansMap() );
  }

  public ProvidedBeansConfigurer( Map<String, Object> beansMap ) {
    this( new ProvidedBeansMap( beansMap ) );
  }
View Full Code Here

{
  private ProvidedBeansMap beans;

  @Before
  public void reset() {
    beans = new ProvidedBeansMap();
  }
View Full Code Here

        }
      }
    }

    for ( ApplicationContextConfigurer configurer : configurers ) {
      ProvidedBeansMap providedBeans = configurer.providedBeans();

      if ( providedBeans != null ) {
        context.provide( providedBeans );
      }
View Full Code Here

TOP

Related Classes of com.foreach.across.core.context.beans.ProvidedBeansMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.