CVS update: JGroups/src/org/jgroups/util Util.java
"Bela Ban" <[email protected]>
| Newsgroups | gmane.comp.java.javagroups.cvs |
|---|---|
| Message-ID | <[email protected]> |
User: belaban
Date: 10/08/18 07:43:48
Modified: src/org/jgroups/util Util.java
Log:
ns
Revision Changes Path
1.272 +7 -8 JGroups/src/org/jgroups/util/Util.java
Index: Util.java
===================================================================
RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/util/Util.java,v
retrieving revision 1.271
retrieving revision 1.272
diff -u -r1.271 -r1.272
--- Util.java 12 Aug 2010 15:57:22 -0000 1.271
+++ Util.java 18 Aug 2010 07:43:48 -0000 1.272
@@ -35,7 +35,7 @@
/**
* Collection of various utility routines that can not be assigned to other classes.
* @author Bela Ban
- * @version $Id: Util.java,v 1.271 2010/08/12 15:57:22 belaban Exp $
+ * @version $Id: Util.java,v 1.272 2010/08/18 07:43:48 belaban Exp $
*/
public class Util {
@@ -3449,18 +3449,17 @@
public static boolean isCoordinator(JChannel ch) {
- if(ch == null) return false;
- View view=ch.getView();
- if(view == null)
- return false;
- Address local_addr=ch.getAddress();
- if(local_addr == null)
+ return isCoordinator(ch.getView(), ch.getAddress());
+ }
+
+
+ public static boolean isCoordinator(View view, Address local_addr) {
+ if(view == null || local_addr == null)
return false;
Vector<Address> mbrs=view.getMembers();
return !(mbrs == null || mbrs.isEmpty()) && local_addr.equals(mbrs.firstElement());
}
-
public static MBeanServer getMBeanServer() {
ArrayList servers = MBeanServerFactory.findMBeanServer(null);
if (servers != null && !servers.isEmpty()) {
------------------------------------------------------------------------------
This SF.net email is sponsored by
Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev