Examples of ContributionDef


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

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

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

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

Examples of org.apache.tapestry5.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);

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

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

     * after the built-in
     * contributions.
     */
    public Set<ContributionDef> getContributionDefs()
    {
        ContributionDef def = createContributionToMasterObjectProvider();

        return CollectionFactory.newSet(def);
    }
View Full Code Here

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

    }

    private ContributionDef createContributionToMasterObjectProvider()
    {

        ContributionDef def = new AbstractContributionDef()
        {
            public String getServiceId()
            {
                return "MasterObjectProvider";
            }
View Full Code Here

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

        if (value == null)
            throw new NullPointerException(IOCMessages.contributionWasNull(serviceId));

        V coerced = typeCoercer.coerce(value, expectedValueType);

        ContributionDef existing = keyToContributor.get(key);

        if (existing != null)
            throw new IllegalArgumentException(IOCMessages.contributionDuplicateKey(serviceId, existing));

        map.put(key, coerced);
View Full Code Here

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

        builder.add(moduleClasses);
    }

    private void addSyntheticSymbolSourceModule(String appPackage)
    {
        ContributionDef appPathContribution = new SyntheticSymbolSourceContributionDef("AppPath",
                new SingleKeySymbolProvider(InternalSymbols.APP_PACKAGE_PATH, appPackage.replace('.', '/')));

        ContributionDef symbolSourceContribution = new SyntheticSymbolSourceContributionDef("ServletContext",
                appProvider, "before:ApplicationDefaults", "after:EnvironmentVariables");

        ContributionDef appNameContribution = new SyntheticSymbolSourceContributionDef("AppName",
                new SingleKeySymbolProvider(InternalSymbols.APP_NAME, appName), "before:ServletContext");

        builder.add(new SyntheticModuleDef(symbolSourceContribution, appNameContribution, appPathContribution));
    }
View Full Code Here

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

        configuration.add(toContribute);

        replay();

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

        def.contribute(this, serviceResources, configuration);

        verify();
    }
View Full Code Here

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

        configuration.add(service);

        replay();

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

        def.contribute(this, resources, configuration);

        verify();
    }
View Full Code Here

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

        configuration.add(service);

        replay();

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

        def.contribute(this, resources, configuration);

        verify();
    }
View Full Code Here

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

        train_getServiceId(resources, "Bif");

        replay();

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

        try
        {
            def.contribute(this, resources, configuration);
            unreachable();
        } catch (RuntimeException ex)
        {
            assertMessageContains(ex,
                    "Error invoking service contribution method org.apache.tapestry5.ioc.internal.ContributionDefImplTest.contributeUnorderedWrongParameter(MappedConfiguration)",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.