package br.org.senacagil;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainSpring {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		ApplicationContext ac = new ClassPathXmlApplicationContext(
				"classpath:applicationContext.xml");

		System.out.println("Executing class: " + MainSpring.class.getName());

		Cliente[] clientes = new Cliente[2];
		clientes[0] = (Cliente) ac.getBean("cliente1");
		clientes[1] = (Cliente) ac.getBean("cliente2");

		for (Cliente cliente : clientes) {
  		  System.out.println(cliente + " valor total = " + cliente.getTotalVenda()+ "\n");			
		}
	}
}
