org.marketcetera.strategy
Class JavaCompilerExecutionEngine

java.lang.Object
  extended by org.marketcetera.strategy.JavaCompilerExecutionEngine
All Implemented Interfaces:
Messages

public class JavaCompilerExecutionEngine
extends Object
implements Messages

Executes a Java strategy using the Java Compiler API.

Since:
1.0.0
Version:
$Id: JavaCompilerExecutionEngine.java 16154 2012-07-14 16:34:05Z colin $
Author:
Colin DuPlantis

Field Summary
static String CLASSPATH_KEY
          System properties key to set to inform the Java compiler of dependencies it should include on the classpath for compiling Java strategies
 
Fields inherited from interface org.marketcetera.strategy.Messages
BEAN_ATTRIBUTE_CHANGED, CALLBACK_ERROR, CANCEL_REQUEST_SUBMITTED, CANCELING_ALL_DATA_REQUESTS, CANCELING_DATA_REQUEST, CANNOT_CHANGE_STATE, CANNOT_CREATE_CONNECTION, CANNOT_REQUEST_DATA, CANNOT_RETRIEVE_BROKERS, CANNOT_RETRIEVE_EQUITY_POSITION, CANNOT_RETRIEVE_FUTURE_POSITION, CANNOT_RETRIEVE_OPTION_POSITION, CANNOT_RETRIEVE_OPTION_ROOTS, CANNOT_RETRIEVE_POSITIONS, CANNOT_RETRIEVE_POSITIONS_BY_OPTION_ROOTS, CANNOT_RETRIEVE_UNDERLYING, CANNOT_SEND_DATA, CANNOT_SEND_EVENT_TO_CEP, CEP_REQUEST_FAILED, COMBINED_DATA_REQUEST_FAILED, COMPILATION_FAILED, COMPILATION_FAILED_DIAGNOSTIC, DATA_REQUEST_CANCEL_FAILED, DATA_REQUEST_FAILED, EMPTY_INSTANCE_ERROR, EMPTY_NAME_ERROR, ERROR_CONVERTING_CLASSPATH_URL, EXECUTING_CALLBACK, EXECUTION_REPORT_REQUEST_FAILED, EXECUTION_REPORTS_FOUND, FAILED_TO_RETRIEVE_USER_DATA, FAILED_TO_SET_USER_DATA, FAILED_TO_START, FILE_DOES_NOT_EXIST_OR_IS_NOT_READABLE, INVALID_CANCEL, INVALID_CEP_REQUEST, INVALID_COMBINED_DATA_REQUEST, INVALID_DATA, INVALID_DATA_REQUEST, INVALID_DATA_REQUEST_CANCEL, INVALID_EQUITY_POSITION_REQUEST, INVALID_EVENT, INVALID_EVENT_TO_CEP, INVALID_FUTURE_POSITION_REQUEST, INVALID_LANGUAGE_ERROR, INVALID_LOG, INVALID_MARKET_DATA_REQUEST, INVALID_MESSAGE, INVALID_NOTIFICATION, INVALID_OPTION_POSITION_REQUEST, INVALID_OPTION_ROOTS_REQUEST, INVALID_ORDER, INVALID_ORDERID, INVALID_POSITIONS_BY_OPTION_ROOTS_REQUEST, INVALID_POSITIONS_REQUEST, INVALID_REPLACEMENT_ORDER, INVALID_STATUS_TO_RECEIVE_DATA, INVALID_STRATEGY_NAME, INVALID_TRADE_SUGGESTION, INVALID_UNDERLYING_REQUEST, LOGGER, MARKET_DATA_REQUEST_FAILED, MESSAGE_1P, MISSING_JAVA_COMPILER, NO_DATA_HANDLE, NO_EXECUTION_REPORT, NO_ORDER_ID, NO_PARAMETERS, NO_STRATEGY_CLASS, NO_SUPPORT_FOR_LANGUAGE, NULL_ORDER, NULL_ORDER_ID, NULL_PARAMETER_ERROR, NULL_PROPERTY_KEY, NULL_REPORT, ORDER_CANCEL_FAILED, ORDER_VALIDATION_FAILED, PARAMETER_COUNT_ERROR, PARAMETER_TYPE_ERROR, PROVIDER, PROVIDER_DESCRIPTION, RECEIVED_BROKERS, RECEIVED_OPTION_ROOTS, RECEIVED_POSITION, RECEIVED_POSITIONS, RECEIVED_UNDERLYING, RUNTIME_ERROR, SEND_MESSAGE_FAILED, STATUS_CHANGED, STOP_ERROR, STRATEGY_COMPILATION_NULL_RESULT, STRATEGY_NOT_READY_TO_RECEIVE_DATA, SUBMITTING_CANCEL_ALL_ORDERS_REQUEST, SUBMITTING_CANCEL_ORDER_REQUEST, SUBMITTING_CANCEL_REPLACE_REQUEST, SUBMITTING_CEP_REQUEST, SUBMITTING_EVENT_TO_CEP, SUBMITTING_FIX_MESSAGE, SUBMITTING_MARKET_DATA_REQUEST, SUBMITTING_ORDER, SUBMITTING_OTHER, SUBMITTING_PROCESSED_MARKET_DATA_REQUEST, SUBMITTING_TRADE_SUGGESTION, UNABLE_TO_CANCEL_DATA_REQUEST, UNKNOWN_ORDER_TYPE, USING_EXECUTION_REPORT, USING_ORDER_HISTORY_ORIGIN, WRONG_DIVIDEND_EQUITY_FOR_OPTION_CHAIN, WRONG_EQUITY_FOR_OPTION_CHAIN, WRONG_UNDERLYING_FOR_OPTION_CHAIN
 
Constructor Summary
JavaCompilerExecutionEngine()
           
 
Method Summary
 void prepare(Strategy inStrategy, String inProcessedScript)
          Prepares the ExecutionEngine to execute the given Strategy.
 Object start()
          Starts the execution of the Strategy.
 void stop()
          Stops the execution of the Strategy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSPATH_KEY

public static final String CLASSPATH_KEY
System properties key to set to inform the Java compiler of dependencies it should include on the classpath for compiling Java strategies

See Also:
Constant Field Values
Constructor Detail

JavaCompilerExecutionEngine

public JavaCompilerExecutionEngine()
Method Detail

prepare

public void prepare(Strategy inStrategy,
                    String inProcessedScript)
             throws StrategyException
Prepares the ExecutionEngine to execute the given Strategy.

Parameters:
inStrategy - a Strategy value
inProcessedScript - a String value containing the actual text of the strategy to execute
Throws:
StrategyException - if an error occurs

start

public Object start()
             throws StrategyException
Starts the execution of the Strategy.

Returns:
an Object containing a reference to the Strategy being executed
Throws:
StrategyException - if an error occurs

stop

public void stop()
          throws StrategyException
Stops the execution of the Strategy.

Throws:
StrategyException - if an error occurs


Copyright © 2012. All Rights Reserved.