@Override public Boolean apply(Object o) { UUID remoteId = (UUID)o; assertNotNull(remoteId); client.events().stopRemoteListen(remoteId); return true; } }
/** * Stops the remote listener. */ protected void stopRemoteListen() { if (rmtLsnrId != null) IgniteGrid.getIgnite().events(IgniteGrid.getIgnite().cluster().forCacheNodes(cacheName)) .stopRemoteListen(rmtLsnrId); rmtLsnrId = null; }
/** {@inheritDoc} */ @Override public void cancel() { synchronized (this) { if (!isRunning) return; isRunning = false; if (rmtLsnrId != null && ignite != null) { ignite.events(ignite.cluster().forCacheNodes(cacheName)) .stopRemoteListen(rmtLsnrId); rmtLsnrId = null; } } }
grid(0).events().stopRemoteListen(consumeId);
grid(0).events().stopRemoteListen(consumeId);
stopGrid("anotherGrid"); grid(0).events().stopRemoteListen(consumeId);
grid(0).events().stopRemoteListen(consumeId);
grid(0).events().stopRemoteListen(consumeId);
/** * @param ignite Node. * @param cache Cache. * @param async Use async API. * @param oldAsync Use old async API. * @throws Exception If failed. */ private void doTransformResourceInjection(Ignite ignite, IgniteCache<String, Integer> cache, boolean async, boolean oldAsync) throws Exception { final Collection<ResourceType> required = Arrays.asList(ResourceType.IGNITE_INSTANCE, ResourceType.CACHE_NAME, ResourceType.LOGGER); final CacheEventListener lsnr = new CacheEventListener(); IgniteEvents evts = ignite.events(ignite.cluster()); UUID opId = evts.remoteListen(lsnr, null, EventType.EVT_CACHE_OBJECT_READ); try { checkResourceInjectionOnInvoke(cache, required, async, oldAsync); checkResourceInjectionOnInvokeAll(cache, required, async, oldAsync); checkResourceInjectionOnInvokeAllMap(cache, required, async, oldAsync); } finally { evts.stopRemoteListen(opId); } }
grid(0).events().stopRemoteListen(consumeId);
grid(0).events().stopRemoteListen(consumeId);
assertEquals(1, cnt.get()); grid(0).events().stopRemoteListen(consumeId); grid(0).events().stopRemoteListen(consumeId);
grid(0).events().stopRemoteListen(consumeId);
grid(0).events().stopRemoteListen(consumeId);
stopGrid("anotherGrid"); grid(0).events().stopRemoteListen(consumeId);
public void testApi() throws Exception { try { grid(0).events().stopRemoteListen(null); grid(0).events().stopRemoteListen(UUID.randomUUID()); grid(0).events().stopRemoteListen(consumeId); grid(0).events().stopRemoteListen(consumeId); grid(0).events().stopRemoteListen(consumeId);
grid(0).events().stopRemoteListen(consumeId);
stopGrid("anotherGrid2"); grid(0).events().stopRemoteListen(consumeId);
/** {@inheritDoc} */ @Override public long processInStreamOutLong(int type, BinaryRawReaderEx reader) throws IgniteCheckedException { switch (type) { case OP_RECORD_LOCAL: // TODO: IGNITE-1410. return TRUE; case OP_ENABLE_LOCAL: events.enableLocal(readEventTypes(reader)); return TRUE; case OP_DISABLE_LOCAL: events.disableLocal(readEventTypes(reader)); return TRUE; case OP_STOP_REMOTE_LISTEN: events.stopRemoteListen(reader.readUuid()); return TRUE; case OP_LOCAL_LISTEN: events.localListen(localFilter(reader.readLong()), reader.readInt()); return TRUE; case OP_REMOTE_QUERY_ASYNC: readAndListenFuture(reader, startRemoteQueryAsync(reader, events), eventColResWriter); return TRUE; case OP_WAIT_FOR_LOCAL_ASYNC: { readAndListenFuture(reader, startWaitForLocalAsync(reader, events), eventResWriter); return TRUE; } default: return super.processInStreamOutLong(type, reader); } }
client.events().stopRemoteListen(opId);