Class 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 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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.osgi.service.event.EventAdmin getService​(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration<org.osgi.service.event.EventAdmin> registration)
      Returns a new EventAdminSecurityDecorator initialized with the given EventAdmin.
      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.
    • 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 new EventAdminSecurityDecorator on any call to getService().
        Parameters:
        admin - The EventAdmin service 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 new EventAdminSecurityDecorator initialized with the given EventAdmin. That in turn will check any call to post or send for the appropriate permissions based on the bundle parameter.
        Specified by:
        getService in interface org.osgi.framework.ServiceFactory<org.osgi.service.event.EventAdmin>
        Parameters:
        bundle - The bundle used to determine the permissions of the caller
        registration - 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:
        ungetService in interface org.osgi.framework.ServiceFactory<org.osgi.service.event.EventAdmin>
        Parameters:
        bundle - The bundle object that is not used
        registration - The ServiceRegistration that is not used
        service - The service object that is not used
        See Also:
        ServiceFactory.ungetService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration, java.lang.Object)