1 package org.objectweb.proactive.core.group; 2 3 import org.objectweb.proactive.Body; 4 import org.objectweb.proactive.core.body.LocalBodyStore; 5 import org.objectweb.proactive.core.body.proxy.UniversalBodyProxy; 6 import org.objectweb.proactive.core.mop.MethodCall; 7 import org.objectweb.proactive.core.mop.Proxy; 8 import org.objectweb.proactive.core.mop.StubObject; 9 10 import java.util.Vector ; 11 12 13 18 public class ProcessForOneWayCall extends AbstractProcessForGroup 19 implements Runnable { 20 21 private int index; 22 private MethodCall mc; 23 private Body body; 24 private ExceptionList exceptionList; 25 26 public ProcessForOneWayCall(ProxyForGroup proxyGroup, Vector memberList, 27 int index, MethodCall mc, Body body, ExceptionList exceptionList) { 28 this.proxyGroup = proxyGroup; 29 this.memberList = memberList; 30 this.index = index; 31 this.mc = mc; 32 this.body = body; 33 this.exceptionList = exceptionList; 34 } 35 36 public synchronized void run() { 37 LocalBodyStore.getInstance().setCurrentThreadBody(body); 38 Object object = this.memberList.get(this.index); 39 boolean objectIsLocal = false; 40 41 42 if (!(object instanceof Throwable )) { 43 Proxy lastProxy = AbstractProcessForGroup.findLastProxy(object); 44 if (lastProxy instanceof UniversalBodyProxy) { 45 objectIsLocal = ((UniversalBodyProxy) lastProxy).isLocal(); 46 } 47 try { 48 if (lastProxy == null) { 49 this.mc.execute(object); 51 } else if (!objectIsLocal) { 52 ((StubObject) object).getProxy().reify(this.mc); 53 } else { 54 ((StubObject) object).getProxy().reify(new MethodCall( 55 this.mc)); 56 } 57 } catch (Throwable e) { 58 this.exceptionList.add(new ExceptionInGroup(object, e)); 59 } 60 } 61 } 62 } 63 | Popular Tags |