Package org.auraframework.def

Examples of org.auraframework.def.ProviderDef


            context.pushCallingDescriptor(descriptor);
            BaseComponent<?, ?> oldComponent = context.setCurrentComponent(new ProtoComponentImpl(descriptor,
                    getGlobalId(), attributeSet));
            try {
                RootDefinition root = intfDescriptor.getDef();
                ProviderDef providerDef = root.getLocalProviderDef();
                if (providerDef == null) {
                    providerDef = root.getProviderDef();
                    if (providerDef != null) {
                        // In this case, we have a 'remote' provider (i.e. client side) and we simply
                        // continue on as if nothing happened.
                    } else {
                      throw new InvalidDefinitionException(String.format("%s cannot be instantiated directly.",
                            descriptor), root.getLocation());
                    }
                }

                if (providerDef.isLocal()) {
                    ComponentConfig config = providerDef.provide(intfDescriptor);
                    if (config != null) {
                        ProviderDef remoteProviderDef = root.getProviderDef();
                        if (remoteProviderDef == null || remoteProviderDef.isLocal()) {
                            hasLocalDependencies = true;
                        }

                        DefDescriptor<ComponentDef> d = config.getDescriptor();
                        if (d != null) {
View Full Code Here


    public DefDescriptor<ProviderDef> getProviderDescriptor() throws QuickFixException {
        if (providerDescriptors != null && providerDescriptors.size() == 1) {
            return providerDescriptors.get(0);
        }

        ProviderDef providerDef = getProviderDef();
        if (providerDef != null) {
            return providerDef.getDescriptor();
        }
        return null;
    }
View Full Code Here

        return null;
    }

    @Override
    public ProviderDef getLocalProviderDef() throws QuickFixException {
        ProviderDef def = null;
        if (providerDescriptors != null) {
            for (DefDescriptor<ProviderDef> desc : providerDescriptors) {
                def = desc.getDef();
                if (def.isLocal()) {
                    break;
                } else {
                    def = null;
                }
            }
View Full Code Here

     * @return The primary provider def. If multiple exist, this will be the remote one.
     * @throws QuickFixException
     */
    @Override
    public ProviderDef getProviderDef() throws QuickFixException {
        ProviderDef def = null;
        if (providerDescriptors != null) {
            for (DefDescriptor<ProviderDef> desc : providerDescriptors) {
                def = desc.getDef();
                if (!def.isLocal()) {
                    break;
                }
            }
        }
        return def;
View Full Code Here

     * @return True if there are no providers or there is a local provider False if there is only a remtre provider and
     *         no local provider
     * @throws QuickFixException
     */
    public boolean isInConcreteAndHasLocalProvider() throws QuickFixException {
        ProviderDef providerDef = getProviderDef();
        if (providerDef != null && !providerDef.isLocal()) {
            providerDef = getLocalProviderDef();
            return providerDef != null;
        }
        return true;
    }
View Full Code Here

                if (isAbstract) {
                    json.writeMapEntry("isAbstract", isAbstract);
                }

                ProviderDef providerDef = getProviderDef();
                if (providerDef != null && !providerDef.isLocal()) {
                    json.writeMapEntry("providerDef", providerDef);
                }

                if (subDefs != null) {
                    json.writeMapEntry("subDefs", subDefs.values());
View Full Code Here

        super(targetDescriptor, map);
    }

    @Override
    protected ProviderDef createDefinition(Map<String, Object> map) throws QuickFixException {
        ProviderDef baseDef = getBaseDefinition((String) map.get("descriptor"), ProviderDef.class);
        List<Stub<?>> stubs = getStubs(map.get("stubs"));
        return (ProviderDef) Proxy.newProxyInstance(this.getClass()
                .getClassLoader(), new Class<?>[] { ProviderDef.class, Resettable.class },
                new DelegatingStubHandler(baseDef, stubs));
    }
View Full Code Here

        super(name);
    }

    public void testGetProviderDefDefault() throws Exception {
        this.providerDescriptors = null;
        ProviderDef actual = buildDefinition().getProviderDef();
        assertNull(actual);
    }
View Full Code Here

TOP

Related Classes of org.auraframework.def.ProviderDef

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.