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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 new EventAdminSecurityDecorator on any call to getService().
      Parameters:
      admin - The EventAdmin service 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 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)