當前位置: 首頁>>代碼示例>>Java>>正文


Java NamedRunnable類代碼示例

本文整理匯總了Java中com.squareup.okhttp.internal.NamedRunnable的典型用法代碼示例。如果您正苦於以下問題:Java NamedRunnable類的具體用法?Java NamedRunnable怎麽用?Java NamedRunnable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NamedRunnable類屬於com.squareup.okhttp.internal包,在下文中一共展示了NamedRunnable類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: pushRequestLater

import com.squareup.okhttp.internal.NamedRunnable; //導入依賴的package包/類
private void pushRequestLater(int streamId, List<Header> requestHeaders) {
    synchronized (this) {
        if (this.currentPushRequests.contains(Integer.valueOf(streamId))) {
            writeSynResetLater(streamId, ErrorCode.PROTOCOL_ERROR);
            return;
        }
        this.currentPushRequests.add(Integer.valueOf(streamId));
        final int i = streamId;
        final List<Header> list = requestHeaders;
        this.pushExecutor.execute(new NamedRunnable("OkHttp %s Push Request[%s]", new
                Object[]{this.hostName, Integer.valueOf(streamId)}) {
            public void execute() {
                if (FramedConnection.this.pushObserver.onRequest(i, list)) {
                    try {
                        FramedConnection.this.frameWriter.rstStream(i, ErrorCode.CANCEL);
                        synchronized (FramedConnection.this) {
                            FramedConnection.this.currentPushRequests.remove(Integer.valueOf
                                    (i));
                        }
                    } catch (IOException e) {
                    }
                }
            }
        });
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:27,代碼來源:FramedConnection.java

示例2: pushHeadersLater

import com.squareup.okhttp.internal.NamedRunnable; //導入依賴的package包/類
private void pushHeadersLater(int streamId, List<Header> requestHeaders, boolean inFinished) {
    final int i = streamId;
    final List<Header> list = requestHeaders;
    final boolean z = inFinished;
    this.pushExecutor.execute(new NamedRunnable("OkHttp %s Push Headers[%s]", new
            Object[]{this.hostName, Integer.valueOf(streamId)}) {
        public void execute() {
            boolean cancel = FramedConnection.this.pushObserver.onHeaders(i, list, z);
            if (cancel) {
                try {
                    FramedConnection.this.frameWriter.rstStream(i, ErrorCode.CANCEL);
                } catch (IOException e) {
                    return;
                }
            }
            if (cancel || z) {
                synchronized (FramedConnection.this) {
                    FramedConnection.this.currentPushRequests.remove(Integer.valueOf(i));
                }
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:24,代碼來源:FramedConnection.java

示例3: writeSynResetLater

import com.squareup.okhttp.internal.NamedRunnable; //導入依賴的package包/類
final void writeSynResetLater(final int paramInt, final ErrorCode paramErrorCode)
{
  ExecutorService localExecutorService = executor;
  Object[] arrayOfObject = new Object[2];
  arrayOfObject[0] = this.hostName;
  arrayOfObject[1] = Integer.valueOf(paramInt);
  localExecutorService.submit(new NamedRunnable("OkHttp %s stream %d", arrayOfObject)
  {
    public final void execute()
    {
      try
      {
        SpdyConnection.this.writeSynReset(paramInt, paramErrorCode);
        return;
      }
      catch (IOException localIOException) {}
    }
  });
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:20,代碼來源:SpdyConnection.java

示例4: writeWindowUpdateLater

import com.squareup.okhttp.internal.NamedRunnable; //導入依賴的package包/類
final void writeWindowUpdateLater(final int paramInt, final long paramLong)
{
  ExecutorService localExecutorService = executor;
  Object[] arrayOfObject = new Object[2];
  arrayOfObject[0] = this.hostName;
  arrayOfObject[1] = Integer.valueOf(paramInt);
  localExecutorService.submit(new NamedRunnable("OkHttp Window Update %s stream %d", arrayOfObject)
  {
    public final void execute()
    {
      try
      {
        SpdyConnection.this.frameWriter.windowUpdate(paramInt, paramLong);
        return;
      }
      catch (IOException localIOException) {}
    }
  });
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:20,代碼來源:SpdyConnection.java

示例5: ackSettingsLater

import com.squareup.okhttp.internal.NamedRunnable; //導入依賴的package包/類
private void ackSettingsLater(final Settings peerSettings) {
    FramedConnection.executor.execute(new NamedRunnable("OkHttp %s ACK Settings", new
            Object[]{FramedConnection.this.hostName}) {
        public void execute() {
            try {
                FramedConnection.this.frameWriter.ackSettings(peerSettings);
            } catch (IOException e) {
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:12,代碼來源:FramedConnection.java

示例6: writeSynResetLater

import com.squareup.okhttp.internal.NamedRunnable; //導入依賴的package包/類
void writeSynResetLater(int streamId, ErrorCode errorCode) {
    final int i = streamId;
    final ErrorCode errorCode2 = errorCode;
    executor.submit(new NamedRunnable("OkHttp %s stream %d", new Object[]{this.hostName,
            Integer.valueOf(streamId)}) {
        public void execute() {
            try {
                FramedConnection.this.writeSynReset(i, errorCode2);
            } catch (IOException e) {
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:14,代碼來源:FramedConnection.java

示例7: writeWindowUpdateLater

import com.squareup.okhttp.internal.NamedRunnable; //導入依賴的package包/類
void writeWindowUpdateLater(int streamId, long unacknowledgedBytesRead) {
    final int i = streamId;
    final long j = unacknowledgedBytesRead;
    executor.execute(new NamedRunnable("OkHttp Window Update %s stream %d", new Object[]{this
            .hostName, Integer.valueOf(streamId)}) {
        public void execute() {
            try {
                FramedConnection.this.frameWriter.windowUpdate(i, j);
            } catch (IOException e) {
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:14,代碼來源:FramedConnection.java

示例8: writePingLater

import com.squareup.okhttp.internal.NamedRunnable; //導入依賴的package包/類
private void writePingLater(boolean reply, int payload1, int payload2, Ping ping) {
    final boolean z = reply;
    final int i = payload1;
    final int i2 = payload2;
    final Ping ping2 = ping;
    executor.execute(new NamedRunnable("OkHttp %s ping %08x%08x", new Object[]{this.hostName,
            Integer.valueOf(payload1), Integer.valueOf(payload2)}) {
        public void execute() {
            try {
                FramedConnection.this.writePing(z, i, i2, ping2);
            } catch (IOException e) {
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:16,代碼來源:FramedConnection.java

示例9: pushDataLater

import com.squareup.okhttp.internal.NamedRunnable; //導入依賴的package包/類
private void pushDataLater(int streamId, BufferedSource source, int byteCount, boolean
        inFinished) throws IOException {
    final Buffer buffer = new Buffer();
    source.require((long) byteCount);
    source.read(buffer, (long) byteCount);
    if (buffer.size() != ((long) byteCount)) {
        throw new IOException(buffer.size() + " != " + byteCount);
    }
    final int i = streamId;
    final int i2 = byteCount;
    final boolean z = inFinished;
    this.pushExecutor.execute(new NamedRunnable("OkHttp %s Push Data[%s]", new Object[]{this
            .hostName, Integer.valueOf(streamId)}) {
        public void execute() {
            try {
                boolean cancel = FramedConnection.this.pushObserver.onData(i, buffer, i2, z);
                if (cancel) {
                    FramedConnection.this.frameWriter.rstStream(i, ErrorCode.CANCEL);
                }
                if (cancel || z) {
                    synchronized (FramedConnection.this) {
                        FramedConnection.this.currentPushRequests.remove(Integer.valueOf(i));
                    }
                }
            } catch (IOException e) {
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:30,代碼來源:FramedConnection.java

示例10: pushResetLater

import com.squareup.okhttp.internal.NamedRunnable; //導入依賴的package包/類
private void pushResetLater(int streamId, ErrorCode errorCode) {
    final int i = streamId;
    final ErrorCode errorCode2 = errorCode;
    this.pushExecutor.execute(new NamedRunnable("OkHttp %s Push Reset[%s]", new Object[]{this.hostName, Integer.valueOf(streamId)}) {
        public void execute() {
            FramedConnection.this.pushObserver.onReset(i, errorCode2);
            synchronized (FramedConnection.this) {
                FramedConnection.this.currentPushRequests.remove(Integer.valueOf(i));
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:13,代碼來源:FramedConnection.java

示例11: writeSynResetLater

import com.squareup.okhttp.internal.NamedRunnable; //導入依賴的package包/類
void writeSynResetLater(final int streamId, final ErrorCode errorCode) {
  executor.submit(new NamedRunnable("OkHttp SPDY Writer %s stream %d", hostName, streamId) {
    @Override public void execute() {
      try {
        writeSynReset(streamId, errorCode);
      } catch (IOException ignored) {
      }
    }
  });
}
 
開發者ID:aabognah,項目名稱:LoRaWAN-Smart-Parking,代碼行數:11,代碼來源:SpdyConnection.java

示例12: writeWindowUpdateLater

import com.squareup.okhttp.internal.NamedRunnable; //導入依賴的package包/類
void writeWindowUpdateLater(final int streamId, final int deltaWindowSize) {
  executor.submit(new NamedRunnable("OkHttp SPDY Writer %s stream %d", hostName, streamId) {
    @Override public void execute() {
      try {
        writeWindowUpdate(streamId, deltaWindowSize);
      } catch (IOException ignored) {
      }
    }
  });
}
 
開發者ID:aabognah,項目名稱:LoRaWAN-Smart-Parking,代碼行數:11,代碼來源:SpdyConnection.java

示例13: writePingLater

import com.squareup.okhttp.internal.NamedRunnable; //導入依賴的package包/類
private void writePingLater(
    final boolean reply, final int payload1, final int payload2, final Ping ping) {
  executor.submit(new NamedRunnable("OkHttp SPDY Writer %s ping %08x%08x",
      hostName, payload1, payload2) {
    @Override public void execute() {
      try {
        writePing(reply, payload1, payload2, ping);
      } catch (IOException ignored) {
      }
    }
  });
}
 
開發者ID:aabognah,項目名稱:LoRaWAN-Smart-Parking,代碼行數:13,代碼來源:SpdyConnection.java


注:本文中的com.squareup.okhttp.internal.NamedRunnable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。