@Test @SuppressWarnings("unchecked") public void add() throws InterruptedException { MockEndpoint out = getMockEndpoint("mock:added"); out.expectedMessageCount(1); final ItemEvent<String> event = new ItemEvent<String>("mm", ItemEventType.ADDED, "foo", null); argument.getValue().itemAdded(event); assertMockEndpointsSatisfied(2000, TimeUnit.MILLISECONDS); this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.ADDED); }
@Test @SuppressWarnings("unchecked") public void remove() throws InterruptedException { MockEndpoint out = getMockEndpoint("mock:removed"); out.expectedMessageCount(1); final ItemEvent<String> event = new ItemEvent<String>("mm", ItemEventType.REMOVED, "foo", null); argument.getValue().itemRemoved(event); assertMockEndpointsSatisfied(2000, TimeUnit.MILLISECONDS); this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.REMOVED); }
@Test @SuppressWarnings("unchecked") public void add() throws InterruptedException { MockEndpoint out = getMockEndpoint("mock:added"); out.expectedMessageCount(1); final ItemEvent<String> event = new ItemEvent<String>("foo", ItemEventType.ADDED, "foo", null); argument.getValue().itemAdded(event); assertMockEndpointsSatisfied(2000, TimeUnit.MILLISECONDS); this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.ADDED); }
@Test @SuppressWarnings("unchecked") public void remove() throws InterruptedException { MockEndpoint out = getMockEndpoint("mock:removed"); out.expectedMessageCount(1); final ItemEvent<String> event = new ItemEvent<String>("foo", ItemEventType.REMOVED, "foo", null); argument.getValue().itemRemoved(event); assertMockEndpointsSatisfied(2000, TimeUnit.MILLISECONDS); this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.REMOVED); }
@Override public void itemAdded(final ItemEvent<JsonObject> event) { m_logger.debug("Member: {} {} - item added: {}", event.getMember().getSocketAddress(), event.getMember().getUuid(), event.getItem().getValue(EVENT_FIELD_ID)); }
@Override public void itemRemoved(final ItemEvent<JsonObject> event) { m_logger.debug("Member: {} {} - item removed: {}", event.getMember().getSocketAddress(), event.getMember().getUuid(), event.getItem().getValue(EVENT_FIELD_ID)); }
@Override public void itemRemoved( ItemEvent<WorkUnit> e ){ if( queue.isEmpty() ){ synchronized( monitor ){ monitor.notifyAll(); } } }
@Override public void itemAdded(ItemEvent event) { if (!(event.getItem() instanceof PublishedServiceInfo)) { return; } PublishedServiceInfo info = (PublishedServiceInfo) event.getItem(); //notify listeners for (ServiceDiscoveryListener discoveryListener : serviceDiscovery.getListeners()) { discoveryListener.onServiceJoined(info); } }
@Override public void itemRemoved(ItemEvent event) { if (!(event.getItem() instanceof PublishedServiceInfo)) { return; } PublishedServiceInfo info = (PublishedServiceInfo) event.getItem(); for (ServiceDiscoveryListener discoveryListener : serviceDiscovery.getListeners()) { discoveryListener.onServiceLeft(info); } }
@Override synchronized public void itemAdded(ItemEvent<Member> item) { updatePlaces(); }
@Override synchronized public void itemRemoved(ItemEvent<Member> item) { // unused }
public void itemAdded(ItemEvent<Object> itemEvent) { this.sendExchange(HazelcastConstants.ADDED, null, itemEvent); }
public void itemRemoved(ItemEvent<Object> itemEvent) { this.sendExchange(HazelcastConstants.REMOVED, null, itemEvent); }
@Override public void itemAdded( ItemEvent<WorkUnit> event ){ }
public void itemAdded(final ItemEvent item) { }
public void itemRemoved(final ItemEvent item) { }
public void itemAdded(ItemEvent<E> itemEvent) { itemAddLatch.countDown(); }
public void itemRemoved(ItemEvent<E> itemEvent) { itemRemovedLatch.countDown(); }