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

org.jboss.as.clustering.msc.InjectedValueDependency Maven / Gradle / Ivy

Go to download

The code in this module is not explicitly related to clustering, but rather contains resuable code used by clustering modules and any modules that integrate with clustering.

There is a newer version: 33.0.2.Final
Show newest version
/*
 * Copyright The WildFly Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package org.jboss.as.clustering.msc;

import org.jboss.msc.service.ServiceName;
import org.jboss.msc.value.InjectedValue;
import org.wildfly.clustering.service.ServiceNameProvider;
import org.wildfly.clustering.service.ServiceSupplierDependency;

/**
 * Service dependency whose provided value is made available via injection.
 * @author Paul Ferraro
 * @deprecated Replaced by {@link ServiceSupplierDependency}.
 */
@Deprecated(forRemoval = true)
public class InjectedValueDependency extends InjectorDependency implements ValueDependency {

    private final InjectedValue value;

    public InjectedValueDependency(ServiceNameProvider provider, Class targetClass) {
        this(provider.getServiceName(), targetClass, new InjectedValue());
    }

    public InjectedValueDependency(ServiceName name, Class targetClass) {
        this(name, targetClass, new InjectedValue());
    }

    private InjectedValueDependency(ServiceName name, Class targetClass, InjectedValue value) {
        super(name, targetClass, value);
        this.value = value;
    }

    @Override
    public T getValue() {
        return this.value.getValue();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy