eventProperties.put("timestamp", new Long(new Date().getTime())); //$NON-NLS-1$
eventProperties.put("event", event); //$NON-NLS-1$
if (registrationTypeName != null)
eventProperties.put(registrationTypeName, endpointDescription);
final EventAdmin eventAdmin = AccessController
.doPrivileged(new PrivilegedAction<EventAdmin>() {
public EventAdmin run() {
synchronized (eventAdminTrackerLock) {
eventAdminTracker = new ServiceTracker(
getRSABundleContext(), EventAdmin.class
.getName(), null);
eventAdminTracker.open();
}
return (EventAdmin) eventAdminTracker.getService();
}
});
if (eventAdmin == null) {
logError("postEvent", //$NON-NLS-1$
"No EventAdmin service available to send eventTopic=" //$NON-NLS-1$
+ topic + " eventProperties=" + eventProperties); //$NON-NLS-1$
return;
}
// post via event admin
AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
eventAdmin.postEvent(new Event(topic, eventProperties));
return null;
}
});
}