org.neovera.jdiablo
Interface EnvironmentBuilder

All Known Implementing Classes:
BuilderImpl

public interface EnvironmentBuilder

This is used as part of the build process. This interface allows specialization of environments during the launch process.


Method Summary
 Executor build()
           
 EnvironmentBuilder withNewInstanceOf(Class<? extends Environment> clz)
          Use this when chaining Launchables (calling one Launchable from another) where you want a new (non-specialized or uninitialized) instance of an Environment to be used in the execution.
<E extends Environment>
EnvironmentBuilder
withSpecialization(Class<E> clz, Specialization<E> specialization)
          Allows for programmatic specialization (setting of properties) when launching.
 

Method Detail

withNewInstanceOf

EnvironmentBuilder withNewInstanceOf(Class<? extends Environment> clz)
Use this when chaining Launchables (calling one Launchable from another) where you want a new (non-specialized or uninitialized) instance of an Environment to be used in the execution. For example, when calling one launchable from another, if you want to call the second Launchable class with a different Spring context, call this method passing in SpringEnvironment class so that you can pass in a new initialization for it.

Parameters:
clz - Environment class
Returns:
Environment builder.

withSpecialization

<E extends Environment> EnvironmentBuilder withSpecialization(Class<E> clz,
                                                              Specialization<E> specialization)
Allows for programmatic specialization (setting of properties) when launching. Example: different command line processes in a project require different Spring contexts, you can plug-in the context selection in here. Of course, in the case of Spring you can also annotate the Launchable with the @SpringContext annotation or simply pass that as a command line, but the specialization hook allows for algorithmic determination of the context.

Parameters:
clz -
specialization -
Returns:
Environment

build

Executor build()
Returns:
build an executor for the above defined specs.


Copyright © 2014 Neovera Inc.. All rights reserved.