Search in sources :

Example 1 with ApplicationKeeper

use of io.seata.samples.saga.ApplicationKeeper in project javaboy-code-samples by lenve.

the class DubboSagaProviderStarter method main.

/**
 * The entry point of application.
 *
 * @param args the input arguments
 * @throws Exception the exception
 */
public static void main(String[] args) throws Exception {
    // mock zk server
    mockZKServer();
    ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] { "spring/seata-dubbo-provider.xml" });
    new ApplicationKeeper(applicationContext).keep();
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ApplicationKeeper(io.seata.samples.saga.ApplicationKeeper)

Example 2 with ApplicationKeeper

use of io.seata.samples.saga.ApplicationKeeper in project javaboy-code-samples by lenve.

the class DubboSagaTransactionStarter method main.

public static void main(String[] args) {
    AbstractApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] { "spring/seata-saga.xml", "spring/seata-dubbo-reference.xml" });
    StateMachineEngine stateMachineEngine = (StateMachineEngine) applicationContext.getBean("stateMachineEngine");
    // transactionCommittedDemo(stateMachineEngine);
    // 
    transactionCompensatedDemo(stateMachineEngine);
    new ApplicationKeeper(applicationContext).keep();
}
Also used : AbstractApplicationContext(org.springframework.context.support.AbstractApplicationContext) StateMachineEngine(io.seata.saga.engine.StateMachineEngine) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ApplicationKeeper(io.seata.samples.saga.ApplicationKeeper)

Aggregations

ApplicationKeeper (io.seata.samples.saga.ApplicationKeeper)2 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)2 StateMachineEngine (io.seata.saga.engine.StateMachineEngine)1 AbstractApplicationContext (org.springframework.context.support.AbstractApplicationContext)1