Class EventHandlerProxy


  • public class EventHandlerProxy
    extends 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 Detail

      • 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 Detail

      • update

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

        public 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 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()