Skip to content

Commit

Permalink
Merge pull request #164 from shanggeeth/graalvm
Browse files Browse the repository at this point in the history
  • Loading branch information
shanggeeth authored May 30, 2024
2 parents 60806a9 + b0d2875 commit e37b50d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public class JsWrapperFactoryProvider {

private JsWrapperFactoryProvider() {

JsGenericGraphBuilderFactory jsGraphBuilderFactory = FrameworkUtils.createJsGraphBuilderFactoryFromConfig();
JsGenericGraphBuilderFactory jsGraphBuilderFactory =
FrameworkUtils.createJsGenericGraphBuilderFactoryFromConfig();
if (jsGraphBuilderFactory instanceof JsOpenJdkNashornGraphBuilderFactory) {
jsWrapperBaseFactory = new JsOpenJdkNashornWrapperFactory();
} else if (jsGraphBuilderFactory instanceof JsGraalGraphBuilderFactory) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import org.graalvm.polyglot.proxy.ProxyObject;
import org.wso2.carbon.identity.application.authentication.framework.model.UserSession;
import org.wso2.carbon.identity.conditional.auth.functions.user.model.JsUserSession;
import org.wso2.carbon.identity.conditional.auth.functions.user.model.nashorn.JsNashornApplication;
import org.wso2.carbon.identity.conditional.auth.functions.user.model.nashorn.JsNashornUserAgent;
import org.wso2.carbon.identity.core.model.UserAgent;

import java.util.stream.Collectors;
Expand Down Expand Up @@ -72,7 +70,7 @@ public Object getMember(String name) {

switch (name) {
case "userAgent":
return new JsNashornUserAgent(userAgent);
return new JsGraalUserAgent(userAgent);
case "ip":
return getWrapped().getIp();
case "loginTime":
Expand All @@ -82,7 +80,7 @@ public Object getMember(String name) {
case "id":
return getWrapped().getSessionId();
case "applications":
return getWrapped().getApplications().stream().map(JsNashornApplication::new)
return getWrapped().getApplications().stream().map(JsGraalApplication::new)
.collect(Collectors.toList());
default:
return super.getMember(name);
Expand Down

0 comments on commit e37b50d

Please sign in to comment.