org.papoose.event
Class EventAdminServiceFactory

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

public class EventAdminServiceFactory
extends java.lang.Object
implements org.osgi.framework.ServiceFactory

Version:
$Revision: $ $Date: $

Nested Class Summary
protected  class EventAdminServiceFactory.EventListener
           
 
Constructor Summary
EventAdminServiceFactory(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)
           
 int getTimeout()
           
 java.util.concurrent.TimeUnit getTimeUnit()
           
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 setTimeout(int timeout)
           
 void setTimeUnit(java.util.concurrent.TimeUnit timeUnit)
           
 void start()
           
 void stop()
           
 void ungetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration, java.lang.Object service)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventAdminServiceFactory

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

getTimeout

public int getTimeout()

setTimeout

public void setTimeout(int timeout)

getTimeUnit

public java.util.concurrent.TimeUnit getTimeUnit()

setTimeUnit

public void setTimeUnit(java.util.concurrent.TimeUnit timeUnit)

start

public void start()

stop

public void stop()

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

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

permissionCheck

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. The default implementation always returns true.

This method is overridden by SecureEventAdminServiceFactory.

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.