00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030  
00031 package org.objectweb.proactive.core.group;
00032 
00033 import java.util.Vector;
00034 
00035 import org.objectweb.proactive.core.body.future.FutureProxy;
00036 import org.objectweb.proactive.core.mop.MOP;
00037 import org.objectweb.proactive.core.mop.Proxy;
00038 import org.objectweb.proactive.core.mop.StubObject;
00039 
00040 
00041 public abstract class AbstractProcessForGroup {
00042     protected static Proxy findLastProxy(Object obj) {
00043         if (!MOP.isReifiedObject(obj)) {
00044             return null;
00045         }
00046         Proxy proxy = ((StubObject) obj).getProxy();
00047         while (proxy instanceof FutureProxy) {
00048             if (MOP.isReifiedObject(((FutureProxy) proxy).getResult())) {
00049                 return AbstractProcessForGroup.findLastProxy(((FutureProxy) proxy).getResult());
00050             } else {
00051                 return proxy;
00052             }
00053         }
00054         return proxy;
00055     }
00056 
00057     protected Vector memberList;
00058     protected ProxyForGroup proxyGroup;
00059 
00060     public int getMemberListSize() {
00061         if (memberList != null) {
00062             return memberList.size();
00063         } else {
00064             return 0;
00065         }
00066     }
00067 }