当前位置: 首页>>代码示例>>Java>>正文


Java ApiProxy.ApiConfig方法代码示例

本文整理汇总了Java中com.google.apphosting.api.ApiProxy.ApiConfig方法的典型用法代码示例。如果您正苦于以下问题:Java ApiProxy.ApiConfig方法的具体用法?Java ApiProxy.ApiConfig怎么用?Java ApiProxy.ApiConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.apphosting.api.ApiProxy的用法示例。


在下文中一共展示了ApiProxy.ApiConfig方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeAsyncCall

import com.google.apphosting.api.ApiProxy; //导入方法依赖的package包/类
public Future<byte[]> makeAsyncCall(
    Environment environment,
    String packageName,
    String methodName,
    byte[] request,
    ApiProxy.ApiConfig apiConfig) {
  return oldDelegate.makeAsyncCall(environment, packageName, methodName, request, apiConfig);
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-java-vm-runtime,代码行数:9,代码来源:LogTest.java

示例2: makeAsyncCall

import com.google.apphosting.api.ApiProxy; //导入方法依赖的package包/类
@Override
public Future<byte[]> makeAsyncCall(
    ApiProxy.Environment environment,
    String packageName,
    String methodName,
    byte[] request,
    ApiProxy.ApiConfig apiConfig) {
  if ("remote_socket".equals(packageName)) {
    final byte[] response = makeResponse(methodName, request);
    return new Future<byte[]>() {
      @Override
      public boolean cancel(boolean mayInterruptIfRunning) {
        return false;
      }

      @Override
      public boolean isCancelled() {
        return false;
      }

      @Override
      public boolean isDone() {
        return true;
      }

      @Override
      public byte[] get() throws InterruptedException, ExecutionException {
        return response;
      }

      @Override
      public byte[] get(long timeout, TimeUnit unit)
          throws InterruptedException, ExecutionException, TimeoutException {
        return response;
      }
    };
  }
  throw new UnsupportedOperationException();
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-java-vm-runtime,代码行数:40,代码来源:TestDatagramSocketServlet.java

示例3: makeAsyncCall

import com.google.apphosting.api.ApiProxy; //导入方法依赖的package包/类
@Override
public Future<byte[]> makeAsyncCall(
    ApiProxy.Environment environment,
    String packageName,
    String methodName,
    byte[] request,
    ApiProxy.ApiConfig apiConfig) {
  if ("remote_socket".equals(packageName) && "Resolve".equals(methodName)) {
    return new Future<byte[]>() {
      @Override
      public boolean cancel(boolean mayInterruptIfRunning) {
        return false;
      }

      @Override
      public boolean isCancelled() {
        return false;
      }

      @Override
      public boolean isDone() {
        return true;
      }

      @Override
      public byte[] get() throws InterruptedException, ExecutionException {
        return RESOLVER_RESPONSE;
      }

      @Override
      public byte[] get(long timeout, TimeUnit unit)
          throws InterruptedException, ExecutionException, TimeoutException {
        return RESOLVER_RESPONSE;
      }
    };
  }
  throw new UnsupportedOperationException();
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-java-vm-runtime,代码行数:39,代码来源:TestInetAddressServlet.java

示例4: makeAsyncCall

import com.google.apphosting.api.ApiProxy; //导入方法依赖的package包/类
public Future<byte[]> makeAsyncCall(
    ApiProxy.Environment environment,
    String packageName,
    String methodName,
    byte[] request,
    ApiProxy.ApiConfig apiConfig) {
  if (packageName.equals("datastore_v3") && timeoutCount > 0) {
    timeoutCount--;
    throw new DatastoreTimeoutException("Timeout");
  }
  return delegate.makeAsyncCall(environment, packageName, methodName, request, apiConfig);
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-java-vm-runtime,代码行数:13,代码来源:SessionManagerTest.java


注:本文中的com.google.apphosting.api.ApiProxy.ApiConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。