Class EventHandlerProxy
- java.lang.Object
-
- org.apache.felix.eventadmin.impl.handler.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 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDeliver(org.osgi.service.event.Event event)Check if this handler is allowed to receive the event - denied - check filter - check permissionvoiddenyEventHandler()Deny the handler.voiddispose()Dispose the proxy and release the handlerStringgetInfo()Get some info about the event handlerString[]getTopics()Get the topics of this handler.booleanisAsyncOrderedDelivery()Should async events be delivered in order?booleanisDenied()voidsendEvent(org.osgi.service.event.Event event)Send the event.booleanupdate()Update the state with current properties from the servicebooleanuseTimeout()Should a timeout be used for this handler?
-
-
-
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 contextreference- Reference to the EventHandler
-
-
Method Detail
-
update
public boolean update()
Update the state with current properties from the service- Returns:
trueif 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 topicsnullis 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:
trueif the event can be delivered
-
useTimeout
public boolean useTimeout()
Should a timeout be used for this handler?- Returns:
trueif a timeout should be used
-
isAsyncOrderedDelivery
public boolean isAsyncOrderedDelivery()
Should async events be delivered in order?- Returns:
trueif 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()
-
-