io.quarkus.resteasy.reactive.common.runtime.ArcBeanFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-resteasy-reactive-common Show documentation
Show all versions of quarkus-resteasy-reactive-common Show documentation
Common runtime parts of Quarkus RESTEasy Reactive
package io.quarkus.resteasy.reactive.common.runtime;
import org.jboss.resteasy.reactive.spi.BeanFactory;
import io.quarkus.arc.runtime.BeanContainer;
public class ArcBeanFactory implements BeanFactory {
private final BeanContainer.Factory factory;
// for toString
private final String targetClassName;
public ArcBeanFactory(Class target, BeanContainer beanContainer) {
targetClassName = target.getName();
factory = beanContainer.instanceFactory(target);
}
@Override
public String toString() {
return "ArcBeanFactory[" + targetClassName + "]";
}
@Override
public BeanInstance createInstance() {
BeanContainer.Instance instance = factory.create();
return new BeanInstance() {
@Override
public T getInstance() {
return instance.get();
}
@Override
public void close() {
instance.close();
}
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy