public RemoteMethodCallResults invokeAndWait(final String endPointName,final RemoteMethodCall remoteCall){
  EndPoint local;
synchronized (m_endPointMutex) {
    local=m_localEndPoints.get(endPointName);
  }
  if (local == null) {
    return invokeAndWaitRemote(remoteCall);
  }
 else {
    final long number=local.takeANumber();
    final List<RemoteMethodCallResults> results=local.invokeLocal(remoteCall,number,getLocalNode());
    if (results.size() == 0) {
      throw new RemoteNotFoundException("Not found:" + endPointName);
    }
    if (results.size() > 1) {
      throw new IllegalStateException("Too many implementors, got back:" + results);
    }
    return results.get(0);
  }
}

public RemoteMethodCallResults invokeAndWait ( final String endPointName , final RemoteMethodCall remoteCall ) { EndPoint local ; synchronized ( m_endPointMutex ) { local = m_localEndPoints . get ( endPointName ) ; } if ( local == null ) { return invokeAndWaitRemote ( remoteCall ) ; } else { final long number = local . takeANumber ( ) ; final List < RemoteMethodCallResults > results = local . invokeLocal ( remoteCall , number , getLocalNode ( ) ) ; if ( results . size ( ) == 0 ) { throw new RemoteNotFoundException ( "Not found:" + endPointName ) ; } if ( results . size ( ) > 1 ) { throw new IllegalStateException ( "Too many implementors, got back:" + results ) ; } return results . get ( 0 ) ; } }
invoke and wait for all implementors on all vms to finish executing .
