org.jclouds.compute.callables
Class BlockUntilInitScriptStatusIsZeroThenReturnOutput

java.lang.Object
  extended by com.google.common.util.concurrent.AbstractFuture<ExecResponse>
      extended by org.jclouds.compute.callables.BlockUntilInitScriptStatusIsZeroThenReturnOutput
All Implemented Interfaces:
com.google.common.util.concurrent.ListenableFuture<ExecResponse>, Runnable, Future<ExecResponse>

public class BlockUntilInitScriptStatusIsZeroThenReturnOutput
extends com.google.common.util.concurrent.AbstractFuture<ExecResponse>
implements Runnable

A future that works in tandem with a task that was invoked by InitScript


Nested Class Summary
static interface BlockUntilInitScriptStatusIsZeroThenReturnOutput.Factory
           
 
Field Summary
protected  org.jclouds.logging.Logger logger
           
 
Constructor Summary
BlockUntilInitScriptStatusIsZeroThenReturnOutput(com.google.common.util.concurrent.ListeningExecutorService userExecutor, com.google.common.eventbus.EventBus eventBus, ComputeServiceConstants.InitStatusProperties properties, SudoAwareInitManager commandRunner)
           
BlockUntilInitScriptStatusIsZeroThenReturnOutput(com.google.common.util.concurrent.ListeningExecutorService userExecutor, com.google.common.eventbus.EventBus eventBus, com.google.common.base.Predicate<String> notRunningAnymore, SudoAwareInitManager commandRunner)
           
 
Method Summary
 boolean equals(Object o)
           
 ExecResponse get(long timeout, TimeUnit unit)
           
 SudoAwareInitManager getCommandRunner()
           
 int hashCode()
           
 BlockUntilInitScriptStatusIsZeroThenReturnOutput init()
          Submits a thread that will either set the result of the future or the exception that took place
protected  void interruptTask()
           
 void run()
           
protected  boolean set(ExecResponse value)
           
 String toString()
           
 
Methods inherited from class com.google.common.util.concurrent.AbstractFuture
addListener, cancel, get, isCancelled, isDone, setException, wasInterrupted
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected org.jclouds.logging.Logger logger
Constructor Detail

BlockUntilInitScriptStatusIsZeroThenReturnOutput

@Inject
public BlockUntilInitScriptStatusIsZeroThenReturnOutput(com.google.common.util.concurrent.ListeningExecutorService userExecutor,
                                                               com.google.common.eventbus.EventBus eventBus,
                                                               ComputeServiceConstants.InitStatusProperties properties,
                                                               SudoAwareInitManager commandRunner)

BlockUntilInitScriptStatusIsZeroThenReturnOutput

public BlockUntilInitScriptStatusIsZeroThenReturnOutput(com.google.common.util.concurrent.ListeningExecutorService userExecutor,
                                                        com.google.common.eventbus.EventBus eventBus,
                                                        com.google.common.base.Predicate<String> notRunningAnymore,
                                                        SudoAwareInitManager commandRunner)
Method Detail

getCommandRunner

public SudoAwareInitManager getCommandRunner()

init

public BlockUntilInitScriptStatusIsZeroThenReturnOutput init()
Submits a thread that will either set the result of the future or the exception that took place


run

public void run()
Specified by:
run in interface Runnable

set

protected boolean set(ExecResponse value)
Overrides:
set in class com.google.common.util.concurrent.AbstractFuture<ExecResponse>

interruptTask

protected void interruptTask()
Overrides:
interruptTask in class com.google.common.util.concurrent.AbstractFuture<ExecResponse>

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

get

public ExecResponse get(long timeout,
                        TimeUnit unit)
                 throws InterruptedException,
                        TimeoutException,
                        ExecutionException
Specified by:
get in interface Future<ExecResponse>
Overrides:
get in class com.google.common.util.concurrent.AbstractFuture<ExecResponse>
Throws:
InterruptedException
TimeoutException
ExecutionException


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.