📄 demoeventpublisher.java
字号:
package org.riawork.opendoc.event;
/*
* RIAWork.org
*
* OSGI Opendoc Demo
*/
import java.util.Dictionary;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventAdmin;
/**
* desc: 演示用的事件发布器
*
* @author jerry
*/
public class DemoEventPublisher {
// --------------------------------------------Instance Variables
private EventAdmin eventAdmin;
// --------------------------------------------Public Method
public void setEventAdmin(EventAdmin eventAdmin){
this.eventAdmin=eventAdmin;
}
public void publishEvent(String topic,Dictionary props,boolean async){
if(!async)
eventAdmin.sendEvent(new Event(topic,props));
else
eventAdmin.postEvent(new Event(topic,props));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -