org.neovera.jdiablo
Class BuilderFactory

java.lang.Object
  extended by org.neovera.jdiablo.BuilderFactory

public class BuilderFactory
extends Object

This class allows you to start the Diablo CLI "building" process. The BuilderFactory creates a TargetBuilder. The TargetBuilder accepts the Launchable target to execute and returns an EnvironmentBuilder. The EnvironmentBuilder provides hooks to specialize Environments (such as Spring) and then provides a handle to the Executor for starting the execution.


Constructor Summary
BuilderFactory()
           
 
Method Summary
<E extends Environment>
void
add(Class<E> clz, Specialization<E> specialization)
          Use this method to add specializations for a particular environment as part of the environment builder.
 TargetBuilder create()
          Creates a TargetBuilder without any passed in command-line arguments.
 TargetBuilder create(String[] args)
          Factory method to create a target builder passing in the command line arguments.
 Map<Class<? extends Environment>,Environment> getSpecializations()
          Ideally this method would be "module" scoped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuilderFactory

public BuilderFactory()
Method Detail

create

public TargetBuilder create(String[] args)
Factory method to create a target builder passing in the command line arguments.

Parameters:
args - Command line arguments from main() as-is.
Returns:
New TargetBuilder instance

create

public TargetBuilder create()
Creates a TargetBuilder without any passed in command-line arguments.

Returns:
New TargetBuilder instance

add

public <E extends Environment> void add(Class<E> clz,
                                        Specialization<E> specialization)
Use this method to add specializations for a particular environment as part of the environment builder. This allows specialized subclasses of BuilderFactory to introduce specializations that can be applied across the board. Note, specializations apply only to new instances of an environment.

Type Parameters:
E - Environment type
Parameters:
clz - Environment's class
specialization - Specialization implementation for the environment.

getSpecializations

public Map<Class<? extends Environment>,Environment> getSpecializations()
Ideally this method would be "module" scoped. There is no reason for client code to access specialized environments.

Returns:
The environment specializations map.


Copyright © 2014 Neovera Inc.. All rights reserved.