public class EventAdminSecurityDecorator extends Object implements org.osgi.service.event.EventAdmin
EventAdmin service. It secures the
service by checking any call from a given bundle (i.e., the caller) to the admins
post or send methods for the appropriate permissions based on a given permission
factory. This methods then in turn throw a SecurityException in case
the given bundle doesn't pass the check or delegate the call to decorated service
instance, respectively.| Constructor and Description |
|---|
EventAdminSecurityDecorator(org.osgi.framework.Bundle bundle,
org.osgi.service.event.EventAdmin admin)
The constructor of this decorator.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
Overrides
equals() and delegates the call to the decorated service
instance. |
int |
hashCode()
Overrides
hashCode() and returns the hash code of the decorated
service instance. |
void |
postEvent(org.osgi.service.event.Event event)
This method checks whether the given (i.e., calling) bundle has
appropriate permissions to post an event to the targeted topic.
|
void |
sendEvent(org.osgi.service.event.Event event)
This method checks whether the given (i.e., calling) bundle has
appropriate permissions to send an event to the targeted topic.
|
public EventAdminSecurityDecorator(org.osgi.framework.Bundle bundle,
org.osgi.service.event.EventAdmin admin)
postEvent() or sendEvent(), respectively. This method then
in turn throw a SecurityException in case the given bundle doesn't
pass the check.bundle - The calling bundle used to determine appropriate permissionsadmin - The decorated service instancepublic void postEvent(org.osgi.service.event.Event event)
SecurityException is thrown in case it has not. Otherwise, the
event is posted using this decorator's service instance.postEvent in interface org.osgi.service.event.EventAdminevent - The event that should be postedEventAdmin.postEvent(org.osgi.service.event.Event)public void sendEvent(org.osgi.service.event.Event event)
SecurityException is thrown in case it has not. Otherwise,
the event is posted using this decorator's service instance.sendEvent in interface org.osgi.service.event.EventAdminevent - The event that should be sendEventAdmin.sendEvent(org.osgi.service.event.Event)public int hashCode()
hashCode() and returns the hash code of the decorated
service instance.hashCode in class ObjectObject.hashCode(),
EventAdminpublic boolean equals(Object o)
equals() and delegates the call to the decorated service
instance. In case that o is an instance of this class it passes o's service
instance instead of o.equals in class Objecto - The object to compare with this decorator's service instanceObject.equals(java.lang.Object),
EventAdminCopyright © 2006–2021 The Apache Software Foundation. All rights reserved.