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 Object implements org.osgi.framework.ServiceFactory<org.osgi.service.event.EventAdmin>
This class is a factory that secures a givenEventAdminservice by wrapping it with a new instance of anEventAdminSecurityDecoratoron any call to itsgetService()method. The decorator will determine the appropriate permissions by using the given permission factory and the bundle parameter passed to thegetService()method.- Author:
- Felix Project Team
-
-
Constructor Summary
Constructors Constructor Description SecureEventAdminFactory(org.osgi.service.event.EventAdmin admin)The constructor of the factory.
-
Method Summary
All Methods Instance Methods Concrete Methods 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 Detail
-
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 Detail
-
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)
-
-