edu.ksu.cis.projects.bogor.module
Class DefaultTransformer

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.module.DefaultTransformer
All Implemented Interfaces:
ISelfDescribingModule, IModule, ITransformer, Disposable

public class DefaultTransformer
extends Object
implements ITransformer, ISelfDescribingModule

Version:
CVS $Revision: 1.27 $ $Date: 2005/05/26 18:23:13 $
Author:
Robby , Matt Hoosier

Field Summary
protected static String ARITHMETIC_EXCEPTION_ID
           
protected  String arithmeticException
           
protected static String ARRAY_BOUNDS_EXCEPTION_ID
           
protected  String arrayBoundsException
           
protected  IActionTaker at
           
protected  IBacktrackingInfoFactory bif
           
protected static String CAST_EXCEPTION_ID
           
protected  String castException
           
protected  IExpEvaluator ee
           
protected  String illFormedBogorModelException
           
protected static String MONITOR_EXCEPTION_ID
           
protected  String monitorException
           
protected static String NULL_EXCEPTION_ID
           
protected  String nullException
           
protected  ISchedulingStrategist ss
           
protected  ISchedulingStrategyContext ssc
           
protected  SymbolTable symbolTable
           
protected  ITransformer tr
           
protected static String USE_LIVE_ID
           
protected  boolean useLive
           
protected  IValueFactory vf
           
 
Constructor Summary
DefaultTransformer()
           
 
Method Summary
protected  void addAll(ArrayList<IBacktrackingInfo> result, IBacktrackingInfo[] bis)
           
 IMessageStore connect(IBogorConfiguration bc)
          Connects this modules to other modules.
 void dispose()
          Remove references.
 String getCopyrightNotice()
          Returns the copyright notice for this module.
protected  FSMSymbolTable getFSMSymbolTable(IState state, int threadId)
           
 Pair<Domain,Boolean> getOptionDomain(String id)
           
 Collection<Triple<String,Boolean,OptionScope>> getOptionIds()
           
 Collection<String> getSuggestedValues(String id, IBogorConfiguration bc, SymbolTable st)
           
protected  ExceptionThrownBogorException resolveThrowable(BogorException mce)
           
 IMessageStore setOptions(String key, Properties configuration)
          Sets the options for this module.
 void setSchedulingStrategyContext(ISchedulingStrategyContext ssc)
           
protected  IBacktrackingInfo[] toArray(ArrayList<IBacktrackingInfo> backtrackingInfos)
           
 IBacktrackingInfo[] transform(ISchedulingStrategyContext ssc, BlockTransformation t, Action a)
           
 IBacktrackingInfo[] transform(ISchedulingStrategyContext ssc, InvokeTransformation t, boolean returned, IValue returnValue)
           
 IBacktrackingInfo[] transformEnter(InvokeTransformation t)
           
protected  boolean transformException(Transformation t, ArrayList<IBacktrackingInfo> result)
           
 IBacktrackingInfo[] transformExit(InvokeTransformation t, IValue returnValue)
           
protected  IBacktrackingInfo[] transformNextState(NextState ns, Transformation t)
           
 void unsetSchedulingStrategyContext()
           
 boolean validate(String id, String value, IBogorConfiguration bc, SymbolTable st, Collection<FileMessage> errors)
          Checks whether the value of a configuration option is legal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USE_LIVE_ID

protected static final String USE_LIVE_ID
See Also:
Constant Field Values

ARITHMETIC_EXCEPTION_ID

protected static final String ARITHMETIC_EXCEPTION_ID
See Also:
Constant Field Values

MONITOR_EXCEPTION_ID

protected static final String MONITOR_EXCEPTION_ID
See Also:
Constant Field Values

CAST_EXCEPTION_ID

protected static final String CAST_EXCEPTION_ID
See Also:
Constant Field Values

ARRAY_BOUNDS_EXCEPTION_ID

protected static final String ARRAY_BOUNDS_EXCEPTION_ID
See Also:
Constant Field Values

NULL_EXCEPTION_ID

protected static final String NULL_EXCEPTION_ID
See Also:
Constant Field Values

useLive

protected boolean useLive

arithmeticException

protected String arithmeticException

monitorException

protected String monitorException

castException

protected String castException

arrayBoundsException

protected String arrayBoundsException

nullException

protected String nullException

illFormedBogorModelException

protected String illFormedBogorModelException

tr

protected ITransformer tr

