Search in sources :

Example 1 with PageSourceImpl

use of lucee.runtime.PageSourceImpl in project Lucee by lucee.

the class ComponentUtil method getPage.

public static Page getPage(PageContext pc, PageSource ps) throws PageException {
    PageSourceImpl psi = (PageSourceImpl) ps;
    Page p = psi.getPage();
    if (p != null) {
        // print.o("getPage(existing):"+ps.getDisplayPath()+":"+psi.hashCode()+":"+p.hashCode());
        return p;
    }
    pc = ThreadLocalPageContext.get(pc);
    return psi.loadPage(pc, false);
}
Also used : Page(lucee.runtime.Page) PageSourceImpl(lucee.runtime.PageSourceImpl)

Example 2 with PageSourceImpl

use of lucee.runtime.PageSourceImpl in project Lucee by lucee.

the class PagePoolList method toArray.

private static Array toArray(Array arr, PageSourcePool psp) throws PageException {
    String[] keys = psp.keys();
    PageSourceImpl ps;
    for (int y = 0; y < keys.length; y++) {
        ps = (PageSourceImpl) psp.getPageSource(keys[y], false);
        if (ps.isLoad())
            arr.append(ps.getDisplayPath());
    }
    return arr;
}
Also used : PageSourceImpl(lucee.runtime.PageSourceImpl)

Example 3 with PageSourceImpl

use of lucee.runtime.PageSourceImpl in project Lucee by lucee.

the class GetUsageData method templateCacheElements.

private static long[] templateCacheElements(Mapping[] mappings) {
    long elements = 0, size = 0;
    PageSourcePool psp;
    String[] keys;
    PageSourceImpl ps;
    Resource res;
    MappingImpl mapping;
    for (int i = 0; i < mappings.length; i++) {
        mapping = (MappingImpl) mappings[i];
        psp = mapping.getPageSourcePool();
        keys = psp.keys();
        for (int y = 0; y < keys.length; y++) {
            ps = (PageSourceImpl) psp.getPageSource(keys[y], false);
            if (ps.isLoad()) {
                elements++;
                res = mapping.getClassRootDirectory().getRealResource(ps.getClassName().replace('.', '/') + ".class");
                size += res.length();
            }
        }
    }
    return new long[] { elements, size };
}
Also used : Resource(lucee.commons.io.res.Resource) PageSourceImpl(lucee.runtime.PageSourceImpl) MappingImpl(lucee.runtime.MappingImpl) PageSourcePool(lucee.runtime.PageSourcePool)

Aggregations

PageSourceImpl (lucee.runtime.PageSourceImpl)3 Resource (lucee.commons.io.res.Resource)1 MappingImpl (lucee.runtime.MappingImpl)1 Page (lucee.runtime.Page)1 PageSourcePool (lucee.runtime.PageSourcePool)1