/* (non-Javadoc) * @see org.marketcetera.strategy.ExecutionEngine#prepare(org.marketcetera.strategy.Strategy, java.lang.String) */ @Override public void prepare(Strategy inStrategy, String inProcessedScript) throws StrategyException { strategy = inStrategy; processedScript = inProcessedScript; SLF4JLoggerProxy.debug( this, "Preparing {}", //$NON-NLS-1$ inStrategy); registerScriptEngines(); String languageString = inStrategy.getLanguage().name(); try { synchronized (scriptManager) { if (scriptEngine == null) { String classpath = System.getProperty(Strategy.CLASSPATH_PROPERTYNAME); SLF4JLoggerProxy.debug( this, "Setting classpath to {}", //$NON-NLS-1$ classpath); scriptManager.setClassPath(classpath); scriptEngine = scriptManager.loadScriptingEngine(languageString); SLF4JLoggerProxy.debug(this, "Initializing engine..."); // $NON-NLS-1$ scriptEngine.initialize(scriptManager, languageString, new Vector<Object>()); } else { SLF4JLoggerProxy.debug(this, "Reusing intialized engine..."); // $NON-NLS-1$ } } } catch (BSFException e) { StrategyModule.log( LogEventBuilder.error() .withMessage(NO_SUPPORT_FOR_LANGUAGE, languageString) .withException(e) .create(), strategy); throw new StrategyException( e, new I18NBoundMessage1P(NO_SUPPORT_FOR_LANGUAGE, languageString)); } }