Package org.jgroups

Examples of org.jgroups.Address.compareTo()


                       Address peer_addr=conn.readPeerAddress(client_sock_ch.socket());
                       conn.peer_addr=peer_addr;
                       synchronized(conns) {
                           Connection tmp=(Connection)conns.get(peer_addr);
                           if(tmp != null) {
                               if(peer_addr.compareTo(local_addr) > 0) {
                                   if(log.isTraceEnabled())
                                       log.trace("peer's address (" + peer_addr + ") is greater than our local address (" +
                                               local_addr + "), replacing our existing connection");
                                   // peer's address is greater, add peer's connection to ConnectionTable, destroy existing connection
                                   addConnection(peer_addr,  conn);
View Full Code Here


                    mapper.getLock().lock();
                    try {                       
                        boolean currentConnectionOpen=mapper.hasOpenConnection(peer_addr);
                        boolean replaceWithNewConnection=false;
                        if(currentConnectionOpen) {
                            replaceWithNewConnection=peer_addr.compareTo(local_addr) > 0;
                        }
                        if(!currentConnectionOpen || replaceWithNewConnection) {
                            mapper.removeConnection(peer_addr);
                            mapper.addConnection(peer_addr, conn);
                            conn.start(mapper.getThreadFactory()); // starts handler thread on this socket
View Full Code Here

                   //Vladimir Nov, 5th, 2007
                   //we might have a connection to peer but is that
                   //connection still open?
                   boolean connectionOpen  = tmp != null && !tmp.isSocketClosed();
                   if(connectionOpen) {                      
                       if(peer_addr.compareTo(local_addr) > 0) {
                           if(log.isTraceEnabled())
                               log.trace("peer's address (" + peer_addr + ") is greater than our local address (" +
                                       local_addr + "), replacing our existing connection");
                           // peer's address is greater, add peer's connection to ConnectionTable, destroy existing connection
                           removeConnection(peer_addr);
View Full Code Here

                       Address peer_addr=conn.readPeerAddress(client_sock_ch.socket());
                       conn.peer_addr=peer_addr;
                       synchronized(conns) {
                           Connection tmp=(Connection)conns.get(peer_addr);
                           if(tmp != null) {
                               if(peer_addr.compareTo(local_addr) > 0) {
                                   if(log.isTraceEnabled())
                                       log.trace("peer's address (" + peer_addr + ") is greater than our local address (" +
                                               local_addr + "), replacing our existing connection");
                                   // peer's address is greater, add peer's connection to ConnectionTable, destroy existing connection
                                   addConnection(peer_addr,  conn);
View Full Code Here

                       Address peer_addr=conn.readPeerAddress(client_sock_ch.socket());
                       conn.peer_addr=peer_addr;
                       synchronized(conns) {
                           Connection tmp=(Connection)conns.get(peer_addr);
                           if(tmp != null) {
                               if(peer_addr.compareTo(local_addr) > 0) {
                                   if(log.isTraceEnabled())
                                       log.trace("peer's address (" + peer_addr + ") is greater than our local address (" +
                                               local_addr + "), replacing our existing connection");
                                   // peer's address is greater, add peer's connection to ConnectionTable, destroy existing connection
                                   addConnection(peer_addr,  conn);
View Full Code Here

                   //Vladimir Nov, 5th, 2007
                   //we might have a connection to peer but is that
                   //connection still open?
                   boolean connectionOpen  = tmp != null && !tmp.isSocketClosed();
                   if(connectionOpen) {                      
                       if(peer_addr.compareTo(local_addr) > 0) {
                           if(log.isTraceEnabled())
                               log.trace("peer's address (" + peer_addr + ") is greater than our local address (" +
                                       local_addr + "), replacing our existing connection");
                           // peer's address is greater, add peer's connection to ConnectionTable, destroy existing connection
                           removeConnection(peer_addr);
View Full Code Here

                   //Vladimir Nov, 5th, 2007
                   //we might have a connection to peer but is that
                   //connection still open?
                   boolean connectionOpen  = tmp != null && !tmp.isSocketClosed();
                   if(connectionOpen) {                      
                       if(peer_addr.compareTo(local_addr) > 0) {
                           if(log.isTraceEnabled())
                               log.trace("peer's address (" + peer_addr + ") is greater than our local address (" +
                                       local_addr + "), replacing our existing connection");
                           // peer's address is greater, add peer's connection to ConnectionTable, destroy existing connection
                           removeConnection(peer_addr);
View Full Code Here

                       Address peer_addr=conn.readPeerAddress(client_sock_ch.socket());
                       conn.peer_addr=peer_addr;
                       synchronized(conns) {
                           Connection tmp=(Connection)conns.get(peer_addr);
                           if(tmp != null) {
                               if(peer_addr.compareTo(local_addr) > 0) {
                                   if(log.isTraceEnabled())
                                       log.trace("peer's address (" + peer_addr + ") is greater than our local address (" +
                                               local_addr + "), replacing our existing connection");
                                   // peer's address is greater, add peer's connection to ConnectionTable, destroy existing connection
                                   addConnection(peer_addr,  conn);
View Full Code Here

                    mapper.getLock().lock();
                    try {                       
                        boolean currentConnectionOpen=mapper.hasOpenConnection(peer_addr);
                        boolean replaceWithNewConnection=false;
                        if(currentConnectionOpen) {
                            replaceWithNewConnection=peer_addr.compareTo(local_addr) > 0;
                        }
                        if(!currentConnectionOpen || replaceWithNewConnection) {
                            mapper.removeConnection(peer_addr);
                            mapper.addConnection(peer_addr, conn);
                            conn.start(mapper.getThreadFactory()); // starts handler thread on this socket
View Full Code Here

                       Address peer_addr=conn.readPeerAddress(client_sock_ch.socket());
                       conn.peer_addr=peer_addr;
                       synchronized(conns) {
                           Connection tmp=(Connection)conns.get(peer_addr);
                           if(tmp != null) {
                               if(peer_addr.compareTo(local_addr) > 0) {
                                   if(log.isTraceEnabled())
                                       log.trace("peer's address (" + peer_addr + ") is greater than our local address (" +
                                               local_addr + "), replacing our existing connection");
                                   // peer's address is greater, add peer's connection to ConnectionTable, destroy existing connection
                                   addConnection(peer_addr,  conn);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.