public static void VerifyCUMCQList(Integer numOfKeys, Integer numOfClients) { try { Iterator iter = cache.getBridgeServers().iterator(); if (iter.hasNext()) { BridgeServerImpl server = (BridgeServerImpl)iter.next(); Map haContainer = server.getAcceptor().getCacheClientNotifier() .getHaContainer(); Object[] keys = haContainer.keySet().toArray(); logger.fine("### numOfKeys :" + numOfKeys.intValue() + " keys.length : " + keys.length + " haContainer size : " + haContainer.size()); assertEquals(numOfKeys.intValue(), keys.length); for (int i = 0; i < numOfKeys.intValue(); i++) { logger.fine("i=: " + i); ClientUpdateMessageImpl cum = (ClientUpdateMessageImpl)haContainer .get(keys[i]); assertNotNull(cum); assertNotNull(cum.getClientCqs()); assertEquals("This test may fail if the image provider gets an ack from client before providing image", numOfClients.intValue(), cum.getClientCqs().size()); } } } catch (Exception e) { fail("failed in VerifyCUMCQList()" + e, e); } }
/** * Parameterized constructor. * * @param event */ public HAEventWrapper(ClientUpdateMessage event) { this.regionName = event.getRegionName(); this.keyOfInterest = event.getKeyOfInterest(); this.shouldConflate = event.shouldBeConflated(); this.eventIdentifier = event.getEventId(); rcUpdater.set(this, 0); this.clientUpdateMessage = event; this.clientCqs = ((ClientUpdateMessageImpl)event).getClientCqs(); }
/** * Parameterized constructor. * * @param event */ public HAEventWrapper(ClientUpdateMessage event) { this.regionName = event.getRegionName(); this.keyOfInterest = event.getKeyOfInterest(); this.shouldConflate = event.shouldBeConflated(); this.eventIdentifier = event.getEventId(); rcUpdater.set(this, 0); this.clientUpdateMessage = event; this.clientCqs = ((ClientUpdateMessageImpl)event).getClientCqs(); }
/** * Calls toData() on its clientUpdateMessage present in the * haContainer (client-messages-region or the map). * * @param out * The output stream which the object should be written to. */ public void toData(DataOutput out) throws IOException { ClientUpdateMessageImpl cum = (ClientUpdateMessageImpl)this.haContainer .get(this); // If the dispatcher sends the cum object to the client and removes it from // the haContainer before we do haContainer.get() (above), we indicate that // by sending false boolean value. if (cum != null) { DataSerializer.writePrimitiveBoolean(true, out); DataSerializer.writeObject(cum.getEventId(), out); } else { DataSerializer.writePrimitiveBoolean(false, out); DataSerializer.writeObject(new EventID(), out); // Create a dummy ClientUpdateMessageImpl instance cum = new ClientUpdateMessageImpl(EnumListenerEvent.AFTER_CREATE, new ClientProxyMembershipID(), null, null); } InternalDataSerializer.invokeToData(cum, out); if (cum.hasCqs()) { DataSerializer.writeConcurrentHashMap(cum.getClientCqs(), out); } }
/** * Calls toData() on its clientUpdateMessage present in the * haContainer (client-messages-region or the map). * * @param out * The output stream which the object should be written to. */ public void toData(DataOutput out) throws IOException { ClientUpdateMessageImpl cum = (ClientUpdateMessageImpl)this.haContainer .get(this); // If the dispatcher sends the cum object to the client and removes it from // the haContainer before we do haContainer.get() (above), we indicate that // by sending false boolean value. if (cum != null) { DataSerializer.writePrimitiveBoolean(true, out); DataSerializer.writeObject(cum.getEventId(), out); } else { DataSerializer.writePrimitiveBoolean(false, out); DataSerializer.writeObject(new EventID(), out); // Create a dummy ClientUpdateMessageImpl instance cum = new ClientUpdateMessageImpl(EnumListenerEvent.AFTER_CREATE, new ClientProxyMembershipID(), null); } InternalDataSerializer.invokeToData(cum, out); if (cum.hasCqs()) { DataSerializer.writeConcurrentHashMap(cum.getClientCqs(), out); } }