Package com.astamuse.asta4d

Examples of com.astamuse.asta4d.Context


        }
        return url + '?' + KEY_FLASH_SCOPE_ID + '=' + flashScopeId;
    }

    public static void getFlashScopeData(String flashScopeId) {
        Context context = Context.getCurrentThreadContext();
        Map<String, Object> flashScopeData = FlashScopeDataManager.getInstance().get(flashScopeId);
        for (Entry<String, Object> entry : flashScopeData.entrySet()) {
            context.setData(SCOPE_FLASH, entry.getKey(), entry.getValue());
        }
    }
View Full Code Here


        }
        return map;
    }

    public Context clone() {
        Context newCtx = new WebApplicationContext();
        copyScopesTo(newCtx);
        return newCtx;
    }
View Full Code Here

        String targetPath = genericMapResult.get(uri);
        if (targetPath != null) {
            return targetPath;
        } else {
            Context context = Context.getCurrentThreadContext();
            String basePath = context.getData(WebApplicationContext.SCOPE_PATHVAR, VAR_BASEPATH);
            if (basePath == null) {
                basePath = _basePath;
            }

            if (basePath == null) {// default from web context root
View Full Code Here

     * @return a guess of the content type by file name extension,
     *         "application/octet-stream" when not matched
     */
    protected String judgContentType(String path) {

        Context context = Context.getCurrentThreadContext();

        String forceContentType = context.getData(WebApplicationContext.SCOPE_PATHVAR, VAR_CONTENT_TYPE);
        if (forceContentType != null) {
            return forceContentType;
        }

        String fileName = FilenameUtils.getName(path);
View Full Code Here

        }
        return map;
    }

    public Context clone() {
        Context newCtx = new WebApplicationContext();
        copyScopesTo(newCtx);
        return newCtx;
    }
View Full Code Here

     * @param request
     * @return ContentProvider
     * @throws Exception
     */
    private List<ContentProvider> handleRequest(UrlMappingRule currentRule) throws Exception {
        Context context = Context.getCurrentThreadContext();
        RequestHandlerInvokerFactory factory = WebApplicationConfiguration.getWebApplicationConfiguration()
                .getRequestHandlerInvokerFactory();
        RequestHandlerInvoker invoker = factory.getInvoker();

        List<ContentProvider> cpList = invoker.invoke(currentRule);
        context.setData(KEY_REQUEST_HANDLER_RESULT, cpList);

        return cpList;

    }
View Full Code Here

        }
        return map;
    }

    public Context clone() {
        Context newCtx = new WebApplicationContext();
        newCtx.setConfiguration(this.getConfiguration());
        copyScopesTo(newCtx);
        return newCtx;
    }
View Full Code Here

     * @param request
     * @return ContentProvider
     * @throws Exception
     */
    private List<ContentProvider<?>> handleRequest(UrlMappingRule currentRule) throws Exception {
        Context context = Context.getCurrentThreadContext();
        RequestHandlerInvokerFactory factory = WebApplicationConfiguration.getWebApplicationConfiguration()
                .getRequestHandlerInvokerFactory();
        RequestHandlerInvoker invoker = factory.getInvoker();

        List<ContentProvider<?>> cpList = invoker.invoke(currentRule);
        context.setData(KEY_REQUEST_HANDLER_RESULT, cpList);

        return cpList;

    }
View Full Code Here

        }
        return url + '?' + KEY_FLASH_SCOPE_ID + '=' + flashScopeId;
    }

    public static void getFlashScopeData(String flashScopeId) {
        Context context = Context.getCurrentThreadContext();
        Map<String, Object> flashScopeData = FlashScopeDataManager.getInstance().get(flashScopeId);
        for (Entry<String, Object> entry : flashScopeData.entrySet()) {
            context.setData(SCOPE_FLASH, entry.getKey(), entry.getValue());
        }
    }
View Full Code Here

     * @return a guess of the content type by file name extension,
     *         "application/octet-stream" when not matched
     */
    protected String judgContentType(String path) {

        Context context = Context.getCurrentThreadContext();

        String forceContentType = context.getData(WebApplicationContext.SCOPE_PATHVAR, VAR_CONTENT_TYPE);
        if (forceContentType != null) {
            return forceContentType;
        }

        String fileName = FilenameUtils.getName(path);
View Full Code Here

TOP

Related Classes of com.astamuse.asta4d.Context

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.