private MethodInfo[] toMethodInfo( Class type, Method[] methods ) { List<MethodInfo> result = new ArrayList<MethodInfo>(); short methodId = 0; for( Method m : methods ) { // Simple... add all methods exposed through the interface result.add(new MethodInfo(methodId++, m)); } return result.toArray(new MethodInfo[result.size()]); }
@Override public Object invoke(Object o, Method method, Object[] os) throws Throwable { MethodInfo mi = getMethodInfo(method); if( mi == null ) { // Try to invoke locally return method.invoke(this, os); } return rmi.invokeRemote(channel, objectId, mi.getId(), mi.getCallType(), os); }
public Object invoke( short procId, Object[] args ) { if( log.isLoggable(Level.FINEST) ) { log.finest("SharedObject->invoking:" + classInfo.getMethod(procId) + " on:" + object + " with:" + (args == null ? "null" : Arrays.asList(args))); } return classInfo.getMethod(procId).invoke(object, args); } }
public MethodInfo( short id, Method m ) { this.id = id; this.method = m; this.representation = methodToString(m); this.callType = getCallType(m); }
@Override public String toString() { return "MethodInfo[#" + getId() + ", callType=" + callType + ", " + representation + "]"; } }
public MethodInfo getMethod( Method m ) { for( MethodInfo mi : methods ) { if( mi.matches(m) ) { return mi; } } return null; }
public boolean matches( Method m ) { return representation.equals(methodToString(m)); }
public MethodInfo( short id, Method m ) { this.id = id; this.method = m; this.representation = methodToString(m); this.callType = getCallType(m); }
@Override public String toString() { return "MethodInfo[#" + getId() + ", callType=" + callType + ", " + representation + "]"; } }
public MethodInfo getMethod( Method m ) { for( MethodInfo mi : methods ) { if( mi.matches(m) ) { return mi; } } return null; }
public boolean matches( Method m ) { return representation.equals(methodToString(m)); }
@Override public Object invoke(Object o, Method method, Object[] os) throws Throwable { MethodInfo mi = getMethodInfo(method); if( mi == null ) { // Try to invoke locally return method.invoke(this, os); } return rmi.invokeRemote(channel, objectId, mi.getId(), mi.getCallType(), os); }
private MethodInfo[] toMethodInfo( Class type, Method[] methods ) { List<MethodInfo> result = new ArrayList<MethodInfo>(); short methodId = 0; for( Method m : methods ) { // Simple... add all methods exposed through the interface result.add(new MethodInfo(methodId++, m)); } return result.toArray(new MethodInfo[result.size()]); }
public Object invoke( short procId, Object[] args ) { if( log.isLoggable(Level.FINEST) ) { log.finest("SharedObject->invoking:" + classInfo.getMethod(procId) + " on:" + object + " with:" + (args == null ? "null" : Arrays.asList(args))); } return classInfo.getMethod(procId).invoke(object, args); } }