Package org.apache.tapestry

Examples of org.apache.tapestry.IEngine


    private static final String SYM_BUTTONNAME = "buttonName";

    protected void finishLoad()
    {
        IEngine engine = getPage().getEngine();
        IScriptSource source = engine.getScriptSource();

        Resource location =
            getSpecification().getSpecificationLocation().getRelativeResource("DatePicker.script");

        _script = source.getScript(location);
View Full Code Here


        Defense.notNull(cycle, "cycle");
        Defense.notNull(parameters, "parameters");

        squeezeServiceParameters(parameters);

        IEngine engine = cycle.getEngine();

        ServiceEncoding serviceEncoding = createServiceEncoding(parameters);

        String fullServletPath = _contextPath + serviceEncoding.getServletPath();

        return new EngineServiceLink(cycle, fullServletPath, engine.getOutputEncoding(), _codec,
                parameters, stateful);
    }
View Full Code Here

        _constructor = new ReflectiveEngineConstructor(engineClass);
    }

    public IEngine constructNewEngineInstance(Locale locale)
    {
        IEngine result = _constructor.construct();

        result.setLocale(locale);

        return result;
    }
View Full Code Here

    public IEngine getEngineInstance()
    {
        Locale locale = _localeManager.extractLocaleForCurrentRequest();

        IEngine result = (IEngine) _enginePool.get(locale);

        // This happens when either the pool is empty, or when a session exists
        // but the engine has not been stored into it (which should never happen, and
        // probably indicates an error in the framework or the application).
View Full Code Here

     * Gets the page from a pool, or otherwise loads the page. This operation is threadsafe.
     */

    public IPage getPage(IRequestCycle cycle, String pageName, IMonitor monitor)
    {
        IEngine engine = cycle.getEngine();
        Object key = buildKey(engine, pageName);
        IPage result = (IPage) _pool.get(key);

        if (result == null)
        {
View Full Code Here

     */

    protected void processValidatorScript(String scriptPath, IRequestCycle cycle,
            IFormComponent field, Map symbols)
    {
        IEngine engine = field.getPage().getEngine();
        IScriptSource source = engine.getScriptSource();
        IForm form = field.getForm();

        Map finalSymbols = (symbols == null) ? new HashMap() : symbols;

        finalSymbols.put(FIELD_SYMBOL, field);
        finalSymbols.put(FORM_SYMBOL, form);
        finalSymbols.put(VALIDATOR_SYMBOL, this);

        Resource location = new ClasspathResource(engine.getClassResolver(), scriptPath);

        IScript script = source.getScript(location);

        Body body = Body.get(cycle);

View Full Code Here

     */

    public IPage getPage(IRequestCycle cycle, String pageName)
    {

        IEngine engine = cycle.getEngine();
        Object key = buildKey(engine, pageName);

        IPage result;

        // lock our page specific key lock first
View Full Code Here

        // Training

        extractor.extractLocaleForCurrentRequest();
        extractorControl.setReturnValue(Locale.CHINESE);

        IEngine engine = (IEngine) newMock(IEngine.class);

        pool.get(Locale.CHINESE);
        poolControl.setReturnValue(engine);

        replayControls();

        EngineManagerImpl m = new EngineManagerImpl();

        m.setEnginePool(pool);
        m.setLocaleManager(extractor);

        IEngine actual = m.getEngineInstance();

        assertSame(engine, actual);

        verifyControls();
    }
View Full Code Here

        // Training

        extractor.extractLocaleForCurrentRequest();
        extractorControl.setReturnValue(Locale.CHINESE);

        IEngine engine = (IEngine) newMock(IEngine.class);

        pool.get(Locale.CHINESE);
        poolControl.setReturnValue(null);

        MockControl factoryControl = newControl(EngineFactory.class);
        EngineFactory factory = (EngineFactory) factoryControl.getMock();

        factory.constructNewEngineInstance(Locale.CHINESE);
        factoryControl.setReturnValue(engine);

        replayControls();

        EngineManagerImpl m = new EngineManagerImpl();

        m.setEnginePool(pool);
        m.setLocaleManager(extractor);
        m.setEngineFactory(factory);

        IEngine actual = m.getEngineInstance();

        assertSame(engine, actual);

        verifyControls();
    }
View Full Code Here

    public void testStoreNoSession()
    {

        MockControl engineControl = newControl(IEngine.class);
        IEngine engine = (IEngine) engineControl.getMock();

        ObjectPool pool = (ObjectPool) newMock(ObjectPool.class);

        // Training

        engine.getLocale();
        engineControl.setReturnValue(Locale.KOREAN);

        pool.store(Locale.KOREAN, engine);

        replayControls();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.