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

org.jboss.resteasy.reactive.spi.BeanFactory Maven / Gradle / Ivy

There is a newer version: 3.17.0.CR1
Show newest version
package org.jboss.resteasy.reactive.spi;

import java.io.Closeable;
import java.io.IOException;
import java.util.Collection;

public interface BeanFactory {

    /**
     * Creates an endpoint instance outside the scope of a request
     */
    BeanInstance createInstance();

    interface BeanInstance extends AutoCloseable {

        T getInstance();

        void close();

        class ClosingTask implements Closeable {
            private final Collection> instances;

            public ClosingTask(Collection> instances) {
                this.instances = instances;
            }

            @Override
            public void close() throws IOException {
                for (BeanFactory.BeanInstance i : instances) {
                    i.close();
                }
            }
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy