Package org.auraframework.system

Examples of org.auraframework.system.MasterDefRegistry


                    testName = test.get(request);
                }
                if (testName != null) {
                    TestContext testContext = testContextAdapter.getTestContext(testName);
                    if (testContext != null) {
                        MasterDefRegistry registry = context.getDefRegistry();
                        Set<Definition> mocks = testContext.getLocalDefs();
                        if (mocks != null) {
                            boolean doReset = testReset.get(request);
                            for (Definition def : mocks) {
                                if (doReset && def instanceof Resettable) {
                                    ((Resettable) def).reset();
                                }
                                registry.addLocalDef(def);
                            }
                        }
                    }
                } else {
                    testContextAdapter.clear();
View Full Code Here


     */
    private Set<DefDescriptor<?>> handleTopLevel(HttpServletRequest request, HttpServletResponse response,
            AuraContext context) throws IOException, ServletException {
        DefDescriptor<? extends BaseComponentDef> appDesc = context.getApplicationDescriptor();
        DefinitionService definitionService = Aura.getDefinitionService();
        MasterDefRegistry mdr = context.getDefRegistry();

        context.setPreloading(true);
        if (appDesc == null) {
            //
            // This means we have nothing to say to the client, so the response is
            // left completely empty.
            //
            return null;
        }
        long ifModifiedSince = request.getDateHeader(HttpHeaders.IF_MODIFIED_SINCE);
        String uid = context.getUid(appDesc);
        try {
            try {
                definitionService.updateLoaded(appDesc);
                if (uid != null && ifModifiedSince != -1) {
                    //
                    // In this case, we have an unmodified descriptor, so just tell
                    // the client that.
                    //
                    response.sendError(HttpServletResponse.SC_NOT_MODIFIED);
                    return null;
                }
            } catch (ClientOutOfSyncException coose) {
                //
                // We can't actually handle an out of sync here, since we are doing a
                // preload. We have to ignore it, and continue as if nothing happened.
                // But in the process, we make sure to set 'no-cache' so that the result
                // is thrown away. This may actually not give the right result in bizarre
                // corner cases... beware cache inconsistencied on revert after a QFE.
                //
                // We actually probably should do something different, like send a minimalist
                // set of stuff to make the client re-try.
                //
                setNoCache(response);
                String oosUid = mdr.getUid(null, appDesc);
                return mdr.getDependencies(oosUid);
            }
        } catch (QuickFixException qfe) {
            DefDescriptor<ComponentDef> qfeDescriptor;

            //
            // A quickfix exception means that we couldn't compile something.
            // In this case, we still want to preload things, but we want to preload
            // quick fix values, note that we force NoCache here.
            //
            setNoCache(response);

            qfeDescriptor = definitionService.getDefDescriptor("markup://auradev:quickFixException",
                    ComponentDef.class);
            context.setLoadingApplicationDescriptor(qfeDescriptor);
            String qfeUid;
            try {
                qfeUid = mdr.getUid(null, qfeDescriptor);
            } catch (QuickFixException death) {
                //
                // Ok, we really can't handle this here, so just punt. This means that
                // the quickfix display is broken, and whatever we try will give us grief.
                //
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return null;
            }
            return mdr.getDependencies(qfeUid);
        }
        setLongCache(response);
        if (uid == null) {
            uid = context.getUid(appDesc);
        }
        return mdr.getDependencies(uid);
    }
View Full Code Here

        return null;
    }

    protected DefDescriptor<?> setupQuickFix(AuraContext context) {
        DefinitionService ds = Aura.getDefinitionService();
        MasterDefRegistry mdr = context.getDefRegistry();

        try {
            DefDescriptor<ComponentDef> qfdesc = ds.getDefDescriptor("auradev:quickFixException", ComponentDef.class);
            String uid = mdr.getUid(null, qfdesc);
            context.setPreloadedDefinitions(mdr.getDependencies(uid));
            return qfdesc;
        } catch (QuickFixException death) {
            //
            // DOH! something is seriously wrong, just die!
            // This should _never_ happen, but if you muck up basic aura stuff, it might.
View Full Code Here

TOP

Related Classes of org.auraframework.system.MasterDefRegistry

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.