Class LiveObjectEventInterceptor
- java.lang.Object
-
- com.oracle.coherence.concurrent.executor.internal.LiveObjectEventInterceptor
-
- All Implemented Interfaces:
com.tangosol.net.events.EventDispatcherAwareInterceptor,com.tangosol.net.events.EventInterceptor,com.tangosol.net.MemberListener,EventListener
public class LiveObjectEventInterceptor extends Object implements com.tangosol.net.events.EventDispatcherAwareInterceptor, com.tangosol.net.MemberListener
TheLiveObjectEventInterceptoris theEventInterceptorthat forwardsEvents to objects implementsLiveObject.IMPORTANT: The delegation of events will occur on Coherence Service threads. It is up to the
LiveObjectimplementations to ensure that appropriate processing occurs on non-Coherence-Service threads to prevent deadlock from occurring.- Author:
- bo, lh
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLiveObjectEventInterceptor.ExpiredProcessorAnInvocableMap.EntryProcessorto notify aLeasedthat it has expired.static classLiveObjectEventInterceptor.MemberAwareProcessor
-
Field Summary
Fields Modifier and Type Field Description protected ContinuationService<Object>f_continuationServiceAContinuationServicefor tracking, composing and executingComposableContinuations.protected ScheduledExecutorServicef_executorServiceAnExecutorServiceon which to perform background operations.protected ConcurrentHashMap<Object,Long>f_mapLeaseExpiryTimesA map of keys forLeasedcache entry values and their lease expiry times.protected ConcurrentHashMap<com.tangosol.util.UID,Set<Object>>f_mapMemberAwareObjectsA map of keys forClusterMemberAwarecache entry values.static longLEASE_INSPECTION_DELAY_MSThe delay in milliseconds between successive attempts to inspect the expiry of localLeasedobjects.protected com.tangosol.net.CacheServicem_cacheServiceThe CacheService to which the EventInterceptor has been associated.
-
Constructor Summary
Constructors Constructor Description LiveObjectEventInterceptor()Constructs aLiveObjectEventInterceptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.tangosol.net.CacheServicegetCacheService()Gets the cache service with which this interceptor has been registered.voidintroduceEventDispatcher(String sIdentifier, com.tangosol.net.events.EventDispatcher dispatcher)protected booleanisDecorationRemoved(com.tangosol.util.BinaryEntry binEntry, int nDecorationId)Determines whether the given decoration has been removed from the event's new value, i.e., the decoration exists on the old value but not on the new.voidmemberJoined(com.tangosol.net.MemberEvent memberEvent)voidmemberLeaving(com.tangosol.net.MemberEvent memberEvent)voidmemberLeft(com.tangosol.net.MemberEvent memberEvent)voidonEvent(com.tangosol.net.events.Event event)protected voidprocessEntry(com.tangosol.net.events.Event event, com.tangosol.util.BinaryEntry binaryEntry, Cause cause)Process anBinaryEntryfrom an interceptor event.
-
-
-
Field Detail
-
LEASE_INSPECTION_DELAY_MS
public static long LEASE_INSPECTION_DELAY_MS
The delay in milliseconds between successive attempts to inspect the expiry of localLeasedobjects.
-
m_cacheService
protected com.tangosol.net.CacheService m_cacheService
The CacheService to which the EventInterceptor has been associated.
-
f_executorService
protected final ScheduledExecutorService f_executorService
AnExecutorServiceon which to perform background operations.
-
f_continuationService
protected final ContinuationService<Object> f_continuationService
AContinuationServicefor tracking, composing and executingComposableContinuations.
-
f_mapLeaseExpiryTimes
protected final ConcurrentHashMap<Object,Long> f_mapLeaseExpiryTimes
A map of keys forLeasedcache entry values and their lease expiry times.
-
f_mapMemberAwareObjects
protected final ConcurrentHashMap<com.tangosol.util.UID,Set<Object>> f_mapMemberAwareObjects
A map of keys forClusterMemberAwarecache entry values.
-
-
Constructor Detail
-
LiveObjectEventInterceptor
public LiveObjectEventInterceptor()
Constructs aLiveObjectEventInterceptor.
-
-
Method Detail
-
onEvent
public void onEvent(com.tangosol.net.events.Event event)
- Specified by:
onEventin interfacecom.tangosol.net.events.EventInterceptor
-
introduceEventDispatcher
public void introduceEventDispatcher(String sIdentifier, com.tangosol.net.events.EventDispatcher dispatcher)
- Specified by:
introduceEventDispatcherin interfacecom.tangosol.net.events.EventDispatcherAwareInterceptor
-
getCacheService
public com.tangosol.net.CacheService getCacheService()
Gets the cache service with which this interceptor has been registered.- Returns:
- the
CacheService
-
processEntry
protected void processEntry(com.tangosol.net.events.Event event, com.tangosol.util.BinaryEntry binaryEntry, Cause cause)Process anBinaryEntryfrom an interceptor event.- Parameters:
event- theEventbinaryEntry- theBinaryEntrycause- the cause for theEvent
-
isDecorationRemoved
protected boolean isDecorationRemoved(com.tangosol.util.BinaryEntry binEntry, int nDecorationId)Determines whether the given decoration has been removed from the event's new value, i.e., the decoration exists on the old value but not on the new.- Parameters:
binEntry- theBinaryEntrynDecorationId- the decoration- Returns:
- true if the decoration has been removed for the new value
-
memberJoined
public void memberJoined(com.tangosol.net.MemberEvent memberEvent)
- Specified by:
memberJoinedin interfacecom.tangosol.net.MemberListener
-
memberLeaving
public void memberLeaving(com.tangosol.net.MemberEvent memberEvent)
- Specified by:
memberLeavingin interfacecom.tangosol.net.MemberListener
-
memberLeft
public void memberLeft(com.tangosol.net.MemberEvent memberEvent)
- Specified by:
memberLeftin interfacecom.tangosol.net.MemberListener
-
-