org.keycloak.scripting

## Class DefaultScriptingProvider

- java.lang.Object
- - org.keycloak.scripting.DefaultScriptingProvider

- All Implemented Interfaces:
    Provider, ScriptingProvider

      public class DefaultScriptingProvider
      extends Object
      implements ScriptingProvider

  A `ScriptingProvider` that uses a `ScriptEngineManager` to evaluate scripts with a `ScriptEngine`.
  Author:
    Thomas Darimont

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultScriptingProvider(ScriptEngineManager scriptEngineManager)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `InvocableScript` | `prepareScript(ScriptModel script)` Returns an `InvocableScript` based on the given `ScriptModel` with an `ScriptBindingsConfigurer.EMPTY` `ScriptBindingsConfigurer`.
    `InvocableScript` | `prepareScript(ScriptModel script, ScriptBindingsConfigurer bindingsConfigurer)` Returns an `InvocableScript` based on the given `ScriptModel`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultScriptingProvider

          public DefaultScriptingProvider(ScriptEngineManager scriptEngineManager)

  - ### Method Detail

    - #### prepareScript

          public InvocableScript prepareScript(ScriptModel script)

      Description copied from interface: `ScriptingProvider`
      Returns an `InvocableScript` based on the given `ScriptModel` with an `ScriptBindingsConfigurer.EMPTY` `ScriptBindingsConfigurer`.
      Specified by:
        `prepareScript` in interface `ScriptingProvider`
      Returns:
      See Also:
        `ScriptingProvider.prepareScript(ScriptModel, ScriptBindingsConfigurer)`

    - #### prepareScript

          public InvocableScript prepareScript(ScriptModel script,
                                               ScriptBindingsConfigurer bindingsConfigurer)

      Description copied from interface: `ScriptingProvider`
      Returns an `InvocableScript` based on the given `ScriptModel`.

      The `InvocableScript` wraps a dedicated `ScriptEngine` that was populated with the provided `ScriptBindingsConfigurer`

      Specified by:
        `prepareScript` in interface `ScriptingProvider`
      Parameters:
        `script` - the script to wrap
        `bindingsConfigurer` - populates the `Bindings`
      Returns:

    - #### close

          public void close()

      Specified by:
        `close` in interface `Provider`

Copyright © 2016 JBoss by Red Hat. All rights reserved.