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

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


    ProvidedBeansMap providedBeans = new ProvidedBeansMap();

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

    applicationContext.provide( providedBeans );
View Full Code Here


                             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 SingletonBeanConfigurer( String beanName, Object value ) {
    this( beanName, value, false );
  }

  public SingletonBeanConfigurer( String beanName, Object value, boolean makePrimary ) {
    addBean( beanName, makePrimary ? new PrimarySingletonBean( value ) : new SingletonBean( value ) );
  }
View Full Code Here

  @Test
  public void definitionAsSingleton() {
    BeanDefinition two = new GenericBeanDefinition();

    beans.put( "two", new SingletonBean( two ) );

    assertTrue( beans.getBeanDefinitions().isEmpty() );

    Map<String, Object> singletons = beans.getSingletons();
    assertEquals( 1, singletons.size() );
View Full Code Here

  @Test
  public void singletonWithDefinition() {
    String one = "one";
    BeanDefinition two = new GenericBeanDefinition();

    beans.put( "two", new SingletonBean( one, two ) );

    Map<String, BeanDefinition> definitions = beans.getBeanDefinitions();
    assertEquals( 1, definitions.size() );
    assertSame( two, definitions.get( "two" ) );
View Full Code Here

    Object four = new Object();
    BeanDefinition defFive = mock( BeanDefinition.class );
    BeanDefinition defFour = new GenericBeanDefinition();

    beans.put( "one", one );
    beans.put( "two", new SingletonBean( two ) );
    beans.put( "three", new PrimarySingletonBean( three ) );
    beans.put( "four", new SingletonBean( four, defFour ) );
    beans.put( "five", defFive );

    Map<String, Object> singletons = beans.getSingletons();
    assertEquals( 4, singletons.size() );
    assertSame( one, singletons.get( "one" ) );
View Full Code Here

TOP

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

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.