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 boolean
canDeliver(org.osgi.service.event.Event event)
Check if this handler is allowed to receive the event - denied - check filter - check permissionvoid
denyEventHandler()
Deny the handler.void
dispose()
Dispose the proxy and release the handlerString
getInfo()
Get some info about the event handlerString[]
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 serviceboolean
useTimeout()
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:
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 topicsnull
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()
-
-