當前位置: 首頁>>代碼示例>>Java>>正文


Java EventAdmin.sendEvent方法代碼示例

本文整理匯總了Java中org.osgi.service.event.EventAdmin.sendEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java EventAdmin.sendEvent方法的具體用法?Java EventAdmin.sendEvent怎麽用?Java EventAdmin.sendEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.osgi.service.event.EventAdmin的用法示例。


在下文中一共展示了EventAdmin.sendEvent方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import org.osgi.service.event.EventAdmin; //導入方法依賴的package包/類
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	EventAdmin ea = ServiceUtil.getService(EventAdmin.class);
	Event stepOver = new Event(EA_TOPIC_DEBUGGING_ACTION_RESUME, Collections.emptyMap());
	ea.sendEvent(stepOver);

	// has to be null (see javadoc)
	return null;
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:10,代碼來源:DebugStepResumeHandler.java

示例2: execute

import org.osgi.service.event.EventAdmin; //導入方法依賴的package包/類
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	EventAdmin ea = ServiceUtil.getService(EventAdmin.class);
	Event stepOver = new Event(EA_TOPIC_DEBUGGING_ACTION_STEP_OVER, Collections.emptyMap());
	ea.sendEvent(stepOver);

	// has to be null (see javadoc)
	return null;
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:10,代碼來源:DebugStepOverHandler.java

示例3: process

import org.osgi.service.event.EventAdmin; //導入方法依賴的package包/類
public void process(Exchange exchange) throws Exception {
    EventAdmin admin = (EventAdmin) this.tracker.getService();
    if (admin != null) {
        Event event = getEvent(exchange);
        if (endpoint.isSend()) {
            admin.sendEvent(event);
        } else {
            admin.postEvent(event);
        }
    } else {
        throw new CamelExchangeException("EventAdmin service not present", exchange);
    }
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:14,代碼來源:EventAdminProducer.java

示例4: publish

import org.osgi.service.event.EventAdmin; //導入方法依賴的package包/類
static void publish(final String plot, String topic) {
  final BundleContext ctx = FrameworkUtil.getBundle(JuliaConsolePlugin.class).getBundleContext();
  final ServiceReference<EventAdmin> ref = ctx.getServiceReference(EventAdmin.class);
  final EventAdmin eventAdmin = ctx.getService(ref);
  final Map<String, Object> properties = new HashMap<>();
  properties.put("plot", plot);
  final Event event = new Event(topic, properties);
  eventAdmin.sendEvent(event);
}
 
開發者ID:JuliaComputing,項目名稱:JuliaDT,代碼行數:10,代碼來源:Util.java


注:本文中的org.osgi.service.event.EventAdmin.sendEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。