GNDMS 0.6.0
RESTful verison of GNDMS
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes

de.zib.gndms.logic.model.gorfx.taskflow.DefaultTaskFlowFactory< O extends Order, C extends AbstractQuoteCalculator< O > > Class Reference

Inherits de::zib::gndms::logic::model::gorfx::taskflow::TaskFlowFactory< O, C >.

List of all members.

Classes

class  CreatableTaskFlow< O extends Order >

Public Member Functions

String getTaskFlowKey ()
int getVersion ()
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

Detailed Description

Author:
Maik Jorra jorra@zib.de
Date:
20.07.11 16:33

Member Function Documentation

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.

Returns:
The default configuration of the map.
Note:
This method is only called when the factory is created for the first time, even after a shutdown it won't be called again. Except a change of the version number of this factory.
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.

Parameters:
taskFlowA newly created taskflow.
Returns:
The prepared in-parameter.
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.

Parameters:
taskFlowTypeA newly created instance of the taskflowtype
Note:
This method is only called when the factory is created for the first time, even after a shutdown it won't be called again. Except a change of the version number of this factory.
                                                                   {

        taskFlowType.setTaskFlowTypeKey( this.getTaskFlowKey() );
        taskFlowType.setVersion( getVersion() );
        taskFlowType.setCalculatorFactoryClassName( this.getClass().getName() );
        taskFlowType.setTaskActionFactoryClassName( this.getClass().getName() );
        taskFlowType.setConfigMapData( getDefaultConfig() );
    }

Member Data Documentation

final Dao<String, TaskFlow<O>, Void> de.zib.gndms.logic.model.gorfx.taskflow.DefaultTaskFlowFactory< O extends Order, C extends AbstractQuoteCalculator< O > >.taskFlows [private]
Initial value:
 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;
        }
    }

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables