コード例 #1
0
ファイル: SlaveHostPinger.java プロジェクト: djafaka/jboss-as
 @Override
 public void run() {
   if (!cancelled) {
     boolean fail = false;
     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);
           fail = true;
         } else {
           remoteConnectionID = id;
         }
       }
     } catch (IOException e) {
       HostControllerLogger.DOMAIN_LOGGER.debug("Caught exception sending ping request", e);
     } catch (InterruptedException e) {
       safeCancel(future);
       Thread.currentThread().interrupt();
     } catch (ExecutionException e) {
       HostControllerLogger.DOMAIN_LOGGER.debug("Caught exception sending ping request", e);
     } catch (TimeoutException e) {
       if (!cancelled) {
         fail = true;
         HostControllerLogger.DOMAIN_LOGGER.slaveHostControllerUnreachable(hostName, timeout);
       }
       safeCancel(future);
     } finally {
       if (fail) {
         Channel channel = null;
         try {
           channel = channelHandler.getChannel();
         } catch (IOException e) {
           // ignore; shouldn't happen as the channel is already established if this task is
           // running
         }
         StreamUtils.safeClose(channel);
       } else if (!cancelled && interval > 0) {
         scheduler.schedule(this, interval, TimeUnit.MILLISECONDS);
       }
     }
   }
 }
コード例 #2
0
 public ModelNode get(long timeout, TimeUnit unit)
     throws InterruptedException, ExecutionException, TimeoutException {
   return delegate.get(timeout, unit);
 }
コード例 #3
0
 public ModelNode get() throws InterruptedException, ExecutionException {
   return delegate.get();
 }
コード例 #4
0
 public <A> void addListener(
     org.jboss.threads.AsyncFuture.Listener<? super ModelNode, A> listener, A attachment) {
   delegate.addListener(listener, attachment);
 }
コード例 #5
0
 public org.jboss.threads.AsyncFuture.Status getStatus() {
   return delegate.getStatus();
 }
コード例 #6
0
 public boolean isDone() {
   return delegate.isDone();
 }
コード例 #7
0
 public org.jboss.threads.AsyncFuture.Status awaitUninterruptibly(long timeout, TimeUnit unit) {
   return delegate.awaitUninterruptibly(timeout, unit);
 }
コード例 #8
0
 public org.jboss.threads.AsyncFuture.Status awaitUninterruptibly() {
   return delegate.awaitUninterruptibly();
 }
コード例 #9
0
 public ModelNode getUninterruptibly(long timeout, TimeUnit unit)
     throws CancellationException, ExecutionException, TimeoutException {
   return delegate.getUninterruptibly(timeout, unit);
 }
コード例 #10
0
 public ModelNode getUninterruptibly() throws CancellationException, ExecutionException {
   return delegate.getUninterruptibly();
 }
コード例 #11
0
 public org.jboss.threads.AsyncFuture.Status await(long timeout, TimeUnit unit)
     throws InterruptedException {
   return delegate.await(timeout, unit);
 }
コード例 #12
0
 public org.jboss.threads.AsyncFuture.Status await() throws InterruptedException {
   return delegate.await();
 }