Package org.apache.tapestry

Examples of org.apache.tapestry.IEngine


        // 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

    {
        RequestContext context = new RequestContext(null, null);
        Infrastructure infrastructure = newInfrastructure();
        RequestCycleEnvironment env = new RequestCycleEnvironment(newErrorHandler(),
                infrastructure, context, newStrategySource(), newBuilder());
        IEngine engine = newEngine();
        IEngineService service = newService();
        IMonitor monitor = newMonitor();

        replayControls();
View Full Code Here

        RequestContext context = new RequestContext(null, null);
        Infrastructure infrastructure = newInfrastructure();
        PropertyPersistenceStrategySource source = newStrategySource();
        RequestCycleEnvironment env = new RequestCycleEnvironment(newErrorHandler(),
                infrastructure, context, source, newBuilder());
        IEngine engine = newEngine();
        IEngineService service = newService();
        IMonitor monitor = newMonitor();

        replayControls();
View Full Code Here

public abstract class Assets extends BasePage
{
    public void selectFrench(IRequestCycle cycle)
    {
        IEngine engine = cycle.getEngine();

        engine.setLocale(Locale.FRENCH);

        // Currently, when you change locale there is no way to
        // reload the current page.

        cycle.activate("Home");
View Full Code Here

        // Get the script, if not already gotten.  Scripts are re-entrant, so it is
        // safe to share this between instances of Palette.

        if (_script == null)
        {
            IEngine engine = getPage().getEngine();
            IScriptSource source = engine.getScriptSource();

            Resource scriptResource =
                getSpecification().getSpecificationLocation().getRelativeResource("Palette.script");

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

    private IScript getParsedScript()
    {
        if (_parsedScript == null)
        {
            IEngine engine = getPage().getEngine();
            IScriptSource source = engine.getScriptSource();

            Resource scriptLocation =
                getSpecification().getSpecificationLocation().getRelativeResource(
                    "Rollover.script");
View Full Code Here

    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        if (_disabled || cycle.isRewinding())
            return;

        IEngine engine = getPage().getEngine();
        IScriptSource source = engine.getScriptSource();

        Resource scriptLocation = getSpecification().getSpecificationLocation()
                .getRelativeResource("InspectorButton.script");

        IScript script = source.getScript(scriptLocation);

        Map symbols = new HashMap();

        IEngineService service = engine.getService(Tapestry.DIRECT_SERVICE);
        ILink link = service.getLink(cycle, new DirectServiceParameter(this));

        symbols.put("URL", link.getURL());

        Body body = Body.get(cycle);
View Full Code Here

        String scriptPath = getScriptPath();

        if (scriptPath == null)
            throw Tapestry.createRequiredParameterException(this, "scriptPath");

        IEngine engine = cycle.getEngine();
        IScriptSource source = engine.getScriptSource();

        // If the script path is relative, it should be relative to the Script component's
        // container (i.e., relative to a page in the application).

        Resource rootLocation =
View Full Code Here

    private Infrastructure _infrastructure;

    public void service(HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException
    {
        IEngine engine = _engineManager.getEngineInstance();

        request.setAttribute(Constants.INFRASTRUCTURE_KEY, _infrastructure);

        RequestContext context = new RequestContext(_servlet, request, response, _specification);

        try
        {
            engine.service(context);
        }
        finally
        {
            _engineManager.storeEngineInstance(engine);
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.