GNDMS 0.6.0
RESTful verison of GNDMS
|
Inherits de::zib::gndms::logic::model::gorfx::taskflow::TaskFlowFactory< O, C >.
Classes | |
class | CreatableTaskFlow< O extends Order > |
Public Member Functions | |
String | getTaskFlowKey () |
int | getVersion () |
C | getQuoteCalculator () |
TaskFlowInfo | getInfo () |
TaskFlow< O > | create () |
TaskFlow< O > | createOrphan () |
boolean | adopt (TaskFlow< O > taskflow) |
TaskFlow< O > | find (String id) |
void | delete (String id) |
Class< O > | getOrderClass () |
void | registerType (Session session) |
Iterable< String > | depends () |
DelegatingOrder< O > | getOrderDelegate (O order) |
GNDMSInjector | getInjector () |
void | setInjector (final GNDMSInjector injector) |
Public Attributes | |
final int | MAX_CACHE_SIZE = 10000 |
Protected Member Functions | |
DefaultTaskFlowFactory (String taskFlowKey, Class< C > calculatorClass, Class< O > orderClass) | |
abstract TaskFlow< O > | prepare (TaskFlow< O > taskFlow) |
Applies taskFlow specific stuff a newly created taskFlow instance. | |
void | setupTaskFlowType (TaskFlowType taskFlowType) |
Initial configuration of the taskflowType. | |
abstract Map< String, String > | getDefaultConfig () |
Implementing classes should provide a useful default config. | |
void | injectMembers (Object newInstance) |
Protected Attributes | |
Logger | logger = LoggerFactory.getLogger( this.getClass() ) |
Private Attributes | |
String | taskFlowKey |
GNDMSInjector | injector |
Class< C > | calculatorClass |
Class< O > | orderClass |
final Dao< String, TaskFlow< O > , Void > | taskFlows |
abstract Map<String,String> de.zib.gndms.logic.model.gorfx.taskflow.DefaultTaskFlowFactory< O extends Order, C extends AbstractQuoteCalculator< O > >.getDefaultConfig | ( | ) | [protected, pure virtual] |
Implementing classes should provide a useful default config.
abstract TaskFlow<O> de.zib.gndms.logic.model.gorfx.taskflow.DefaultTaskFlowFactory< O extends Order, C extends AbstractQuoteCalculator< O > >.prepare | ( | TaskFlow< O > | taskFlow | ) | [protected, pure virtual] |
Applies taskFlow specific stuff a newly created taskFlow instance.
Stuff is usually the injection of required handlers and the like.
taskFlow | A newly created taskflow. |
void de.zib.gndms.logic.model.gorfx.taskflow.DefaultTaskFlowFactory< O extends Order, C extends AbstractQuoteCalculator< O > >.setupTaskFlowType | ( | TaskFlowType | taskFlowType | ) | [protected] |
Initial configuration of the taskflowType.
Override this method to customize the taskflowType, default setup is fine in most cases.
taskFlowType | A newly created instance of the taskflowtype |
{ taskFlowType.setTaskFlowTypeKey( this.getTaskFlowKey() ); taskFlowType.setVersion( getVersion() ); taskFlowType.setCalculatorFactoryClassName( this.getClass().getName() ); taskFlowType.setTaskActionFactoryClassName( this.getClass().getName() ); taskFlowType.setConfigMapData( getDefaultConfig() ); }
final Dao<String, TaskFlow<O>, Void> de.zib.gndms.logic.model.gorfx.taskflow.DefaultTaskFlowFactory< O extends Order, C extends AbstractQuoteCalculator< O > >.taskFlows [private] |
new TransientDao<String, TaskFlow<O>, Void>() { { setModels( (Cache<String,TaskFlow<O>>) (Object) CacheBuilder.newBuilder() .expireAfterAccess( 12, TimeUnit.HOURS ) .maximumSize( MAX_CACHE_SIZE ) .initialCapacity( 100 ) .build( new CacheLoader<String, TaskFlow<O>>() { @Override public TaskFlow<O> load( String key ) throws Exception { DefaultTaskFlowFactory.this.logger.trace( "load: "+ key ); return new CreatableTaskFlow<O>( key ); } } ) ); } @Override public String create() { String id = UUID.randomUUID().toString(); cacheGet( id ); return id; } }