本文整理汇总了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);
}
示例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();
}
示例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);
}