List of usage examples for org.springframework.context ApplicationContext getBean
<T> T getBean(String name, Class<T> requiredType) throws BeansException;
From source file:com.apress.prospringintegration.messageflow.router.MainRecipientListRouter.java
public static void main(String[] args) throws Exception { ApplicationContext context = new ClassPathXmlApplicationContext("router-recipientlist.xml"); MessageChannel channel = context.getBean("marketItemChannel", MessageChannel.class); MarketItemCreator marketItemCreator = context.getBean("marketItemCreator", MarketItemCreator.class); for (MarketItem marketItem : marketItemCreator.getMarketItems()) { channel.send(MessageBuilder.withPayload(marketItem).build()); }/*from w w w. jav a 2s .com*/ }
From source file:cs544.blog.App.java
License:asdf
public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("springconfig.xml"); IBlogService blogService = context.getBean("blogService", IBlogService.class); // IPostService postService = new PostService(); User user = blogService.createUser("ajay", "ajay"); //blogService.createPost(user.getId(), "ha", "ta"); Post post = blogService.createPost(user.getId(), "asd ", "asdf"); // blogService.updatePost(post); // /*from w w w .j a v a2s . c o m*/ // List<User> users = blogService.getAllUser(); // for (User user:users){ // System.out.println(user); // } }
From source file:bit.crawl.bloomfilter.BloomfilterRunnerMain.java
public static void main(String[] argv) { String taskFileName = "/home/sliver/workspace2/CrawlerEngine/real-world-tasks/bloomFilter-config.spring.xml"; ApplicationContext context = new FileSystemXmlApplicationContext("file:" + taskFileName); BloomFilterInit bloomFilterInit = context.getBean("bloomFilterInit", BloomFilterInit.class); bloomFilterInit.init();/*from w w w .j a va2s.co m*/ }
From source file:siia.jms.ChannelAdapterDemo.java
public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("siia/jms/channel-adapters.xml"); MessageChannel toJMS = context.getBean("toJMS", MessageChannel.class); PollableChannel fromJMS = context.getBean("fromJMS", PollableChannel.class); MessagingTemplate template = new MessagingTemplate(); template.convertAndSend(toJMS, "echo"); Object response = template.receiveAndConvert(fromJMS); System.out.println("response: " + response); }
From source file:com.tsguild.flooringmastery.FlooringMasteryApp.java
public static void main(String[] args) { ApplicationContext springFactory = new ClassPathXmlApplicationContext("applicationContext.xml"); FlooringMasteryController controller = springFactory.getBean("controller", FlooringMasteryController.class); controller.run();/*from w w w . j av a 2 s .c om*/ }
From source file:com.dresen.dresen.Test.TestService.java
public static void main(String[] args) { System.out.println("Hello World!"); ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:Spring-Config.xml"); IDepartementService iDepartementService = ctx.getBean("IDepartementService", IDepartementService.class); Departement dep = new Departement("logone"); Departement dep1;//from ww w .j av a 2 s . co m dep1 = iDepartementService.createDepartement(dep); System.out.println(dep1); }
From source file:com.apress.prospringintegration.ftp.FtpInbound.java
public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("/spring/ftp/ftp-inbound-context.xml"); PollableChannel ftpChannel = context.getBean("ftpChannel", PollableChannel.class); Message<?> message = ftpChannel.receive(); System.out.println("message: " + message); }
From source file:com.apress.prospringintegration.ftp.SftpInbound.java
public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("/spring/ftp/sftp-inbound-context.xml"); PollableChannel ftpChannel = context.getBean("ftpChannel", PollableChannel.class); Message<?> message = ftpChannel.receive(); System.out.println("message: " + message); }
From source file:com.tsguild.masteryflooringproject.MasteryFlooringProjectApp.java
public static void main(String[] args) { ApplicationContext springFactory = new ClassPathXmlApplicationContext("applicationContext.xml"); MasteryFlooringProjectController controller = springFactory.getBean("controller", MasteryFlooringProjectController.class); controller.run();/*from ww w . j ava 2s. c o m*/ }
From source file:edu.depaul.armada.ServiceIntegrationTest.java
public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("beans/armada-client.xml"); ArmadaService service = context.getBean("remoteArmadaService", ArmadaService.class); AgentContainerLog test = new AgentContainerLog(); test.name = "test"; for (int i = 0; i < 11; i++) { service.send(test);// w w w.j a v a 2 s . c o m } }