Package org.springframework.context.support

Examples of org.springframework.context.support.FileSystemXmlApplicationContext


*/
public class Runner {

  public static void main(String[] args) throws Exception {

    ApplicationContext ctx = new FileSystemXmlApplicationContext(
        "./ch15/src/conf/birthdayReminder.xml");
    System.in.read();
  }
View Full Code Here


* @author robh
*/
public class ResourceDemo {

    public static void main(String[] args) throws Exception{
        ApplicationContext ctx = new FileSystemXmlApplicationContext(
        "./ch5/src/conf/events/events.xml");
 
        Resource res1 = ctx.getResource("file:///d:/tmp/test.txt");
        displayInfo(res1);
        Resource res2 = ctx.getResource("classpath:lib/commons-logging.jar");
        displayInfo(res2);
        Resource res3 = ctx.getResource("http://www.google.co.uk");
        displayInfo(res3);
    }
View Full Code Here

    sender.send(msg);
  }

  public static void main(String[] args) throws Exception {
    ApplicationContext ctx = new FileSystemXmlApplicationContext(
        new String[] { "./ch15/src/conf/inlineImageMessageSender.xml",
            "./ch15/src/conf/javaMailSender.xml" });

    InlineImageMessageSender sender = (InlineImageMessageSender) ctx
        .getBean("messageSender");
    sender.sendMessage();
  }
View Full Code Here

  public void sendMessage() throws MessagingException {
    sender.send(new MessagePreparator());
  }

  public static void main(String[] args) throws Exception {
    ApplicationContext ctx = new FileSystemXmlApplicationContext(
        new String[] {
            "./ch15/src/conf/complexMessageSender.xml",
            "./ch15/src/conf/javaMailSender.xml" });

    ComplexMessageSender sender = (ComplexMessageSender) ctx
        .getBean("messageSender");
    sender.sendMessage();
  }
View Full Code Here

public class Publisher implements ApplicationContextAware {

    private ApplicationContext ctx;

    public static void main(String[] args) {
        ApplicationContext ctx = new FileSystemXmlApplicationContext(
                "./ch5/src/conf/events/events.xml");

        Publisher pub = (Publisher) ctx.getBean("publisher");
        pub.publish("Hello World!");
        pub.publish("The quick brown fox jumped over the lazy dog");
    }
View Full Code Here

    sender.send(msg);
  }

  public static void main(String[] args) throws Exception {
    ApplicationContext ctx = new FileSystemXmlApplicationContext(
        new String[] { "./ch15/src/conf/attachmentMessageSender.xml",
            "./ch15/src/conf/javaMailSender.xml" });

    AttachmentMessageSender sender = (AttachmentMessageSender) ctx
        .getBean("messageSender");
    sender.sendMessage();
  }
View Full Code Here

  public void sendMessage() {
    sender.send(new MessagePreparator());
  }

  public static void main(String[] args) throws Exception {
    ApplicationContext ctx = new FileSystemXmlApplicationContext(
        new String[] {
            "./ch15/src/conf/alternativeFormatMessageSender.xml",
            "./ch15/src/conf/javaMailSender.xml" });

    AlternativeFormatMessageSender sender = (AlternativeFormatMessageSender) ctx
        .getBean("messageSender");
    sender.sendMessage();
  }
View Full Code Here

 
  /**
   * Creates new instance of SpringTestCase and builds application context
   */
  public SpringTestCase() {
    context = new FileSystemXmlApplicationContext(CONFIG_LOCATIONS);
  }
View Full Code Here

*/
public class VelocityRunner {

  public static void main(String[] args) {
    ApplicationContext ctx = new FileSystemXmlApplicationContext(
        new String[] { "./ch15/src/conf/velocity.xml",
            "./ch15/src/conf/javaMailSender.xml" });

    JavaMailSender sender = (JavaMailSender) ctx.getBean("sender");
    VelocityMimeMessagePreparator preparator = (VelocityMimeMessagePreparator) ctx
        .getBean("preparator");

    Map data = new HashMap();
    data.put("msg", "Hello World!");

View Full Code Here

* @author robh
*/
public class AspectJExample {

    public static void main(String[] args) {
        ApplicationContext ctx = new FileSystemXmlApplicationContext(
                "./ch7/src/conf/aspectj.xml");
        MessageWriter writer = new MessageWriter();
        writer.writeMessage();
        writer.foo();
       
View Full Code Here

TOP

Related Classes of org.springframework.context.support.FileSystemXmlApplicationContext

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.