Example usage for org.springframework.context.support ClassPathXmlApplicationContext ClassPathXmlApplicationContext

List of usage examples for org.springframework.context.support ClassPathXmlApplicationContext ClassPathXmlApplicationContext

Introduction

In this page you can find the example usage for org.springframework.context.support ClassPathXmlApplicationContext ClassPathXmlApplicationContext.

Prototype

public ClassPathXmlApplicationContext(String... configLocations) throws BeansException 

Source Link

Document

Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.

Usage

From source file:com.apress.prospringintegration.stream.StreamEcho.java

public static void main(String[] args) throws IOException {
    ApplicationContext context = new ClassPathXmlApplicationContext("spring/stream/input-stream.xml");
}

From source file:biz.c24.io.spring.integration.samples.fpml.DataGeneratorMain.java

/**
 * @param args/* w w w  .j ava2  s. c o m*/
 */
public static void main(String[] args) {

    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
            "classpath:/biz/c24/io/spring/integration/samples/fpml/generator/si-context.xml");

    context.registerShutdownHook();

}

From source file:com.mike.angry.main.ShuduSolverRunner.java

public static void main(String[] args) throws IOException {
    // ?Spring//from  www .  j a  v  a  2s.  c  om
    context = new ClassPathXmlApplicationContext("Spring.xml");

    ShuduSolver shuduSolver = (ShuduSolver) context.getBean("shuduSolver");
    String path = "src/main/resource/puzzles/easy/ai-1.txt";
    // String path = "src/main/resource/puzzles/hard/h-1.txt";
    shuduSolver.mainFlow(path);

    shuduSolver = (ShuduSolver) context.getBean("shuduSolver");
    path = "src/main/resource/puzzles/easy/ai-2.txt";
    shuduSolver.mainFlow(path);

    shuduSolver = (ShuduSolver) context.getBean("shuduSolver");
    path = "src/main/resource/puzzles/easy/ai-3.txt";
    shuduSolver.mainFlow(path);

    shuduSolver = (ShuduSolver) context.getBean("shuduSolver");
    path = "src/main/resource/puzzles/easy/ai-4.txt";
    shuduSolver.mainFlow(path);

    shuduSolver = (ShuduSolver) context.getBean("shuduSolver");
    path = "src/main/resource/puzzles/easy/ai-5.txt";
    shuduSolver.mainFlow(path);

}

From source file:com.jbrisbin.vpc.jobsched.JobScheduler.java

public static void main(String[] args) {
    ApplicationContext appCtx = new ClassPathXmlApplicationContext("/jobsched.xml");
    while (true) {
        try {/*from   w w w  .j a  v a2s . co  m*/
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}

From source file:com.nuevebit.miroculus.mrna.cli.MiRNATestApplication.java

public static void main(String[] args) {
    ApplicationContext context = new ClassPathXmlApplicationContext("app-context.xml");

    MiRNATestApplication app = context.getBean(MiRNATestApplication.class);
    app.generateList();//from   w w  w  .  ja  v  a 2s  .c o  m
}

From source file:com.javacreed.examples.sc.part3.Main.java

public static void main(final String[] args) {
    final String xmlFile = "META-INF/spring/app-context.xml";
    try (ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(xmlFile)) {

        final MembersService service = context.getBean(MembersService.class);

        // Load member with id 1
        Member member = service.getMemberWithId(1);
        System.out.println(member);

        // Load member with id 1 again
        member = service.getMemberWithId(1);
        System.out.println(member);

        // Edit member with id 1
        member = new Member(1, "Joe Vella");
        service.saveMember(member);/*from ww w .  j  a v a 2  s .  co m*/

        // Load member with id 1 after it was modified
        member = service.getMemberWithId(1);
        System.out.println(member);
    }
}

From source file:gda.images.camera.example.ClientExample.java

public static void main(String[] args) throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
            "gda/images/camera/example/client.xml");
    ClientSideSampleMovementService cssms = (ClientSideSampleMovementService) context
            .getBean("clientSampleMovementService");

    cssms.moveSampleByPixels(30, 20);//w w  w .j av a 2s  .  c  o m
}

From source file:com.apress.prospringintegration.messaging.activemq.jms.adapter.TicketReceiverMain.java

public static void main(String[] args) {
    String contextName = "ticket-receiver.xml";

    ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(contextName);
    applicationContext.start();/*  w w w. jav a2s.  c  o  m*/
}

From source file:com.dangdang.example.elasticjob.spring.main.SpringJobMain.java

@SuppressWarnings("resource")
public static void main(final String[] args) {
    // CHECKSTYLE:ON
    new ClassPathXmlApplicationContext("classpath:META-INF/withNamespace.xml");
}

From source file:com.alibaba.dubbo.examples.heartbeat.HeartbeatProvider.java

public static void main(String[] args) throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
            HeartbeatProvider.class.getPackage().getName().replace('.', '/') + "/heartbeat-provider.xml");
    context.start();// w w  w.  ja  v  a 2 s.  com
    System.in.read();
}