uk.co.grahamcox.spring.cli
Class CliRunner

java.lang.Object
  extended by uk.co.grahamcox.spring.cli.CliRunner

public class CliRunner
extends Object

The actual runner that does the work. This is seperated out from MainClass for unit testing purposes

Author:
graham

Constructor Summary
CliRunner()
           
 
Method Summary
 void addProperties(Properties properties)
          Add a properties file to use
 void run()
          Actually run the app.
 void setArguments(String[] args)
          Set the application arguments to use
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CliRunner

public CliRunner()
Method Detail

addProperties

public void addProperties(Properties properties)
Add a properties file to use

Parameters:
properties - the properties file to add

setArguments

public void setArguments(String[] args)
Set the application arguments to use

Parameters:
args - the arguments

run

public void run()
Actually run the app. This works through the Properties that have been supplied to find the spring context files to be used, then builds a Spring Context using them. The Context is pre-seeded with a special bean called "arguments" that is a list of the application arguments supplied, and then a special bean is requested from the context - the bean with the name specified in the property "runner", or the bean called "runner" as a default - and the run() method on this bean is called.



Copyright © 2011. All Rights Reserved.