Refine search
@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return delegate.get(timeout, unit); } }
@Override public Status await() throws InterruptedException { return delegate.await(); }
@Override public boolean isDone() { return delegate.isDone(); }
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); } } }
AsyncFuture<Long> future = null; try { if (interval < 1 || System.currentTimeMillis() - channelHandler.getLastMessageReceivedTime() > interval) { future = channelHandler.executeRequest(ManagementPingRequest.INSTANCE, null).getResult(); Long id = future.get(timeout, TimeUnit.MILLISECONDS); if (!cancelled && remoteConnectionID != null && !remoteConnectionID.equals(id)) { HostControllerLogger.DOMAIN_LOGGER.slaveHostControllerChanged(hostName); Channel channel = null; try { channel = channelHandler.getChannel(); } catch (IOException e) {
@Override public void connectionOpened(final Connection connection) throws IOException { final Channel channel = openChannel(connection, CHANNEL_SERVICE_TYPE, configuration.getOptionMap()); if(setChannel(channel)) { channel.receiveMessage(channelHandler.getReceiver()); channel.addCloseHandler(channelHandler); try { if (runningMode == RunningMode.ADMIN_ONLY) { // Fetch the domain configuration channelHandler.executeRequest(new FetchDomainConfigurationRequest(), null).getResult().get(); } else { // Start the registration process channelHandler.executeRequest(new RegisterHostControllerRequest(), null).getResult().get(); } } catch (Exception e) { if(e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw new IOException(e); } // Registered registered(); } else { channel.closeAsync(); } }
/** * Send the started notification */ synchronized void started() { try { if(isConnected()) { channelHandler.executeRequest(new ServerStartedRequest(), null).getResult().await(); } } catch (Exception e) { ServerLogger.AS_ROOT_LOGGER.debugf(e, "failed to send started notification"); } }
prepared.getFinalResult().get(); } catch (InterruptedException e) { HostControllerLogger.ROOT_LOGGER.interruptedAwaitingSuspendResponse(e, serverName); future.asyncCancel(true); Thread.currentThread().interrupt(); return false; } catch (ExecutionException e) { HostControllerLogger.ROOT_LOGGER.suspendListenerFailed(e, serverName); future.asyncCancel(true); return false;
private void asyncCancel() { if (finalResult instanceof AsyncFuture) { ((AsyncFuture) finalResult).asyncCancel(true); } }
private synchronized void registerFuture(TransactionalProtocolClient remoteClient, AsyncFuture<OperationResponse> future) { if (this.remoteClient != remoteClient) { future.asyncCancel(true); } else { future.addListener(new AsyncFuture.Listener<OperationResponse, TransactionalProtocolClient>() { @Override public void handleComplete(AsyncFuture<? extends OperationResponse> ignored, TransactionalProtocolClient attachment) {
public <A> void addListener(Listener<? super T, A> aListener, A attachment) { delegate.addListener(aListener, attachment); }
@Override public Status awaitUninterruptibly(long timeout, TimeUnit unit) { return delegate.awaitUninterruptibly(timeout, unit); }
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); } } }
AsyncFuture<Long> future = null; try { if (interval < 1 || System.currentTimeMillis() - channelHandler.getLastMessageReceivedTime() > interval) { future = channelHandler.executeRequest(ManagementPingRequest.INSTANCE, null).getResult(); Long id = future.get(timeout, TimeUnit.MILLISECONDS); if (!cancelled && remoteConnectionID != null && !remoteConnectionID.equals(id)) { HostControllerLogger.DOMAIN_LOGGER.slaveHostControllerChanged(hostName); Channel channel = null; try { channel = channelHandler.getChannel(); } catch (IOException e) {
@Override public void connectionOpened(final Connection connection) throws IOException { final Channel channel = openChannel(connection, CHANNEL_SERVICE_TYPE, configuration.getOptionMap()); if(setChannel(channel)) { channel.receiveMessage(channelHandler.getReceiver()); channel.addCloseHandler(channelHandler); try { if (runningMode == RunningMode.ADMIN_ONLY) { // Fetch the domain configuration channelHandler.executeRequest(new FetchDomainConfigurationRequest(), null).getResult().get(); } else { // Start the registration process channelHandler.executeRequest(new RegisterHostControllerRequest(), null).getResult().get(); } } catch (Exception e) { if(e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw new IOException(e); } // Registered registered(); } else { channel.closeAsync(); } }
/** * Send the started notification */ synchronized void started() { try { if(isConnected()) { channelHandler.executeRequest(new ServerStartedRequest(), null).getResult().await(); } } catch (Exception e) { ServerLogger.AS_ROOT_LOGGER.debugf(e, "failed to send started notification"); } }
prepared.getFinalResult().get(); } catch (InterruptedException e) { HostControllerLogger.ROOT_LOGGER.interruptedAwaitingSuspendResponse(e, serverName); future.asyncCancel(true); Thread.currentThread().interrupt(); return false; } catch (ExecutionException e) { HostControllerLogger.ROOT_LOGGER.suspendListenerFailed(e, serverName); future.asyncCancel(true); return false;
private void asyncCancel() { if (finalResult instanceof AsyncFuture) { ((AsyncFuture) finalResult).asyncCancel(true); } }
private synchronized void registerFuture(TransactionalProtocolClient remoteClient, AsyncFuture<OperationResponse> future) { if (this.remoteClient != remoteClient) { future.asyncCancel(true); } else { future.addListener(new AsyncFuture.Listener<OperationResponse, TransactionalProtocolClient>() { @Override public void handleComplete(AsyncFuture<? extends OperationResponse> ignored, TransactionalProtocolClient attachment) {
public <A> void addListener(Listener<? super T, A> aListener, A attachment) { delegate.addListener(aListener, attachment); }