/** * Create a CacheMember referring to the current host * * @param port the membership listening port */ public JGroupMember(int port) { ipAddr = new IpAddress(port); }
public Address getLocalAddress() { if(local_addr == null) local_addr=bind_addr != null ? new IpAddress(bind_addr, srv_port) : null; return local_addr; }
/** * Create a CacheMember referring to the current host (as defined by * the given string). * * @param i the hostname, must be for the current host * @param p the membership listening port */ public JGroupMember(String i, int p) { ipAddr = new IpAddress(i, p); // ipAddr.splitBrainEnabled(false); // ipAddr.cantBeCoordinator(false); }
@Override // GemStoneAddition public void init() throws Exception { // local_addr=new IpAddress("localhost", 10000) { // fake address // public String toString() { // return "<fake>"; // } // }; //local_addr=new org.jgroups.stack.IpAddress("localhost", 10000); // fake address local_addr = new IpAddress(12345); }
@Override // GemStoneAddition public void init() throws Exception { local_addr=new com.gemstone.org.jgroups.stack.IpAddress("localhost", 10000); // fake address }
@Override // GemStoneAddition public void init() throws Exception { local_addr=new com.gemstone.org.jgroups.stack.IpAddress("localhost", 10000); // fake address }
public IpAddress getTokenReceiverAddress() { return new IpAddress(tokenReceiver.getLocalPort()); }
@Override // GemStoneAddition public Object clone() { IpAddress ret=new IpAddress(ip_addr, port); ret.processId = this.processId; // GemStoneAddition ret.shouldNotBeCoordinator = this.shouldNotBeCoordinator; // GemStoneAddition ret.splitBrainEnabled = this.splitBrainEnabled; // GemStoneAddition ret.name = this.name; // GemStoneAddition ret.version = this.version; // GemStoneAddition ret.birthViewId = this.birthViewId; // GemStoneAddition if(additional_data != null) { ret.additional_data=new byte[additional_data.length]; System.arraycopy(additional_data, 0, ret.additional_data, 0, additional_data.length); } return ret; }
public boolean done() { try { Vector members = client.getMembers("mygroup1", new IpAddress(InetAddress.getLocalHost(), 55), true,5000); return members.size() == 1; } catch (Exception e) { e.printStackTrace(); fail("unexpected exception"); } return false; // NOTREACHED } public String description() {
public boolean done() { try { Vector members = client.getMembers("mygroup1", new IpAddress(InetAddress.getLocalHost(), 55), true, 5000); return members.size() == 1; } catch (Exception e) { e.printStackTrace(); fail("unexpected exception"); } return false; // NOTREACHED } public String description() {
public boolean done() { try { Vector members = client.getMembers("mygroup1", new IpAddress(InetAddress.getLocalHost(), 55), true, 5000); return members.size() == 1; } catch (Exception e) { e.printStackTrace(); fail("unexpected exception"); } return false; // NOTREACHED } public String description() {
public boolean done() { try { Vector members = client.getMembers("mygroup1", new IpAddress(InetAddress.getLocalHost(), 55), true,5000); // System.out.println("members in mygroup1: " + members); return members.size() == 2; // changed to 2 for 7.5 release because locator is included in all groups } catch (Exception e) { e.printStackTrace(); fail("unexpected exception"); } return false; // NOTREACHED } public String description() {
public static Address readAddress(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException { Address addr=null; if(in.readBoolean() == false) return null; if(in.readBoolean()) { addr=new IpAddress(); addr.readFrom(in); } else { addr=readOtherAddress(in); } return addr; }
public void setUp() throws Exception { // GemFireTracer.DEBUG = true; InetAddress addr = InetAddress.getLocalHost(); // create the protocol stacks and addresses for (int i=1; i<=numMembers; i++) { IpAddress mbr = new IpAddress(addr, i+10000); members.add(mbr); ProtocolStack stack = createStack(mbr); stacks.add(stack); addressToStack.put(mbr, stack); getMessagingProtocol(stack).setRecipients(addressToStack); } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { this.mbr = new IpAddress(); this.mbr.readExternal(in); update(); }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { this.mbr = new IpAddress(); this.mbr.readExternal(in); update(); }
/** * Create a CacheMember referring to the current host (as defined by * the given string). * * @param i the hostname, must be for the current host * @param p the membership listening port * @param splitBrainEnabled whether the member has network partition detection enabled * @param canBeCoordinator whether the member can be group coordinator */ public JGroupMember(InetAddress i, int p, boolean splitBrainEnabled, boolean canBeCoordinator) { ipAddr = new IpAddress(i, p); ipAddr.splitBrainEnabled(splitBrainEnabled); ipAddr.shouldntBeCoordinator(!canBeCoordinator); }
public boolean testRetransmitLargeMessage(byte[] bytesToSend) { IpAddress myAddress = (IpAddress)local_addr; int myPort = myAddress.getPort(); Message msg = new Message(new IpAddress(myAddress.getIpAddress(), myPort-1), this.local_addr, bytesToSend, 0, bytesToSend.length); msg.putHeader(name, new NakAckHeader(NakAckHeader.XMIT_RSP, 0, 0)); try { passDown(new Event(Event.MSG, msg)); } catch (RetransmissionTooLargeException e) { return true; } return false; }
public void testAddressEquality() throws Exception { IpAddress addr1 = new IpAddress(InetAddress.getLocalHost(), 1234); IpAddress addr2 = new IpAddress(addr1.getIpAddress(), addr1.getPort()); if (!addr1.equals(addr2)) { fail("expected addresses to be equal"); } addr2.setBirthViewId(4); if (!addr1.equals(addr2)) { fail("expected addresses to be equal"); } addr1.setBirthViewId(0); int comparison = addr1.compareTo(addr2); if (comparison >= 0) { fail("expected addresses to be unequal but compareTo returned " + comparison); } }
public void setPort(int p) { IpAddress i = new IpAddress(ipAddr.getIpAddress(), p); i.setFlags(ipAddr.getFlags()); i.setVmKind(ipAddr.getVmKind()); i.setDirectPort(ipAddr.getDirectPort()); i.setProcessId(ipAddr.getProcessId()); i.setRoles(ipAddr.getRoles()); i.setDurableClientAttributes(ipAddr.getDurableClientAttributes()); i.setVersionOrdinal(ipAddr.getVersionOrdinal()); this.ipAddr = i; } }