コード例 #1
0
 void placeResponse(final int sequence, final ProtocolFrame response) {
   synchronized (myResponseQueue) {
     if (response == null || myResponseQueue.containsKey(sequence)) {
       myResponseQueue.put(sequence, response);
     }
     if (response != null) {
       myResponseQueue.notifyAll();
     }
   }
 }
コード例 #2
0
  @Nullable
  ProtocolFrame waitForResponse(final int sequence) {
    ProtocolFrame response;
    long until = System.currentTimeMillis() + RESPONSE_TIMEOUT;

    synchronized (myResponseQueue) {
      do {
        try {
          myResponseQueue.wait(1000);
        } catch (InterruptedException ignore) {
        }
        response = myResponseQueue.get(sequence);
      } while (response == null && isConnected() && System.currentTimeMillis() < until);
      myResponseQueue.remove(sequence);
    }

    return response;
  }
コード例 #3
0
 public RemoteDebugger getDebugger(String threadId) {
   return myThreadIdToDebugger.get(threadId);
 }
コード例 #4
0
 public void register(String id, RemoteDebugger debugger) {
   myThreadIdToDebugger.put(id, debugger);
 }
コード例 #5
0
 @Override
 public Collection<PyThreadInfo> getThreads() {
   return Collections.unmodifiableCollection(new ArrayList<PyThreadInfo>(myThreads.values()));
 }
コード例 #6
0
 private void cleanUp() {
   myThreads.clear();
   myResponseQueue.clear();
   mySequence = -1;
   myTempVars.clear();
 }