1 7 package org.jboss.cache; 8 9 import org.jboss.cache.marshall.MethodCall; 10 import org.jgroups.Address; 11 12 import java.lang.reflect.Method ; 13 import java.util.List ; 14 15 20 public class RPCManager 21 { 22 CacheImpl c; 23 24 private RPCManager(CacheImpl c) 25 { 26 this.c = c; 27 } 28 29 public static RPCManager getInstance(CacheImpl c) 30 { 31 RPCManager rpcManager = c.getRpcManager(); 32 if (rpcManager == null) 33 { 34 rpcManager = new RPCManager(c); 35 c.setRpcManager(rpcManager); 36 } 37 38 return rpcManager; 39 } 40 41 43 public List callRemoteMethods(List <Address> recipients, MethodCall methodCall, int mode, boolean excludeSelf, long timeout) throws Exception 44 { 45 return c.callRemoteMethods(recipients, methodCall, mode, excludeSelf, timeout); 46 } 47 48 public boolean isCoordinator() 49 { 50 return c.isCoordinator(); 51 } 52 53 public Address getCoordinator() 54 { 55 return c.getCoordinator(); 56 } 57 58 public List callRemoteMethods(List <Address> recipients, MethodCall methodCall, boolean synchronous, boolean excludeSelf, int timeout) throws Exception 59 { 60 return c.callRemoteMethods(recipients, methodCall, synchronous, excludeSelf, timeout); 61 } 62 63 public List callRemoteMethods(List <Address> recipients, Method method, Object [] arguments, boolean synchronous, boolean excludeSelf, long timeout) throws Exception 64 { 65 return c.callRemoteMethods(recipients, method, arguments, synchronous, excludeSelf, timeout); 66 } 67 68 71 public ReplicationQueue getReplicationQueue() 72 { 73 return c.getReplQueue(); 74 } 75 } 76 | Popular Tags |