diff --git a/common/source/java/ch/systemsx/cisd/common/jython/evaluator/Evaluator.java b/common/source/java/ch/systemsx/cisd/common/jython/evaluator/Evaluator.java index 08ea16c97a00a0a5b56444bb46367d0d74220c88..3a8afd67924beb6ce7d88aee3990b163671acefd 100644 --- a/common/source/java/ch/systemsx/cisd/common/jython/evaluator/Evaluator.java +++ b/common/source/java/ch/systemsx/cisd/common/jython/evaluator/Evaluator.java @@ -16,8 +16,6 @@ package ch.systemsx.cisd.common.jython.evaluator; -import ch.systemsx.cisd.common.jython.IJythonInterpreterFactory; - /** * @author Jakub Straszewski */ @@ -32,7 +30,6 @@ public class Evaluator } private static IJythonEvaluatorFactory factory; - private static IJythonInterpreterFactory interpreterFactory; static void setFactory(IJythonEvaluatorFactory factory) { @@ -44,33 +41,13 @@ public class Evaluator if (factory == null) { // we should make sure that the initialization happens before first call to this method - throw createException("evaluators"); + throw new IllegalStateException( + "Jython evaluator component not initialized. Application context is not initialized properly " + + "- JythonEvaluatorSpringComponent must be initialized before jython evaluators are used."); } return factory; } - static void setInterpreterFactory(IJythonInterpreterFactory interpreterFactory) - { - Evaluator.interpreterFactory = interpreterFactory; - } - - public static IJythonInterpreterFactory getInterpreterFactory() - { - if (interpreterFactory == null) - { - // we should make sure that the initialization happens before first call to this method - throw createException("interpreters"); - } - return interpreterFactory; - } - - private static IllegalStateException createException(String type) - { - return new IllegalStateException( - "Jython evaluator component not initialized. Application context is not initialized properly " - + "- JythonEvaluatorSpringComponent must be initialized before jython " + type + " are used."); - } - public static boolean isMultiline(String expression) { return expression.indexOf('\n') >= 0; diff --git a/common/source/java/ch/systemsx/cisd/common/jython/evaluator/JythonEvaluatorSpringComponent.java b/common/source/java/ch/systemsx/cisd/common/jython/evaluator/JythonEvaluatorSpringComponent.java index f698150a9222c78c5c867df6cfd7dfc88e4fbed5..85a3dbabfca2d91461f73a11396f530b0c91607f 100644 --- a/common/source/java/ch/systemsx/cisd/common/jython/evaluator/JythonEvaluatorSpringComponent.java +++ b/common/source/java/ch/systemsx/cisd/common/jython/evaluator/JythonEvaluatorSpringComponent.java @@ -21,9 +21,7 @@ import org.springframework.beans.factory.BeanInitializationException; import ch.rinn.restrictions.Private; import ch.systemsx.cisd.common.jython.v25.Jython25EvaluatorFactory; -import ch.systemsx.cisd.common.jython.v25.Jython25InterpreterFactory; import ch.systemsx.cisd.common.jython.v27.Jython27EvaluatorFactory; -import ch.systemsx.cisd.common.jython.v27.Jython27InterpreterFactory; import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogFactory; import ch.systemsx.cisd.common.spring.ExposablePropertyPlaceholderConfigurer; @@ -44,11 +42,9 @@ public class JythonEvaluatorSpringComponent if ("2.7".equals(jythonVersion)) { Evaluator.setFactory(new Jython27EvaluatorFactory()); - Evaluator.setInterpreterFactory(new Jython27InterpreterFactory()); } else if ("2.5".equals(jythonVersion)) { Evaluator.setFactory(new Jython25EvaluatorFactory()); - Evaluator.setInterpreterFactory(new Jython25InterpreterFactory()); } else { String msg =