at

protected IActionTaker at

bif

protected IBacktrackingInfoFactory bif

ee

protected IExpEvaluator ee

ss

protected ISchedulingStrategist ss

vf

protected IValueFactory vf

symbolTable

protected SymbolTable symbolTable

ssc

protected ISchedulingStrategyContext ssc
Constructor Detail

DefaultTransformer

public DefaultTransformer()
Method Detail

getCopyrightNotice

public String getCopyrightNotice()
Description copied from interface: IModule
Returns the copyright notice for this module.

Specified by:
getCopyrightNotice in interface IModule
Returns:
The copyright notice for this module. Returns null if no additional notice is necessary.

setOptions

public IMessageStore setOptions(String key,
                                Properties configuration)
Description copied from interface: IModule
Sets the options for this module.

Specified by:
setOptions in interface IModule
Parameters:
key - The key (prefix) for this module options. Must be non-null. The key is used for module specific options.
configuration - The options for all modules. Must be non-null.

setSchedulingStrategyContext

public void setSchedulingStrategyContext(ISchedulingStrategyContext ssc)
Specified by:
setSchedulingStrategyContext in interface ITransformer

connect

public IMessageStore connect(IBogorConfiguration bc)
Description copied from interface: IModule
Connects this modules to other modules.

Specified by:
connect in interface IModule
Parameters:
bc - The Bogor configuration containing modules to connect to. Must be non-null.

dispose

public void dispose()
Description copied from interface: Disposable
Remove references. Once called, avoid using this object.

Specified by:
dispose in interface Disposable

transform

public IBacktrackingInfo[] transform(ISchedulingStrategyContext ssc,
                                     BlockTransformation t,
                                     Action a)
Specified by:
transform in interface ITransformer

transform

public IBacktrackingInfo[] transform(ISchedulingStrategyContext ssc,
                                     InvokeTransformation t,
                                     boolean returned,
                                     IValue returnValue)
Specified by:
transform in interface ITransformer

transformEnter

public IBacktrackingInfo[] transformEnter(InvokeTransformation t)
Specified by:
transformEnter in interface ITransformer

transformExit

public IBacktrackingInfo[] transformExit(InvokeTransformation t,
                                         IValue returnValue)
Specified by:
transformExit in interface ITransformer

unsetSchedulingStrategyContext

public void unsetSchedulingStrategyContext()
Specified by:
unsetSchedulingStrategyContext in interface ITransformer

getFSMSymbolTable

protected FSMSymbolTable getFSMSymbolTable(IState state,
                                           int threadId)

addAll

protected void addAll(ArrayList<IBacktrackingInfo> result,
                      IBacktrackingInfo[] bis)

resolveThrowable

protected ExceptionThrownBogorException resolveThrowable(BogorException mce)

toArray

protected IBacktrackingInfo[] toArray(ArrayList<IBacktrackingInfo> backtrackingInfos)

transformException

protected boolean transformException(Transformation t,
                                     ArrayList<IBacktrackingInfo> result)

transformNextState

protected IBacktrackingInfo[] transformNextState(NextState ns,
                                                 Transformation t)

getOptionIds

public Collection<Triple<String,Boolean,OptionScope>> getOptionIds()
Specified by:
getOptionIds in interface ISelfDescribingModule
Returns:
a set of tuples whose first element says the name of the option, and whose second element says whether the option is required, and whose third element says whether the option is private to this module (and thus prefixed by the interface implemented, e.g., edu.ksu.cis.projects.bogor.module.ISearcher) or global in scope (and thus no qualifier is prepended).

getOptionDomain

public Pair<Domain,Boolean> getOptionDomain(String id)
Specified by:
getOptionDomain in interface ISelfDescribingModule
Parameters:
id -
Returns:

getSuggestedValues

public Collection<String> getSuggestedValues(String id,
                                             IBogorConfiguration bc,
                                             SymbolTable st)
Specified by:
getSuggestedValues in interface ISelfDescribingModule
Parameters:
id -
bc -
st -
Returns:

validate

public boolean validate(String id,
                        String value,
                        IBogorConfiguration bc,
                        SymbolTable st,
                        Collection<FileMessage> errors)
Description copied from interface: ISelfDescribingModule
Checks whether the value of a configuration option is legal.

Specified by:
validate in interface ISelfDescribingModule
Parameters:
id -
value -
bc -
st -
errors -
Returns: