EventDispatcher(InternalCacheEvent event, EnumListenerEvent op) { if (LocalRegion.this.enableOffHeapMemory && event instanceof EntryEventImpl) { // Make a copy that has its own off-heap refcount so fix bug 48837 event = new EntryEventImpl( (EntryEventImpl)event); } this.event = event; this.op = op; }
EventDispatcher(InternalCacheEvent event, EnumListenerEvent op) { if (LocalRegion.this.offHeap && event instanceof EntryEventImpl) { // Make a copy that has its own off-heap refcount so fix bug 48837 event = new EntryEventImpl( (EntryEventImpl)event); } this.event = event; this.op = op; }
@Override public void afterUpdate(EntryEvent<String, String> event) { LISTENER_QUEUE.add(new EntryEventImpl((EntryEventImpl)(EntryEvent)event)); } };
@Override public void beforeUpdate(EntryEvent<String, String> event) { WRITER_QUEUE.add(new EntryEventImpl((EntryEventImpl)(EntryEvent)event)); } };
@Override public void afterDestroy(EntryEvent<String, String> event) { LISTENER_QUEUE.add(new EntryEventImpl((EntryEventImpl)(EntryEvent)event)); }
@Override public void beforeDestroy(EntryEvent<String, String> event) { WRITER_QUEUE.add(new EntryEventImpl((EntryEventImpl)(EntryEvent)event)); }
@Override public void afterInvalidate(EntryEvent<String, String> event) { LISTENER_QUEUE.add(new EntryEventImpl((EntryEventImpl)(EntryEvent)event)); }
public void beforeCreate(EntryEvent<String, String> event) { WRITER_QUEUE.add(new EntryEventImpl((EntryEventImpl)(EntryEvent)event)); }
public void afterCreate(EntryEvent<String, String> event) { LISTENER_QUEUE.add(new EntryEventImpl((EntryEventImpl)(EntryEvent)event)); }
/** * create a new entry event that will be used for conveying version information * and anything else of use while processing another event * @return the empty event object */ @Retained public static EntryEventImpl createVersionTagHolder() { return new EntryEventImpl(); }
/** * Creates and returns an EntryEventImpl. Generates and assigns a bucket id to the * EntryEventImpl if the region parameter is a PartitionedRegion. * * {@link EntryEventImpl#EntryEventImpl(LocalRegion, Operation, Object, boolean, DistributedMember, boolean, boolean)} */ @Retained public static EntryEventImpl create(LocalRegion region, Operation op, Object key, boolean originRemote, DistributedMember distributedMember, boolean generateCallbacks, boolean fromRILocalDestroy) { EntryEventImpl entryEvent = new EntryEventImpl(region,op,key,originRemote,distributedMember,generateCallbacks,fromRILocalDestroy); return entryEvent; }
@Retained public final EntryEventImpl newEntryEventImpl() { EntryEventImpl event = new EntryEventImpl(); event.setEntryLastModified(this.commitTime); return event; }
/** * create a new entry event that will be used for conveying version information * and anything else of use while processing another event * @return the empty event object */ @Retained public static EntryEventImpl createVersionTagHolder(VersionTag tag) { EntryEventImpl result = new EntryEventImpl(); result.setVersionTag(tag); return result; }
/** * Creates and returns an EntryEventImpl. Generates and assigns a bucket id to the * EntryEventImpl if the region parameter is a PartitionedRegion. * * Called by BridgeEntryEventImpl to use existing EventID * * {@link EntryEventImpl#EntryEventImpl(LocalRegion, Operation, Object, Object, Object, boolean, DistributedMember, boolean, EventID)} */ @Retained public static EntryEventImpl create(LocalRegion region, Operation op, Object key, @Retained(ENTRY_EVENT_NEW_VALUE) Object newValue, Object callbackArgument, boolean originRemote, DistributedMember distributedMember, boolean generateCallbacks, EventID eventID) { EntryEventImpl entryEvent = new EntryEventImpl(region,op,key,newValue,callbackArgument,originRemote,distributedMember,generateCallbacks,eventID); return entryEvent; }
/** * Creates and returns an EntryEventImpl. Generates and assigns a bucket id to the * EntryEventImpl if the region parameter is a PartitionedRegion. * * {@link EntryEventImpl#EntryEventImpl(LocalRegion, Operation, Object, boolean, DistributedMember, boolean, boolean)} */ @Retained public static EntryEventImpl create(LocalRegion region, Operation op, Object key, boolean originRemote, DistributedMember distributedMember, boolean generateCallbacks, boolean fromRILocalDestroy) { EntryEventImpl entryEvent = new EntryEventImpl(region,op,key,originRemote,distributedMember,generateCallbacks,fromRILocalDestroy); if (null != region) { region.updateKeyInfo(entryEvent, key, null); } return entryEvent; }
/** * Does a region put on the server using the given connection. * @param con the connection to use to send to the server * @param key the entry key to do the put on * @param value the entry value to put * @param eventId the event ID for this put * @param callbackArg an optional callback arg to pass to any cache callbacks */ public void putOnForTestsOnly(Connection con, Object key, Object value, EventID eventId, Object callbackArg) { EntryEventImpl event = new EntryEventImpl(eventId); PutOp.execute(con, this.pool, this.regionName, key, value, event, callbackArg, this.pool.getPRSingleHopEnabled()); }
/** * Does a region put on the server using the given connection. * @param con the connection to use to send to the server * @param key the entry key to do the put on * @param value the entry value to put * @param eventId the event ID for this put * @param callbackArg an optional callback arg to pass to any cache callbacks */ public void putOnForTestsOnly(Connection con, Object key, Object value, EventID eventId, Object callbackArg) { EntryEventImpl event = new EntryEventImpl(eventId); PutOp.execute(con, this.pool, this.regionName, key, value, event, callbackArg, this.pool.getPRSingleHopEnabled()); }
/** * Generates events having specific values of threadId and sequenceId, via * destroyEntry operation through connection object * * @throws Exception - * thrown if any problem occurs in destroyEntry operation */ public static void generateEventsByDestroyEntryOperation() throws Exception { Connection connection = pool.acquireConnection(); String regionName = Region.SEPARATOR + REGION_NAME; ServerRegionProxy srp = new ServerRegionProxy(regionName, pool); for (int i = 0; i < eventIds.length; i++) { srp.destroyOnForTestsOnly(connection, "KEY-" + i, null, Operation.DESTROY, new EntryEventImpl(eventIds[i]), null); } srp.destroyOnForTestsOnly(connection, LAST_KEY, null, Operation.DESTROY, new EntryEventImpl(eventIdForLastKey), null); }
/** * create a new entry event that will be used for conveying version information * and anything else of use while processing another event * @return the empty event object */ @Retained public static EntryEventImpl createVersionTagHolder(VersionTag tag) { EntryEventImpl result = new EntryEventImpl(); result.setVersionTag(tag); result.disallowOffHeapValues(); return result; }
/** * Creates and returns an EntryEventImpl. Generates and assigns a bucket id to the * EntryEventImpl if the region parameter is a PartitionedRegion. * * Called by BridgeEntryEventImpl to use existing EventID * * {@link EntryEventImpl#EntryEventImpl(LocalRegion, Operation, Object, Object, Object, boolean, DistributedMember, boolean, EventID)} */ @Retained public static EntryEventImpl create(LocalRegion region, Operation op, Object key, @Retained(ENTRY_EVENT_NEW_VALUE) Object newValue, Object callbackArgument, boolean originRemote, DistributedMember distributedMember, boolean generateCallbacks, EventID eventID) { EntryEventImpl entryEvent = new EntryEventImpl(region,op,key,newValue,callbackArgument,originRemote,distributedMember,generateCallbacks,eventID); if (null != region) { region.updateKeyInfo(entryEvent, key, null); } return entryEvent; }