Class SecureEventAdminFactory
java.lang.Object
org.apache.felix.eventadmin.impl.security.SecureEventAdminFactory
- All Implemented Interfaces:
org.osgi.framework.ServiceFactory<org.osgi.service.event.EventAdmin>
public class SecureEventAdminFactory
extends java.lang.Object
implements org.osgi.framework.ServiceFactory<org.osgi.service.event.EventAdmin>
This class is a factory that secures a given
EventAdmin service by
wrapping it with a new instance of an EventAdminSecurityDecorator on
any call to its getService() method. The decorator will determine the
appropriate permissions by using the given permission factory and the bundle
parameter passed to the getService() method.- Author:
- Felix Project Team
-
Constructor Summary
Constructors Constructor Description SecureEventAdminFactory(org.osgi.service.event.EventAdmin admin)The constructor of the factory. -
Method Summary
Modifier and Type Method Description org.osgi.service.event.EventAdmingetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration<org.osgi.service.event.EventAdmin> registration)Returns a newEventAdminSecurityDecoratorinitialized with the givenEventAdmin.voidungetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration<org.osgi.service.event.EventAdmin> registration, org.osgi.service.event.EventAdmin service)This method doesn't do anything at the moment.
-
Constructor Details
-
SecureEventAdminFactory
public SecureEventAdminFactory(org.osgi.service.event.EventAdmin admin)The constructor of the factory. The factory will use the given event admin and permission factory to create a newEventAdminSecurityDecoratoron any call togetService().- Parameters:
admin- TheEventAdminservice to secure.
-
-
Method Details
-
getService
public org.osgi.service.event.EventAdmin getService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration<org.osgi.service.event.EventAdmin> registration)Returns a newEventAdminSecurityDecoratorinitialized with the givenEventAdmin. That in turn will check any call to post or send for the appropriate permissions based on the bundle parameter.- Specified by:
getServicein interfaceorg.osgi.framework.ServiceFactory<org.osgi.service.event.EventAdmin>- Parameters:
bundle- The bundle used to determine the permissions of the callerregistration- The ServiceRegistration that is not used- Returns:
- The given service instance wrapped by an
EventAdminSecuriryDecorator - See Also:
ServiceFactory.getService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration)
-
ungetService
public void ungetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration<org.osgi.service.event.EventAdmin> registration, org.osgi.service.event.EventAdmin service)This method doesn't do anything at the moment.- Specified by:
ungetServicein interfaceorg.osgi.framework.ServiceFactory<org.osgi.service.event.EventAdmin>- Parameters:
bundle- The bundle object that is not usedregistration- The ServiceRegistration that is not usedservice- The service object that is not used- See Also:
ServiceFactory.ungetService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration, java.lang.Object)
-