All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.tapestry.ioc.internal.RegistryWrapper Maven / Gradle / Ivy

// Copyright 2007 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.apache.tapestry.ioc.internal;

import org.apache.tapestry.ioc.AnnotationProvider;
import org.apache.tapestry.ioc.ObjectLocator;
import org.apache.tapestry.ioc.Registry;

/**
 * A wrapper around {@link InternalRegistry} that exists to expand symbols in a service id before
 * invoking {@link ObjectLocator#getService(Class)}.
 */
public class RegistryWrapper implements Registry
{
    private final InternalRegistry _registry;

    public RegistryWrapper(final InternalRegistry registry)
    {
        _registry = registry;
    }

    public void cleanupThread()
    {
        _registry.cleanupThread();
    }

    public void shutdown()
    {
        _registry.shutdown();
    }

    public  T getObject(Class objectType, AnnotationProvider annotationProvider)
    {
        return _registry.getObject(objectType, annotationProvider);
    }

    public  T getService(String serviceId, Class serviceInterface)
    {
        String expandedServiceId = _registry.expandSymbols(serviceId);

        return _registry.getService(expandedServiceId, serviceInterface);
    }

    public  T getService(Class serviceInterface)
    {
        return _registry.getService(serviceInterface);
    }

    public  T autobuild(Class clazz)
    {
        return _registry.autobuild(clazz);
    }

    public void performRegistryStartup()
    {
        _registry.performRegistryStartup();
    }

    public  T proxy(Class interfaceClass, Class implementationClass)
    {
        return _registry.proxy(interfaceClass, implementationClass);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy