org.jboss.threads.AsyncFuture.get()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(82)

本文整理了Java中org.jboss.threads.AsyncFuture.get()方法的一些代码示例,展示了AsyncFuture.get()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AsyncFuture.get()方法的具体详情如下:
包路径:org.jboss.threads.AsyncFuture
类名称:AsyncFuture
方法名:get

AsyncFuture.get介绍

[英]Get (poll) the current status of the asynchronous operation.
[中]获取(轮询)异步操作的当前状态。

代码示例

代码示例来源:origin: wildfly/wildfly-core

@Override
  public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
    return delegate.get(timeout, unit);
  }
}

代码示例来源:origin: org.wildfly/wildfly-controller-client

@Override
public T get() throws InterruptedException, ExecutionException {
  return delegate.get();
}

代码示例来源:origin: org.wildfly/wildfly-controller-client

@Override
  public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
    return delegate.get(timeout, unit);
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-protocol

@Override
public void handleComplete(AsyncFuture<? extends T> asyncFuture, Object attachment) {
  try {
    callback.completed(asyncFuture.get());
  } catch (Exception e) {
    //
  }
}

代码示例来源:origin: org.jboss.as/jboss-as-protocol

@Override
public void handleComplete(AsyncFuture<? extends T> asyncFuture, Object attachment) {
  try {
    callback.completed(asyncFuture.get());
  } catch (Exception e) {
    //
  }
}

代码示例来源:origin: wildfly/wildfly-core

@Override
public void handleComplete(AsyncFuture<? extends T> asyncFuture, Object attachment) {
  try {
    callback.completed(asyncFuture.get());
  } catch (Exception e) {
    //
  }
}

代码示例来源:origin: org.wildfly/wildfly-controller-client

/**
 * Execute for result.
 *
 * @param executionContext the execution context
 * @return the result
 * @throws IOException for any error
 */
private ModelNode executeForResult(final OperationExecutionContext executionContext) throws IOException {
  try {
    return execute(executionContext).get();
  } catch(Exception e) {
    throw new IOException(e);
  }
}

代码示例来源:origin: wildfly/wildfly-core

@Override
public ModelNode get() throws InterruptedException, ExecutionException {
  return responseNodeOnly(delegate.get());
}

代码示例来源:origin: wildfly/wildfly-core

/**
 * Execute for result.
 *
 * @param executionContext the execution context
 * @return the result
 * @throws IOException for any error
 */
private OperationResponse executeForResult(final OperationExecutionContext executionContext) throws IOException {
  try {
    return execute(executionContext).get();
  } catch(Exception e) {
    throw new IOException(e);
  }
}

代码示例来源:origin: wildfly/wildfly-core

private OperationResponse doExecuteOperation(Operation operation, OperationMessageHandler messageHandler) throws IOException {
  AsyncFuture<OperationResponse> task;
  task = wrapped.executeOperationAsync(operation, messageHandler);
  setLastHandlerTask(task);
  try {
    return task.get();
  } catch (InterruptedException ex) {
    Thread.currentThread().interrupt();
    throw new IOException(ex);
  } catch (ExecutionException ex) {
    throw new IOException(ex);
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-cli

private OperationResponse doExecuteOperation(Operation operation, OperationMessageHandler messageHandler) throws IOException {
  AsyncFuture<OperationResponse> task;
  task = wrapped.executeOperationAsync(operation, messageHandler);
  setLastHandlerTask(task);
  try {
    return task.get();
  } catch (InterruptedException ex) {
    Thread.currentThread().interrupt();
    throw new IOException(ex);
  } catch (ExecutionException ex) {
    throw new IOException(ex);
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-server

public File getFile(final String relativePath, final byte repoId, final File localDeploymentFolder) {
    try {
      return channelHandler.executeRequest(new GetFileRequest(relativePath, localDeploymentFolder), null).getResult().get();
    } catch (Exception e) {
      throw ServerLogger.ROOT_LOGGER.failedToGetFileFromRemoteRepository(e);
    }
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-server

@Override
@SuppressWarnings("unchecked")
public AsyncFuture<ServiceContainer> startup(Configuration configuration, List<ServiceActivator> extraServices) {
  try {
    ServiceContainer container = bootstrap(configuration, extraServices).get();
    ServiceController<?> controller = container.getRequiredService(Services.JBOSS_AS);
    return (AsyncFuture<ServiceContainer>) controller.getValue();
  } catch (Exception ex) {
    shutdownHook.shutdown(true);
    throw ServerLogger.ROOT_LOGGER.cannotStartServer(ex);
  }
}

代码示例来源:origin: org.jboss.as/jboss-as-server

public File getFile(final String relativePath, final byte repoId, final File localDeploymentFolder) {
    try {
      return channelHandler.executeRequest(new GetFileRequest(relativePath, localDeploymentFolder), null).getResult().get();
    } catch (Exception e) {
      throw ServerMessages.MESSAGES.failedToGetFileFromRemoteRepository(e);
    }
  }
}

代码示例来源:origin: wildfly/wildfly-core

public File getFile(final String relativePath, final byte repoId, final File localDeploymentFolder) {
    try {
      return channelHandler.executeRequest(new GetFileRequest(relativePath, localDeploymentFolder), null).getResult().get();
    } catch (Exception e) {
      throw ServerLogger.ROOT_LOGGER.failedToGetFileFromRemoteRepository(e);
    }
  }
}

代码示例来源:origin: org.jboss.as/jboss-as-server

@Override
@SuppressWarnings("unchecked")
public AsyncFuture<ServiceContainer> startup(Configuration configuration, List<ServiceActivator> extraServices) {
  try {
    ServiceContainer container = bootstrap(configuration, extraServices).get();
    ServiceController<?> controller = container.getRequiredService(Services.JBOSS_AS);
    return (AsyncFuture<ServiceContainer>) controller.getValue();
  } catch (Exception ex) {
    throw ServerMessages.MESSAGES.cannotStartServer(ex);
  }
}

代码示例来源:origin: org.wildfly/wildfly-server

public File getFile(final String relativePath, final byte repoId, final File localDeploymentFolder) {
    try {
      return channelHandler.executeRequest(new GetFileRequest(relativePath, localDeploymentFolder), null).getResult().get();
    } catch (Exception e) {
      throw ServerMessages.MESSAGES.failedToGetFileFromRemoteRepository(e);
    }
  }
}

代码示例来源:origin: org.wildfly/wildfly-server

@Override
@SuppressWarnings("unchecked")
public AsyncFuture<ServiceContainer> startup(Configuration configuration, List<ServiceActivator> extraServices) {
  try {
    ServiceContainer container = bootstrap(configuration, extraServices).get();
    ServiceController<?> controller = container.getRequiredService(Services.JBOSS_AS);
    return (AsyncFuture<ServiceContainer>) controller.getValue();
  } catch (Exception ex) {
    throw ServerMessages.MESSAGES.cannotStartServer(ex);
  }
}

代码示例来源:origin: wildfly/wildfly-core

@Override
@SuppressWarnings("unchecked")
public AsyncFuture<ServiceContainer> startup(Configuration configuration, List<ServiceActivator> extraServices) {
  try {
    ServiceContainer container = bootstrap(configuration, extraServices).get();
    ServiceController<?> controller = container.getRequiredService(Services.JBOSS_AS);
    return (AsyncFuture<ServiceContainer>) controller.getValue();
  } catch (Exception ex) {
    shutdownHook.shutdown(true);
    throw ServerLogger.ROOT_LOGGER.cannotStartServer(ex);
  }
}

代码示例来源:origin: org.jboss.as/jboss-as-host-controller

public File getFile(final String relativePath, final byte repoId, HostFileRepository localFileRepository) {
    if(connection.isConnected()) {
      try {
        return handler.executeRequest(new GetFileRequest(repoId, relativePath, localFileRepository), null).getResult().get();
      } catch (Exception e) {
        throw MESSAGES.failedToGetFileFromRemoteRepository(e);
      }
    } else {
      return localFileRepository.getFile(relativePath);
    }
  }
};

相关文章