@Override public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException { try { fromData(in); } catch (ClassNotFoundException e) { throw new IOException("Error reading a GossipData structure", e); } }
@Override public void writeTo(DataOutputStream out) throws IOException { toData(out); }
gossip_req=new GossipData(GossipData.GET_REQ, group, localAddress, null, gossip_servers); if (gossip_rsp.getHasDistributedSystem()) { this.serversWithDistributedSystem++; if (gossip_rsp.getFloatingCoordinatorDisabled()) { this.floatingCoordinatorDisabled = true; if (gossip_rsp.getNetworkPartitionDetectionEnabled()) { this.networkPartitionDetectionEnabled = true;
public void testServerOnly() throws Exception { Properties props = new Properties(); props.setProperty("mcast-port", "0"); locator = Locator.startLocatorAndDS(port, tmpFile, null, props, false, true, null); Assert.assertFalse(locator.isPeerLocator()); Assert.assertTrue(locator.isServerLocator()); Thread.sleep(1000); try { GossipData request = new GossipData(GossipData.REGISTER_REQ, "group", new IpAddress(InetAddress.getLocalHost(), 55), null, null); TcpClient.requestToServer(InetAddress.getLocalHost(), port, request, REQUEST_TIMEOUT); Assert.fail("Should have got an exception"); } catch (Exception expected) { // expected.printStackTrace(); } doServerLocation(); }
if(log.isDebugEnabled()) log.trace("processing request " + gossip.toString()); // GemStoneAddition - changed to trace() switch(gossip.getType()) { case GossipData.REGISTER_REQ: group=gossip.getGroup(); mbr=gossip.getMbr(); if(group == null || mbr == null) { if(log.isErrorEnabled()) log.error(ExternalStrings.GossipServer_GROUP_OR_MEMBER_IS_NULL_CANNOT_REGISTER_MEMBER); group=gossip.getGroup(); mbr = gossip.getMbr(); if(group == null) { if(log.isErrorEnabled()) log.error(ExternalStrings.GossipServer_GROUP_IS_NULL_CANNOT_GET_MEMBERSHIP);
GossipData processVersionRequest() { GossipData ret = new GossipData(GossipData.GEMFIRE_VERSION, null, null, null, null); ret.versionOrdinal = JGroupsVersion.CURRENT_ORDINAL; if (log.getLogWriter().fineEnabled()) { log.getLogWriter().fine( "version response = " + ret.versionOrdinal); // GemStoneAddition } return ret; }
GossipData processRegisterRequest(String group, Address mbr, boolean sendLocators) { if (!checkCompatibility(mbr)) { log.getLogWriter().warning(ExternalStrings.GossipServer_RECEIVED_REGISTRATION_REQUEST_FROM_MEMBER_USING_INCOMPATIBLE_INTERNET_PROTOCOL_0, mbr); } addMember(group, mbr); persistState(); GossipData rsp = new GossipData(); if (sendLocators) { rsp.locators = new Vector(this.locators); } // bug #30341 - wait until the local address is known before replying to a registration if (withDS) { try { synchronized(this.localAddressSync) { while (this.localAddress == null /*&& this.hasDistributedSystem()*/) { this.localAddressSync.wait(); } } } catch (InterruptedException e) { return null; } } rsp.localAddress = this.localAddress; return rsp; }
GossipData version_req = new GossipData(GossipData.GEMFIRE_VERSION, null, null, null, null);
ret=new GossipData(GossipData.GET_RSP, group, this.coordinator, mbrs, this.hasDistributedSystem(), this.floatingCoordinatorDisabled, this.networkPartitionDetectionEnabled, (sendLocators?this.locators:null), this.localAddress);
gossip_req=new GossipData(GossipData.REGISTER_REQ, group, mbr, null, gossip_servers);