Package org.intocps.maestro.interpreter
Class DefaultExternalValueFactory
- java.lang.Object
-
- org.intocps.maestro.interpreter.DefaultExternalValueFactory
-
- All Implemented Interfaces:
IExternalValueFactory
public class DefaultExternalValueFactory extends java.lang.Object implements IExternalValueFactory
Default interpreter factory with framework support and other basic features. This class provides run-time support only. It creates and destroys certain types based on load and unload
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,IValueLifecycleHandler>lifecycleHandlersprotected java.util.Map<Value,IValueLifecycleHandler>values
-
Constructor Summary
Constructors Constructor Description DefaultExternalValueFactory(java.io.File workingDirectory, java.io.InputStream config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.spencerwi.either.Either<java.lang.Exception,Value>create(java.lang.String loaderName, java.util.List<Value> args)Creates a new interpreter value for the specified type using the supplied argumentsValuedestroy(Value value)Destruction of values created by the factory.booleansupports(java.lang.String type)Check if a certain type is supported by the external value factory
-
-
-
Field Detail
-
lifecycleHandlers
protected java.util.Map<java.lang.String,IValueLifecycleHandler> lifecycleHandlers
-
values
protected java.util.Map<Value,IValueLifecycleHandler> values
-
-
Constructor Detail
-
DefaultExternalValueFactory
public DefaultExternalValueFactory(java.io.File workingDirectory, java.io.InputStream config) throws java.io.IOException, java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException- Throws:
java.io.IOExceptionjava.lang.NoSuchMethodExceptionjava.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.InstantiationException
-
-
Method Detail
-
supports
public boolean supports(java.lang.String type) throws java.lang.ExceptionDescription copied from interface:IExternalValueFactoryCheck if a certain type is supported by the external value factory- Specified by:
supportsin interfaceIExternalValueFactory- Returns:
- true if the type is supported by
IExternalValueFactory.create(String, List) - Throws:
java.lang.Exception
-
create
public com.spencerwi.either.Either<java.lang.Exception,Value> create(java.lang.String loaderName, java.util.List<Value> args)
Description copied from interface:IExternalValueFactoryCreates a new interpreter value for the specified type using the supplied arguments- Specified by:
createin interfaceIExternalValueFactory- Parameters:
loaderName- the type to createargs- the arguments used to create the value- Returns:
- the value or an exception if creation fails
-
destroy
public Value destroy(Value value)
Description copied from interface:IExternalValueFactoryDestruction of values created by the factory. Destruction must make sure all resources hold by this value is freed- Specified by:
destroyin interfaceIExternalValueFactory- Parameters:
value- the value to destroy- Returns:
- void return
-
-