org.jboss.as.clustering.msc.InjectedValueDependency Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wildfly-clustering-common Show documentation
Show all versions of wildfly-clustering-common Show documentation
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.
/*
* 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();
}
}