001 package railo.runtime.concurrency; 002 003 import railo.runtime.PageContext; 004 import railo.runtime.exp.PageException; 005 import railo.runtime.type.Struct; 006 import railo.runtime.type.UDF; 007 008 public class UDFCaller extends Caller { 009 010 private UDF udf; 011 private boolean doIncludePath; 012 private Object[] arguments; 013 private Struct namedArguments; 014 015 public UDFCaller(PageContext parent, UDF udf, Object[] arguments, boolean doIncludePath) { 016 super(parent); 017 this.udf=udf; 018 this.arguments=arguments; 019 this.doIncludePath=doIncludePath; 020 } 021 public UDFCaller(PageContext parent, UDF udf,Struct namedArguments, boolean doIncludePath) { 022 super(parent); 023 this.udf=udf; 024 this.namedArguments=namedArguments; 025 this.doIncludePath=doIncludePath; 026 } 027 028 @Override 029 public void _call(PageContext parent,PageContext pc) throws PageException { 030 if(namedArguments!=null) udf.callWithNamedValues(pc, namedArguments, doIncludePath); 031 else udf.call(pc, arguments, doIncludePath); 032 } 033 034 }