use of lucee.runtime.InterfaceImpl in project Lucee by lucee.
the class ComponentLoader method initInterface.
private static InterfaceImpl initInterface(PageContext pc, Page page, String callPath, boolean isRealPath) throws PageException {
if (!(page instanceof InterfacePageImpl))
throw new ApplicationException("invalid interface definition [" + callPath + "]");
InterfacePageImpl ip = (InterfacePageImpl) page;
InterfaceImpl i = ip.newInstance(pc, callPath, isRealPath);
return i;
}
use of lucee.runtime.InterfaceImpl in project Lucee by lucee.
the class AbstractFinal method add.
public void add(List<InterfaceImpl> interfaces) {
// add all interfaces to a flat structure
Iterator<InterfaceImpl> it = interfaces.iterator();
Iterator<UDF> iit;
InterfaceImpl inter;
UDF udf;
while (it.hasNext()) {
inter = it.next();
List<InterfaceImpl> parents = inter._getExtends();
// first add the parents, so children can overwrite functions with same name
if (!ArrayUtil.isEmpty(parents))
add(parents);
// UDFs
iit = inter.getUDFIt();
while (iit.hasNext()) {
udf = iit.next();
add(udf);
}
// this is add to a map to ensure we have every interface only once
this.interfaces.put(inter.getPageSource().getDisplayPath(), inter);
}
}
use of lucee.runtime.InterfaceImpl in project Lucee by lucee.
the class ComponentLoader method loadInterface.
public static InterfaceImpl loadInterface(PageContext pc, Page page, PageSource ps, String callPath, boolean isRealPath) throws PageException {
InterfaceImpl rtn = null;
if (pc.getConfig().debug()) {
DebugEntryTemplate debugEntry = pc.getDebugger().getEntry(pc, ps);
pc.addPageSource(ps, true);
long currTime = pc.getExecutionTime();
long exeTime = 0;
long time = System.nanoTime();
try {
debugEntry.updateFileLoadTime((int) (System.nanoTime() - time));
exeTime = System.nanoTime();
if (page == null)
page = ps.loadPage(pc, false);
rtn = initInterface(pc, page, callPath, isRealPath);
} finally {
long diff = ((System.nanoTime() - exeTime) - (pc.getExecutionTime() - currTime));
pc.setExecutionTime(pc.getExecutionTime() + (System.nanoTime() - time));
debugEntry.updateExeTime(diff);
pc.removeLastPageSource(true);
}
} else // no debug
{
pc.addPageSource(ps, true);
try {
if (page == null)
page = ps.loadPage(pc, false);
rtn = initInterface(pc, page, callPath, isRealPath);
} finally {
pc.removeLastPageSource(true);
}
}
return rtn;
}
Aggregations