use of org.osgi.service.remoteserviceadmin.EndpointPermission in project ecf by eclipse.
the class RemoteServiceAdmin method publishEvent.
private void publishEvent(final RemoteServiceAdminEvent event, EndpointDescription endpointDescription) {
// send event synchronously to RemoteServiceAdminListeners
EndpointPermission perm = new EndpointPermission(endpointDescription, Activator.getDefault().getFrameworkUUID(), EndpointPermission.READ);
// notify synchronously all appropriate listeners (those with READ
// permission)
final RemoteServiceAdminListener[] listeners = getListeners(perm);
if (listeners != null)
for (int i = 0; i < listeners.length; i++) {
final RemoteServiceAdminListener listener = listeners[i];
SafeRunner.run(new ISafeRunnable() {
public void handleException(Throwable exception) {
logError(// $NON-NLS-1$
"publishEvent", // $NON-NLS-1$
"Exeption in RemoteServiceAdminListener.remoteAdminEvent for listener=" + listener, exception);
}
public void run() throws Exception {
listener.remoteAdminEvent(event);
}
});
}
// Now also post the event asynchronously to EventAdmin
postEvent(event, endpointDescription);
}
use of org.osgi.service.remoteserviceadmin.EndpointPermission in project ecf by eclipse.
the class RemoteServiceAdmin method checkEndpointPermission.
private void checkEndpointPermission(org.osgi.service.remoteserviceadmin.EndpointDescription endpointDescription, String permissionType) throws SecurityException {
SecurityManager sm = System.getSecurityManager();
if (sm == null)
return;
sm.checkPermission(new EndpointPermission(endpointDescription, Activator.getDefault().getFrameworkUUID(), permissionType));
}
Aggregations