Package org.apache.tapestry.ioc.def

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


        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);
        assertEquals(cd.toString(), moduleClass.getName() + "." + expectedMethodSignature);

        verify();
    }
View Full Code Here


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

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

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

        // 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

        _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");

        _builder.add(new SyntheticModuleDef(symbolSourceContribution, aliasModeContribution,
                appNameContribution));
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

        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

        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

    private static final String SERVICE_ID = "foo.bar.Baz";

    @Test
    public void proper_key_and_value()
    {
        ContributionDef def = newContributionDef();
        Log log = newLog();
        Map<Class, ContributionDef> keyToContribution = newMap();
        MappedConfiguration<Class, Runnable> delegate = newMappedConfiguration();

        Class key = Integer.class;
View Full Code Here

    }

    @Test
    public void duplicate_key()
    {
        ContributionDef def1 = newContributionDef("contributionPlaceholder1");
        ContributionDef def2 = newContributionDef("contributionPlaceholder2");
        Log log = newLog();
        Map<Class, ContributionDef> keyToContribution = newMap();

        keyToContribution.put(Integer.class, def1);
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.