Package org.springframework.context.annotation

Examples of org.springframework.context.annotation.AnnotationConfigApplicationContext


        resultEndpoint.assertIsSatisfied();
    }

    @Override
    protected AbstractApplicationContext createApplicationContext() {
        AnnotationConfigApplicationContext springContext = new AnnotationConfigApplicationContext();
        springContext.register(SpringLdapTestConfiguration.class);
        springContext.refresh();
        return springContext;
    }
View Full Code Here


  public void init() throws ServletException {
    super.init();

    // Recover application context associated to this servlet in this
    // context
    AnnotationConfigApplicationContext thisServletContext = KurentoApplicationContextUtils
        .getKurentoServletApplicationContext(this.getClass(),
            this.getServletName());

    // If there is not application context associated to this servlet,
    // create one
View Full Code Here

public class Spring {

  private static AnnotationConfigApplicationContext context = null;

  public static void initialize() throws IOException {
    context = new AnnotationConfigApplicationContext();
    ConfigurableEnvironment environment = context.getEnvironment();
    environment.addActiveProfile("cryson_logging");
    PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
    configurer.setLocations(new Resource[]{context.getResource("advancedcrysondiary.properties"), context.getResource("cryson.properties")});
    context.addBeanFactoryPostProcessor(configurer);
View Full Code Here

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Consumer {
 
  public static void main(String[] args) {
    ApplicationContext context = new AnnotationConfigApplicationContext(HelloWorldConfiguration.class);
    AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class);
    System.out.println("Received: " + amqpTemplate.receiveAndConvert());
  }
View Full Code Here

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Producer {

  public static void main(String[] args) throws Exception {
    new AnnotationConfigApplicationContext(ProducerConfiguration.class);
  }
View Full Code Here

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Consumer {

  public static void main(String[] args) {
    new AnnotationConfigApplicationContext(ConsumerConfiguration.class);
  }
View Full Code Here

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Producer {

  public static void main(String[] args) {
    ApplicationContext context = new AnnotationConfigApplicationContext(HelloWorldConfiguration.class);
    AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class);
    amqpTemplate.convertAndSend("Hello World");
    System.out.println("Sent: Hello World");
  }
View Full Code Here

  public String[] processLocations(Class<?> clazz, String... locations) {
    return locations;
  }

  public ApplicationContext loadContext(String... locations) throws Exception {
    return new AnnotationConfigApplicationContext(locations);
  }
View Full Code Here

*/
public class ApplicationContextAnnotationTest {

    @Test
    public void test() {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
        ctx.register(GenericConfig.class);
        ctx.refresh();

        Map<String, Object> beans = ctx.getBeansWithAnnotation(org.springframework.stereotype.Service.class);
        System.out.println(beans);
    }
View Full Code Here

   * @see DATAJPA-317
   */
  @Test(expected = NoSuchBeanDefinitionException.class)
  public void doesNotPickUpJpaRepository() {

    ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(JpaRepositoryConfig.class);
    context.getBean("jpaRepository");
    context.close();
  }
View Full Code Here

TOP

Related Classes of org.springframework.context.annotation.AnnotationConfigApplicationContext

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.