Search in sources :

Example 26 with ClassPathXmlApplicationContext

use of org.springframework.context.support.ClassPathXmlApplicationContext in project dubbo by alibaba.

the class DubboDemoProvider method main.

public static void main(String[] args) throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("dubbo-demo-provider.xml");
    context.start();
    System.out.println("context started");
    System.in.read();
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext)

Example 27 with ClassPathXmlApplicationContext

use of org.springframework.context.support.ClassPathXmlApplicationContext in project dubbo by alibaba.

the class DubboDemoConsumer method main.

public static void main(String[] args) throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("dubbo-demo-consumer.xml");
    context.start();
    Demo.Iface demo = (Demo.Iface) context.getBean("demoService");
    System.out.println(demo.echoI32(32));
    for (int i = 0; i < 10; i++) {
        System.out.println(demo.echoI32(i + 1));
    }
    context.close();
}
Also used : Demo(com.alibaba.dubbo.rpc.gen.thrift.Demo) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext)

Example 28 with ClassPathXmlApplicationContext

use of org.springframework.context.support.ClassPathXmlApplicationContext in project dubbo by alibaba.

the class RpcBenchmarkServer method main.

public static void main(String[] args) throws Exception {
    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("ProviderSample.xml");
    ctx.start();
    synchronized (RpcBenchmarkServer.class) {
        try {
            RpcBenchmarkServer.class.wait();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext)

Example 29 with ClassPathXmlApplicationContext

use of org.springframework.context.support.ClassPathXmlApplicationContext in project dubbo by alibaba.

the class AnnotationProvider method main.

public static void main(String[] args) throws Exception {
    String config = AnnotationProvider.class.getPackage().getName().replace('.', '/') + "/annotation-provider.xml";
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(config);
    context.start();
    System.in.read();
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext)

Example 30 with ClassPathXmlApplicationContext

use of org.springframework.context.support.ClassPathXmlApplicationContext in project dubbo by alibaba.

the class VersionProvider method main.

public static void main(String[] args) throws Exception {
    String config = VersionProvider.class.getPackage().getName().replace('.', '/') + "/version-provider.xml";
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(config);
    context.start();
    System.in.read();
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext)

Aggregations

ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)480 Test (org.junit.Test)212 ApplicationContext (org.springframework.context.ApplicationContext)149 Before (org.junit.Before)47 ConfigurableMessenger (org.springframework.scripting.ConfigurableMessenger)33 ITestBean (org.springframework.tests.sample.beans.ITestBean)30 Messenger (org.springframework.scripting.Messenger)29 CamelContext (org.apache.camel.CamelContext)25 Refreshable (org.springframework.aop.target.dynamic.Refreshable)23 AbstractXmlApplicationContext (org.springframework.context.support.AbstractXmlApplicationContext)22 DataSource (javax.sql.DataSource)17 SpringCamelContext (org.apache.camel.spring.SpringCamelContext)16 ConfigurableApplicationContext (org.springframework.context.ConfigurableApplicationContext)13 AbstractApplicationContext (org.springframework.context.support.AbstractApplicationContext)13 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)12 DemoService (com.alibaba.dubbo.config.spring.api.DemoService)11 ProducerTemplate (org.apache.camel.ProducerTemplate)10 File (java.io.File)9 URL (com.alibaba.dubbo.common.URL)8 Service (org.apache.camel.Service)8