ScriptEngine.getFactory
Code IndexAdd Codota to your IDE (free)

Best code snippets using javax.script.ScriptEngine.getFactory(Showing top 15 results out of 315)

  • Common ways to obtain ScriptEngine
private void myMethod () {
ScriptEngine s =
  • ScriptEngineManager scriptEngineManager;scriptEngineManager.getEngineByName(shortName)
  • ScriptEngineFactory scriptEngineFactory;scriptEngineFactory.getScriptEngine()
  • new GremlinGroovyScriptEngine()
  • Smart code suggestions by Codota
}
origin: org.apache.logging.log4j/log4j-core

@Override
public void fileModified(final File file) {
  final ScriptRunner runner = scriptRunners.get(file.toString());
  if (runner == null) {
    logger.info("{} is not a running script");
    return;
  }
  final ScriptEngine engine = runner.getScriptEngine();
  final AbstractScript script = runner.getScript();
  if (engine.getFactory().getParameter(KEY_THREADING) == null) {
    scriptRunners.put(script.getName(), new ThreadLocalScriptRunner(script));
  } else {
    scriptRunners.put(script.getName(), new MainScriptRunner(engine, script));
  }
}
origin: org.apache.logging.log4j/log4j-core

public void addScript(final AbstractScript script) {
  final ScriptEngine engine = manager.getEngineByName(script.getLanguage());
  if (engine == null) {
    logger.error("No ScriptEngine found for language " + script.getLanguage() + ". Available languages are: "
        + languages);
    return;
  }
  if (engine.getFactory().getParameter(KEY_THREADING) == null) {
    scriptRunners.put(script.getName(), new ThreadLocalScriptRunner(script));
  } else {
    scriptRunners.put(script.getName(), new MainScriptRunner(engine, script));
  }
  if (script instanceof ScriptFile) {
    final ScriptFile scriptFile = (ScriptFile) script;
    final Path path = scriptFile.getPath();
    if (scriptFile.isWatched() && path != null) {
      watchManager.watchFile(path.toFile(), this);
    }
  }
}
origin: Activiti/Activiti

Object threadingParameter = scriptEngine.getFactory().getParameter("THREADING");
if (threadingParameter != null) {
origin: camunda/camunda-bpm-platform

/**
 * Allows checking whether the script engine can be cached.
 *
 * @param scriptEngine the script engine to check.
 * @return true if the script engine may be cached.
 */
protected boolean isCachable(ScriptEngine scriptEngine) {
 // Check if script-engine supports multithreading. If true it can be cached.
 Object threadingParameter = scriptEngine.getFactory().getParameter("THREADING");
 return threadingParameter != null;
}
origin: org.camunda.spin/camunda-spin-core

 public void evaluate() throws Throwable {
  scriptEngine = createScriptEngine(description);
  if (scriptEngine != null) {
   LOG.scriptEngineFoundForLanguage(scriptEngine.getFactory().getLanguageName());
  }
  base.evaluate();
 }
};
origin: com.googlecode.cernunnos/cernunnos

@Override
public boolean isThreadSafe(String key, ScriptEngine instance) {
  final ScriptEngineFactory factory = instance.getFactory();
  final Object threadingAbility = factory.getParameter("THREADING");
  return threadingAbility != null && ("THREAD-ISOLATED".equals(threadingAbility) || "STATELESS".equals(threadingAbility));
}
origin: looly/hutool

@Override
public ScriptEngineFactory getFactory() {
  return engine.getFactory();
}
origin: intuit/wasabi

  /**
   * Checks, whether the given engine is thread-safe or not.
   *
   * @return True, if the given engine is thread-safe, false otherwise.
   */
  private boolean engineAllowsParallelAccessFromMultipleThreads() {

    String threadingType = ( String ) engine.getFactory().getParameter( "THREADING" );

    return "THREAD-ISOLATED".equals( threadingType ) || "STATELESS".equals( threadingType );
  }
}
origin: org.apache.logging.log4j/log4j-core

@Override
public void fileModified(final File file) {
  final ScriptRunner runner = scriptRunners.get(file.toString());
  if (runner == null) {
    logger.info("{} is not a running script");
    return;
  }
  final ScriptEngine engine = runner.getScriptEngine();
  final AbstractScript script = runner.getScript();
  if (engine.getFactory().getParameter(KEY_THREADING) == null) {
    scriptRunners.put(script.getName(), new ThreadLocalScriptRunner(script));
  } else {
    scriptRunners.put(script.getName(), new MainScriptRunner(engine, script));
  }
}
origin: org.apache.logging.log4j/log4j-core

