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(); }
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; }
gossip_req=new GossipData(GossipData.GET_REQ, group, localAddress, null, gossip_servers);
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);