Package org.apache.tapestry.ioc.def

Examples of org.apache.tapestry.ioc.def.ContributionDef


        configuration.add("fred", service);

        replay();

        Method m = findMethod("contributeOrderedParameter");
        ContributionDef def = new ContributionDefImpl("foo.Bar", m, null);

        def.contribute(this, locator, configuration);

        verify();
    }
View Full Code Here


        configuration.add("upcase", service);

        replay();

        Method m = findMethod("contributeMappedParameter");
        ContributionDef def = new ContributionDefImpl("foo.Bar", m, null);

        def.contribute(this, locator, configuration);

        verify();
    }
View Full Code Here

        {
            _log.warn(IOCMessages.noContributionParameter(method));
            return;
        }

        ContributionDef def = new ContributionDefImpl(serviceId, method, _classFactory);

        _contributionDefs.add(def);
    }
View Full Code Here

        RegistryBuilder builder = new RegistryBuilder(_extraLoader);

        builder.add(TapestryModule.class);

        SymbolProvider provider = new SingleKeySymbolProvider(InternalConstants.TAPESTRY_ALIAS_MODE_SYMBOL, "servlet");
        ContributionDef contribution = new SyntheticSymbolSourceContributionDef("AliasMode", provider,
                                                                                "before:ApplicationDefaults");

        ModuleDef module = new SyntheticModuleDef(contribution);

        builder.add(module);
View Full Code Here

        builder.add(TapestryModule.class);

        // A synthetic module to ensure that the tapestry.alias-mode is set correctly.

        SymbolProvider provider = new SingleKeySymbolProvider(InternalConstants.TAPESTRY_ALIAS_MODE_SYMBOL, "servlet");
        ContributionDef contribution = new SyntheticSymbolSourceContributionDef("AliasMode", provider,
                                                                                "before:ApplicationDefaults");

        ModuleDef module = new SyntheticModuleDef(contribution);

        builder.add(module);
View Full Code Here

        {
            _logger.warn(IOCMessages.noContributionParameter(method));
            return;
        }

        ContributionDef def = new ContributionDefImpl(serviceId, method, _classFactory);

        _contributionDefs.add(def);
    }
View Full Code Here

        RegistryBuilder builder = new RegistryBuilder(_extraLoader);

        builder.add(TapestryModule.class);

        SymbolProvider provider = new SingleKeySymbolProvider(InternalConstants.TAPESTRY_ALIAS_MODE_SYMBOL, "servlet");
        ContributionDef contribution = new SyntheticSymbolSourceContributionDef("AliasMode", provider,
                                                                                "before:ApplicationDefaults");

        ModuleDef module = new SyntheticModuleDef(contribution);

        builder.add(module);
View Full Code Here

        _builder.add(moduleBuilderClasses);
    }

    private void addSyntheticSymbolSourceModule()
    {
        ContributionDef symbolSourceContribution = new SyntheticSymbolSourceContributionDef("ServletContext",
                                                                                            _appProvider,
                                                                                            "before:ApplicationDefaults");

        ContributionDef aliasModeContribution = new SyntheticSymbolSourceContributionDef("AliasMode",
                                                                                         new SingleKeySymbolProvider(
                                                                                                 InternalConstants.TAPESTRY_ALIAS_MODE_SYMBOL,
                                                                                                 _aliasMode),
                                                                                         "before:ServletContext");

        ContributionDef appNameContribution = new SyntheticSymbolSourceContributionDef("AppName",
                                                                                       new SingleKeySymbolProvider(
                                                                                               InternalConstants.TAPESTRY_APP_NAME_SYMBOL,
                                                                                               _appName),
                                                                                       "before:ServletContext");
View Full Code Here

            _logger.warn(IOCMessages.contributionWrongValueType(_serviceId, _contributionDef, value
                    .getClass(), _expectedValueType));
            return;
        }

        ContributionDef existing = _keyToContributor.get(key);

        if (existing != null)
        {
            _logger.warn(IOCMessages.contributionDuplicateKey(
                    _serviceId,
View Full Code Here

        Set<ContributionDef> defs = md.getContributionDefs();

        assertEquals(defs.size(), 1);

        ContributionDef cd = defs.iterator().next();

        // The target service id is derived from the method name

        assertEquals(cd.getServiceId(), expectedServiceId);

        // Can't be exact, because the source file & line number are probably attached (and those
        // can change)

        assertTrue(cd.toString().contains(moduleClass.getName() + "." + expectedMethodSignature));

        verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.def.ContributionDef

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.