List of usage examples for javax.script Bindings forEach
default void forEach(BiConsumer<? super K, ? super V> action)
From source file:org.wso2.carbon.identity.application.authentication.framework.config.model.graph.JsGraphBuilderFactory.java
public static void persistCurrentContext(AuthenticationContext context, ScriptEngine engine) { Bindings engineBindings = engine.getBindings(ScriptContext.ENGINE_SCOPE); Map<String, Object> persistableMap = new HashMap<>(); engineBindings.forEach((key, value) -> persistableMap.put(key, FrameworkUtils.toJsSerializable(value))); context.setProperty(JS_BINDING_CURRENT_CONTEXT, persistableMap); }