org.papoose.event
Class SecureEventAdminServiceFactory

java.lang.Object
  extended by org.papoose.event.EventAdminServiceFactory
      extended by org.papoose.event.SecureEventAdminServiceFactory
All Implemented Interfaces:
org.osgi.framework.ServiceFactory

public class SecureEventAdminServiceFactory
extends EventAdminServiceFactory

Version:
$Revision: $ $Date: $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.papoose.event.EventAdminServiceFactory
EventAdminServiceFactory.EventListener
 
Constructor Summary
SecureEventAdminServiceFactory(org.osgi.framework.BundleContext context, java.util.concurrent.ExecutorService executor, java.util.concurrent.ScheduledExecutorService scheduledExecutor)
           
 
Method Summary
 java.lang.Object getService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration)
           
protected  boolean permissionCheck(EventAdminServiceFactory.EventListener listener, org.osgi.service.event.Event event)
          Check to make sure that the listener has permission to subscribe to the topic of the event.
 void ungetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration, java.lang.Object service)
           
 
Methods inherited from class org.papoose.event.EventAdminServiceFactory
getTimeout, getTimeUnit, setTimeout, setTimeUnit, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecureEventAdminServiceFactory

public SecureEventAdminServiceFactory(org.osgi.framework.BundleContext context,
                                      java.util.concurrent.ExecutorService executor,
                                      java.util.concurrent.ScheduledExecutorService scheduledExecutor)
Method Detail

getService

public java.lang.Object getService(org.osgi.framework.Bundle bundle,
                                   org.osgi.framework.ServiceRegistration registration)
Specified by:
getService in interface org.osgi.framework.ServiceFactory
Overrides:
getService in class EventAdminServiceFactory

ungetService

public void ungetService(org.osgi.framework.Bundle bundle,
                         org.osgi.framework.ServiceRegistration registration,
                         java.lang.Object service)
Specified by:
ungetService in interface org.osgi.framework.ServiceFactory
Overrides:
ungetService in class EventAdminServiceFactory

permissionCheck

protected boolean permissionCheck(EventAdminServiceFactory.EventListener listener,
                                  org.osgi.service.event.Event event)
Description copied from class: EventAdminServiceFactory
Check to make sure that the listener has permission to subscribe to the topic of the event. The default implementation always returns true.

This method is overridden by SecureEventAdminServiceFactory.

Overrides:
permissionCheck in class EventAdminServiceFactory
Parameters:
listener - the listener whose permission is to be checked
event - the event that is to be protected
Returns:
true if the listener has permission to access the event, false otherwise.


Copyright © 2010. All Rights Reserved.