Package com.example.prototypes.run

Source Code of com.example.prototypes.run.Run

package com.example.prototypes.run;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jms.listener.DefaultMessageListenerContainer;

import com.example.prototypes.jms.CheckingAccountService;
import com.example.prototypes.model.EmailAddressType;
import com.example.prototypes.repo.EmailAddressTypeRepository;
import com.example.prototypes.service.EmailService;

public class Run {

  /**
   * @param args
   * @throws Exception
   */
  public static void main(final String[] args) throws Exception {
    ApplicationContext context = new ClassPathXmlApplicationContext("app-context.xml");
    ;
    EmailAddressTypeRepository repository = context.getBean(EmailAddressTypeRepository.class);
    EmailAddressType addressType = new EmailAddressType();
    addressType.setActive(true);
    addressType.setDefaultDef(true);
    addressType.setName("Nowy");
    repository.save(addressType);
    // EmailAddressType addressType = repository.find(1L);
    EmailService service = context.getBean(EmailService.class);
    service.doIt();

    CheckingAccountService bean = context.getBean(CheckingAccountService.class);
    for (int i = 0; i < 10; i++) {
      bean.simpleSend();
    }
    DefaultMessageListenerContainer b = (DefaultMessageListenerContainer) context.getBean("jmsContainer");

    // System.exit(1);
  }

}
TOP

Related Classes of com.example.prototypes.run.Run

TOP
Copyright © 2018 www.massapi.com. 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.