Package org.auraframework.system

Examples of org.auraframework.system.SourceLoader


        return namespaces;
    }

    public <D extends Definition> Source<D> getSource(DefDescriptor<D> descriptor) {
        LoaderKey key = new LoaderKey(descriptor.getNamespace(), descriptor.getPrefix());
        SourceLoader loader = loaders.get(key);
        if (loader == null) {
            return null;
        }
        return loader.getSource(descriptor);
    }
View Full Code Here


        return ret;
    }

    private <T extends Definition> Set<DefDescriptor<T>> find(Class<T> primaryInterface, String prefix, String namespace) {
        LoaderKey key = new LoaderKey(namespace, prefix);
        SourceLoader loader = loaders.get(key);
        if (loader == null) {
            throw new AuraRuntimeException(String.format("Loader not found for %s", key));
        }
        return loader.find(primaryInterface, prefix, namespace);
    }
View Full Code Here

    public SourceFactoryTest(String name) {
        super(name);
    }

    public void testSourceFactory() {
        SourceLoader loader = StringSourceLoader.getInstance();
        try {
            List<SourceLoader> loaders = Lists.newArrayList(loader, loader);
            new SourceFactory(loaders);
            fail("Should have failed with AuraException('Namespace claimed by 2 SourceLoaders')");
        } catch (AuraRuntimeException e) {
View Full Code Here

     * Verify that SourceFactory registers Privileged namespaces based on loader information.
     * SourceLoaders that implement PrivilegedNamespaceSourceLoaders are considered for determining if a namespace is privileged.
     * Namespaces served by SourceLoaders that do not implement PrivilegedNamespaceSourceLoaders are not privileged.
     */
    public void testPrivilegedNamespaceSourceLoadersAreRegisteredWithConfigAdapter(){
        SourceLoader friendlyLoader = new FriendlySourceLoader();
        SourceLoader selectiveLoader = new SelectiveSourceLoader();
        SourceLoader unprivilegedLoader = new UnprivilegedSourceLoader();
        List<SourceLoader> loaders = Lists.newArrayList(friendlyLoader, selectiveLoader, unprivilegedLoader);
        SourceFactory sf = new SourceFactory(loaders);
        assertEquals(Sets.newHashSet("VIP", "Guest", "Friend1", "Friend2", "Custom_1","Custom_2"), sf.getNamespaces());
       
        ConfigAdapter c = Aura.getConfigAdapter();
View Full Code Here

TOP

Related Classes of org.auraframework.system.SourceLoader

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.