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

com.tangosol.coherence.config.builder.NamedResourceBuilder Maven / Gradle / Ivy

There is a newer version: 24.09
Show newest version
/*
 * Copyright (c) 2000, 2022, Oracle and/or its affiliates.
 *
 * Licensed under the Universal Permissive License v 1.0 as shown at
 * http://oss.oracle.com/licenses/upl.
 */
package com.tangosol.coherence.config.builder;

import com.tangosol.coherence.config.ParameterList;

import com.tangosol.config.expression.ParameterResolver;

/**
 * A {@link ParameterizedBuilder} that resolves a named resource from the
 * {@link com.tangosol.net.Cluster cluster's} {@link com.tangosol.util.ResourceRegistry}.
 *
 * @param   the type of the named resource
 */
public class NamedResourceBuilder
        implements ParameterizedBuilder
    {
    // ----- constructors ---------------------------------------------------

    public NamedResourceBuilder(ParameterizedBuilder delegate, String sName)
        {
        m_delegate = delegate;
        m_sName    = sName;
        }

    // ----- accessors ------------------------------------------------------

    public ParameterizedBuilder getDelegate()
        {
        return m_delegate;
        }

    public String getName()
        {
        return m_sName;
        }

    // ----- ParameterizedBuilder methods -----------------------------------

    @Override
    public T realize(ParameterResolver resolver, ClassLoader loader, ParameterList listParameters)
        {
        return m_delegate.realize(resolver, loader, listParameters);
        }

    // ----- data members ---------------------------------------------------

    /**
     * The {@link ParameterizedBuilder} this builder delegates to.
     */
    private final ParameterizedBuilder m_delegate;

    /**
     * The name of the resource.
     */
    private final String m_sName;
    }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy