Search in sources :

Example 6 with StubHandle

use of cn.cerc.jbean.rds.StubHandle in project summer-mis by cn-cerc.

the class ProcessService method run.

// 循环反复执行
@Override
public void run() {
    Calendar c = Calendar.getInstance();
    if (!isRunning) {
        isRunning = true;
        if (C_SCHEDULE_HOUR == c.get(Calendar.HOUR_OF_DAY)) {
            try {
                report();
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else if (ServerConfig.enableTaskService()) {
            try {
                StubHandle handle = new StubHandle();
                runTask(handle);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        isRunning = false;
    } else {
        context.log("上一次任务执行还未结束");
    }
}
Also used : StubHandle(cn.cerc.jbean.rds.StubHandle) Calendar(java.util.Calendar)

Example 7 with StubHandle

use of cn.cerc.jbean.rds.StubHandle in project summer-mis by cn-cerc.

the class ProcessService method main.

// 手动执行所有的预约服务
public static void main(String[] args) {
    StubHandle handle = new StubHandle();
    ProcessService ps = new ProcessService();
    ps.setHandle(handle);
    ps.run();
}
Also used : StubHandle(cn.cerc.jbean.rds.StubHandle)

Example 8 with StubHandle

use of cn.cerc.jbean.rds.StubHandle in project summer-mis by cn-cerc.

the class AsyncServiceTest method test_send_get.

@Test
@Ignore
public void test_send_get() {
    StubHandle handle = new StubHandle();
    AsyncService app = new AsyncService(handle);
    app.setService("TAppCreditLine.calCusCreditLimit");
    // app.setTimer(TDateTime.Now().getTime());
    app.getDataIn().getHead().setField("UserCode_", handle.getUserCode());
    app.setSubject("回算信用额度");
    assertTrue("发送消息失败", app.exec());
}
Also used : StubHandle(cn.cerc.jbean.rds.StubHandle) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

StubHandle (cn.cerc.jbean.rds.StubHandle)8 Ignore (org.junit.Ignore)5 Test (org.junit.Test)5 Record (cn.cerc.jdb.core.Record)3 DataValidateException (cn.cerc.jbean.core.DataValidateException)1 ServiceException (cn.cerc.jbean.core.ServiceException)1 MemoryBuffer (cn.cerc.jbean.other.MemoryBuffer)1 SqlQuery (cn.cerc.jdb.mysql.SqlQuery)1 PhoneVerify (cn.cerc.jmis.sms.PhoneVerify)1 Calendar (java.util.Calendar)1 Before (org.junit.Before)1