Spring for Apache Hadoop

org.springframework.yarn.boot.support
Class CommandLineRunnerSupport

java.lang.Object
  extended by org.springframework.yarn.boot.support.CommandLineRunnerSupport
All Implemented Interfaces:
org.springframework.core.Ordered
Direct Known Subclasses:
AppmasterLauncherRunner

public abstract class CommandLineRunnerSupport
extends java.lang.Object
implements org.springframework.core.Ordered

Base support class for CommandLineRunner implementations.

Author:
Janne Valkealahti

Field Summary
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
CommandLineRunnerSupport()
           
 
Method Summary
protected  void countDownLatch()
          Count down current latch by one.
 void exit(int status)
          Exit method wrapping handling through SystemExiter.
 void exit(java.lang.String status)
          Exit method wrapping handling through SystemExiter.
 ExitCodeMapper getExitCodeMapper()
          Gets the exit code mapper.
 int getOrder()
           
 boolean isWaitLatch()
          Checks if is wait latch.
 void setExitCodeMapper(ExitCodeMapper exitCodeMapper)
          Sets the exit code mapper.
 void setOrder(int order)
          Sets the order used forOrdered.
 void setWaitLatch(boolean waitLatch)
          Sets the wait latch.
protected  void waitLatch()
          Simply delegates to CountDownLatch.await().
protected  void waitLatch(long timeout, java.util.concurrent.TimeUnit unit)
          Simply delegates to CountDownLatch.await(long, TimeUnit).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandLineRunnerSupport

public CommandLineRunnerSupport()
Method Detail

getOrder

public int getOrder()
Specified by:
getOrder in interface org.springframework.core.Ordered

setOrder

public void setOrder(int order)
Sets the order used forOrdered. The order used in this class is Ordered.HIGHEST_PRECEDENCE.

Parameters:
order - the new order

exit

public void exit(int status)
Exit method wrapping handling through SystemExiter.

Parameters:
status - the exit code

exit

public void exit(java.lang.String status)
Exit method wrapping handling through SystemExiter. As exist status for this method is given as String, status value is translated via ExitCodeMapper.

Parameters:
status - the exit code

setWaitLatch

public void setWaitLatch(boolean waitLatch)
Sets the wait latch.

Parameters:
waitLatch - the new wait latch

isWaitLatch

public boolean isWaitLatch()
Checks if is wait latch.

Returns:
true, if is wait latch

setExitCodeMapper

public void setExitCodeMapper(ExitCodeMapper exitCodeMapper)
Sets the exit code mapper.

Parameters:
exitCodeMapper - the new exit code mapper

getExitCodeMapper

public ExitCodeMapper getExitCodeMapper()
Gets the exit code mapper.

Returns:
the exit code mapper

countDownLatch

protected void countDownLatch()
Count down current latch by one.


waitLatch

protected void waitLatch()
Simply delegates to CountDownLatch.await().


waitLatch

protected void waitLatch(long timeout,
                         java.util.concurrent.TimeUnit unit)
Simply delegates to CountDownLatch.await(long, TimeUnit).

Parameters:
timeout - the timeout
unit - the unit

Spring for Apache Hadoop