本文整理匯總了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;
}
示例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;
}
示例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);
}
}
示例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);
}