org.neovera.jdiablo.environment
Class SpringEnvironment

java.lang.Object
  extended by org.neovera.jdiablo.AbstractEnvironment
      extended by org.neovera.jdiablo.environment.SpringEnvironment
All Implemented Interfaces:
Environment

public class SpringEnvironment
extends AbstractEnvironment

Bootstraps Spring and provides option values who's fields are annotated with PropertyPlaceholder (provided there is a bean of the type PropertyPlaceholderProvider in Spring). If your context has an instance of AutowiredAnnotationBeanPostProcessor all fields marked with the @Inject annotation are automatically set. In addition, if the Launchable class implements the BeanFactoryAware interface, the bean factory is also set.


Constructor Summary
SpringEnvironment()
           
 
Method Summary
 String[] getSpringContextFiles()
           
 void initialize(Environment environment, List<? extends OptionProperty> properties)
          This method is called after the start() of this environment.
 void initialize(Object target, List<? extends OptionProperty> properties)
          Called after the start() of this environment.
 void setSpringContextFiles(String[] springContextFiles)
           
 boolean start()
          Start the environment.
 void stop()
          Stop the environment.
 
Methods inherited from class org.neovera.jdiablo.AbstractEnvironment
initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringEnvironment

public SpringEnvironment()
Method Detail

getSpringContextFiles

public String[] getSpringContextFiles()

setSpringContextFiles

public void setSpringContextFiles(String[] springContextFiles)

start

public boolean start()
Description copied from interface: Environment
Start the environment. Any exception thrown will cause target execution to abort and stop to be called.

Specified by:
start in interface Environment
Overrides:
start in class AbstractEnvironment
Returns:
true to continue to next environment, false to stop all environments and abort launch.

stop

public void stop()
Description copied from interface: Environment
Stop the environment.

Specified by:
stop in interface Environment
Overrides:
stop in class AbstractEnvironment

initialize

public void initialize(Environment environment,
                       List<? extends OptionProperty> properties)
Description copied from interface: Environment
This method is called after the start() of this environment. It is called for each environment that is registered - those that have already been initialized and those that are yet to be initialized. In a chained execution, this is called again when each environment is restarted and new ones are started.

Specified by:
initialize in interface Environment
Overrides:
initialize in class AbstractEnvironment
Parameters:
environment - Launch environment instance.
properties - Annotated properties for this environment. NOTE: A property that is annotated will not appear in this list if the option was defined during specialization. The isValueInCommandLine() will return true if the value was specified (and set) via command line.

initialize

public void initialize(Object target,
                       List<? extends OptionProperty> properties)
Description copied from interface: Environment
Called after the start() of this environment.

Specified by:
initialize in interface Environment
Overrides:
initialize in class AbstractEnvironment
Parameters:
target - The target of the launch.
properties - Annotated properties for the launch target.


Copyright © 2014 Neovera Inc.. All rights reserved.