public void addScript(final AbstractScript script) {
  final ScriptEngine engine = manager.getEngineByName(script.getLanguage());
  if (engine == null) {
    logger.error("No ScriptEngine found for language " + script.getLanguage() + ". Available languages are: "
        + languages);
    return;
  }
  if (engine.getFactory().getParameter(KEY_THREADING) == null) {
    scriptRunners.put(script.getName(), new ThreadLocalScriptRunner(script));
  } else {
    scriptRunners.put(script.getName(), new MainScriptRunner(engine, script));
  }
  if (script instanceof ScriptFile) {
    final ScriptFile scriptFile = (ScriptFile) script;
    final Path path = scriptFile.getPath();
    if (scriptFile.isWatched() && path != null) {
      watchManager.watchFile(path.toFile(), this);
    }
  }
}
origin: org.camunda.spin/camunda-spin-core

 public void evaluate() throws Throwable {
  scriptEngine = createScriptEngine(description);
  if (scriptEngine != null) {
   LOG.scriptEngineFoundForLanguage(scriptEngine.getFactory().getLanguageName());
  }
  base.evaluate();
 }
};
origin: org.hibernate.validator/hibernate-validator

  /**
   * Checks whether the given engine is thread-safe or not.
   *
   * @return true if the given engine is thread-safe, false otherwise.
   */
  private boolean engineAllowsParallelAccessFromMultipleThreads() {
    String threadingType = (String) engine.getFactory().getParameter( "THREADING" );

    return "THREAD-ISOLATED".equals( threadingType ) || "STATELESS".equals( threadingType );
  }
}
origin: org.camunda.bpm/camunda-engine

/**
 * Allows checking whether the script engine can be cached.
 *
 * @param scriptEngine the script engine to check.
 * @return true if the script engine may be cached.
 */
protected boolean isCachable(ScriptEngine scriptEngine) {
 // Check if script-engine supports multithreading. If true it can be cached.
 Object threadingParameter = scriptEngine.getFactory().getParameter("THREADING");
 return threadingParameter != null;
}
origin: org.hibernate.validator/hibernate-validator

  /**
   * Checks whether the given engine is thread-safe or not.
   *
   * @return true if the given engine is thread-safe, false otherwise.
   */
  private boolean engineAllowsParallelAccessFromMultipleThreads() {
    String threadingType = (String) engine.getFactory().getParameter( "THREADING" );

    return "THREAD-ISOLATED".equals( threadingType ) || "STATELESS".equals( threadingType );
  }
}
origin: org.hibernate.validator/hibernate-validator

  /**
   * Checks whether the given engine is thread-safe or not.
   *
   * @return true if the given engine is thread-safe, false otherwise.
   */
  private boolean engineAllowsParallelAccessFromMultipleThreads() {
    String threadingType = (String) engine.getFactory().getParameter( "THREADING" );

    return "THREAD-ISOLATED".equals( threadingType ) || "STATELESS".equals( threadingType );
  }
}
javax.scriptScriptEnginegetFactory

Javadoc

Returns a ScriptEngineFactory for the class to which this ScriptEngine belongs.

Popular methods of ScriptEngine

  • eval
    Evaluates a script using the bindings in the specifed ScriptContext. Returns null for scripts that
  • put
    Associates a key and a value in the ScriptEngine ENGINE_SCOPE bindings.
  • createBindings
    Retrieves an uninitialized Bindings which can be used as the scope of the ScriptEngine.
  • getContext
    Returns the default ScriptContext of the ScriptEngine whose Bindings, Readers and Writers are used f
  • getBindings
    Retrieves a reference to the associated bindings for the specified scope. Possible scopes are: GLOBA
  • setBindings
    Associates the specified bindings with the specified scope.
  • get
    Retrieves the value which is associated with the specified key in the state of the ScriptEngine.
  • setContext
    Sets the default ScriptContext of the ScriptEngine whose Bindings, Readers and Writers are used for

Popular classes and methods

  • setRequestProperty (URLConnection)
    Sets the value of the specified request header field. The value will only be used by the current URL
  • findViewById (Activity)
  • compareTo (BigDecimal)
    Compares this BigDecimal with val. Returns one of the three values 1, 0, or -1. The method behaves a
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • BitSet (java.util)
    This implementation uses bit groups of size 32 to keep track of when bits are set to true or false.
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Notification (javax.management)
    Notifications are events emitted by NotificationEmitters
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)