Examples of fireSyncEvent()


Examples of net.hasor.core.EventContext.fireSyncEvent()

        String EventName = "MyEvent";
        //1.添加事件监听器
        ec.addListener(EventName, new MyListener());
        //2.引发异步事件
        for (int i = 0; i < 10; i++)
            ec.fireSyncEvent(EventName, i);
        //3.由于是同步事件,因此下面这条日志会在事件处理完毕之后喷出
        System.out.println("before Event do sth...");
    }
}
View Full Code Here

Examples of net.hasor.core.EventContext.fireSyncEvent()

        String EventName = "MyEvent";
        //1.添加事件监听器
        ec.pushListener(EventName, new MyListener());
        //2.引发异步事件,虽然引发了10次事件但只有一次会被执行。
        for (int i = 0; i < 10; i++)
            ec.fireSyncEvent(EventName, i);
        //3.由于事件引发一次是同步事件,因此下面这条日志会在事件处理完毕之后喷出
        System.out.println("after Event do sth...");
    }
}
View Full Code Here

Examples of net.hasor.core.EventContext.fireSyncEvent()

            }
        }
        ApiBinder apiBinder = appContext.newApiBinder(null);
        appContext.doBind(apiBinder);
        /*3.引发事件*/
        ec.fireSyncEvent(EventContext.ContextEvent_Initialized, apiBinder);
        appContext.doInitializeCompleted();
        Hasor.logInfo("the init is completed!");
        //
        /*3.Start*/
        Hasor.logInfo("send start sign...");
View Full Code Here

Examples of net.hasor.core.EventContext.fireSyncEvent()

            for (AppContextAware weak : awareList) {
                weak.setAppContext(appContext);
            }
        }
        /*3.发送启动事件*/
        ec.fireSyncEvent(EventContext.ContextEvent_Started, appContext);
        appContext.doStartCompleted();/*用于扩展*/
        /*3.打印状态*/
        this.startState = true;
        Hasor.logInfo("Hasor Started now!");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.