Package org.apache.tapestry.ioc

Examples of org.apache.tapestry.ioc.ServiceLocator


        if (_insideConstructor)
            throw new RuntimeException(IOCMessages.recursiveModuleConstructor(_moduleDef
                    .getModuleId(), builderClass, constructor));

        ServiceLocator locator = new ServiceLocatorImpl(_registry, this);
        Map<Class, Object> parameterDefaults = newMap();

        parameterDefaults.put(Log.class, _log);
        parameterDefaults.put(String.class, _moduleDef.getModuleId());
        parameterDefaults.put(ServiceLocator.class, locator);
View Full Code Here


        if (contributions.isEmpty()) return;

        Log log = getLog(serviceId);
        boolean debug = log.isDebugEnabled();

        ServiceLocator locator = new ServiceResourcesImpl(this, module, serviceDef, log);

        for (ContributionDef def : contributions)
        {
            MappedConfiguration<K, V> validating = new ValidatingMappedConfigurationWrapper<K, V>(
                    serviceId, def, log, keyClass, valueType, keyToContribution, configuration);
View Full Code Here

        if (contributions.isEmpty()) return;

        Log log = getLog(serviceId);
        boolean debug = log.isDebugEnabled();

        ServiceLocator locator = new ServiceResourcesImpl(this, module, serviceDef, log);

        for (ContributionDef def : contributions)
        {
            Configuration<T> validating = new ValidatingConfigurationWrapper<T>(serviceId, log,
                    valueType, def, configuration);
View Full Code Here

        if (contributions.isEmpty()) return;

        Log log = getLog(serviceId);
        boolean debug = log.isDebugEnabled();

        ServiceLocator locator = new ServiceResourcesImpl(this, module, serviceDef, log);

        for (ContributionDef def : contributions)
        {
            OrderedConfiguration<T> validating = new ValidatingOrderedConfigurationWrapper<T>(
                    serviceId, module.getModuleId(), def, log, valueType, configuration);
View Full Code Here

    @Test
    public void successful_lookup()
    {
        ObjectProvider provider = newObjectProvider();
        ServiceLocator locator = newServiceLocator();
        Runnable r = newRunnable();
        SymbolSource source = newSymbolSource();

        train_expandSymbols(source, "prefix:expression");
        train_provide(provider, "expression", Runnable.class, locator, r);
View Full Code Here

    @Test
    public void symbols_are_expanded()
    {
        ObjectProvider provider = newObjectProvider();
        ServiceLocator locator = newServiceLocator();
        Runnable r = newRunnable();
        SymbolSource source = newSymbolSource();

        train_expandSymbols(source, "${symbol}", "prefix:expression");
        train_provide(provider, "expression", Runnable.class, locator, r);
View Full Code Here

    }

    @Test
    public void unknown_object_provider_prefix()
    {
        ServiceLocator locator = newServiceLocator();
        SymbolSource source = newSymbolSource();

        train_expandSymbols(source, "prefix:expression");

        replay();
View Full Code Here

    }

    @Test
    public void no_prefix_in_object_reference()
    {
        ServiceLocator locator = newServiceLocator();
        SymbolSource source = newSymbolSource();
        TypeCoercer coercer = newTypeCoercer();

        train_expandSymbols(source, "${value}", "55");
        train_coerce(coercer, "55", Integer.class, 55);
View Full Code Here

    @Test
    public void unordered_contribution()
    {
        _toContribute = new Object();
        Configuration configuration = newConfiguration();
        ServiceLocator locator = newServiceLocator();

        configuration.add(_toContribute);

        replay();
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void unordered_collection_with_service_lookup()
    {
        Configuration configuration = newConfiguration();
        ServiceLocator locator = newServiceLocator();
        UpcaseService service = newUpcaseService();

        train_getService(locator, "zip.Zap", UpcaseService.class, service);

        configuration.add(service);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.ServiceLocator

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.