Class EventHandlerProxy

java.lang.Object
org.apache.felix.eventadmin.impl.handler.EventHandlerProxy

public class EventHandlerProxy
extends java.lang.Object
This is a proxy for event handlers. It gets the real event handler on demand and prepares some information for faster processing. It checks the timeout handling for the implementation as well as putting the handler on the deny list.
Author:
Felix Project Team
  • Constructor Summary

    Constructors 
    Constructor Description
    EventHandlerProxy​(org.apache.felix.eventadmin.impl.handler.EventHandlerTracker.HandlerContext context, org.osgi.framework.ServiceReference<org.osgi.service.event.EventHandler> reference)
    Create an EventHandlerProxy.
  • Method Summary

    Modifier and Type Method Description
    boolean canDeliver​(org.osgi.service.event.Event event)
    Check if this handler is allowed to receive the event - denied - check filter - check permission
    void denyEventHandler()
    Deny the handler.
    void dispose()
    Dispose the proxy and release the handler
    java.lang.String getInfo()
    Get some info about the event handler
    java.lang.String[] getTopics()
    Get the topics of this handler.
    boolean isAsyncOrderedDelivery()
    Should async events be delivered in order?
    boolean isDenied()  
    void sendEvent​(org.osgi.service.event.Event event)
    Send the event.
    boolean update()
    Update the state with current properties from the service
    boolean useTimeout()
    Should a timeout be used for this handler?

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EventHandlerProxy

      public EventHandlerProxy​(org.apache.felix.eventadmin.impl.handler.EventHandlerTracker.HandlerContext context, org.osgi.framework.ServiceReference<org.osgi.service.event.EventHandler> reference)
      Create an EventHandlerProxy.
      Parameters:
      context - The handler context
      reference - Reference to the EventHandler
  • Method Details

    • update

      public boolean update()
      Update the state with current properties from the service
      Returns:
      true if the handler configuration is valid.
    • getInfo

      public java.lang.String getInfo()
      Get some info about the event handler
      Returns:
      Handler info
    • dispose

      public void dispose()
      Dispose the proxy and release the handler
    • getTopics

      public java.lang.String[] getTopics()
      Get the topics of this handler. If this handler matches all topics null is returned
      Returns:
      The topics of this handler or null
    • canDeliver

      public boolean canDeliver​(org.osgi.service.event.Event event)
      Check if this handler is allowed to receive the event - denied - check filter - check permission
      Parameters:
      event - The event
      Returns:
      true if the event can be delivered
    • useTimeout

      public boolean useTimeout()
      Should a timeout be used for this handler?
      Returns:
      true if a timeout should be used
    • isAsyncOrderedDelivery

      public boolean isAsyncOrderedDelivery()
      Should async events be delivered in order?
      Returns:
      true if async events should be delivered in order
    • sendEvent

      public void sendEvent​(org.osgi.service.event.Event event)
      Send the event.
      Parameters:
      event - The event
    • denyEventHandler

      public void denyEventHandler()
      Deny the handler.
    • isDenied

      public boolean isDenied()