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

colesico.framework.dslvalidator.t9n.ResourceConfIoclet Maven / Gradle / Ivy

There is a newer version: 5.3.0
Show newest version
// This is automatically generated file. Do not modify!
package colesico.framework.dslvalidator.t9n;

import colesico.framework.assist.LazySingleton;
import colesico.framework.assist.codegen.Genstamp;
import colesico.framework.ioc.InstanceProducingException;
import colesico.framework.ioc.TypeKey;
import colesico.framework.ioc.ioclet.AdvancedIoc;
import colesico.framework.ioc.ioclet.Catalog;
import colesico.framework.ioc.ioclet.Factory;
import colesico.framework.ioc.ioclet.Ioclet;
import colesico.framework.ioc.ioclet.SingletonFactory;
import colesico.framework.resource.ResourceOptionsPrototype;

@Genstamp(
        generator = "colesico.framework.ioc.codegen.generator.IocletGenerator",
        timestamp = "2019-12-20T19:01:47.547Z",
        hashId = "f8837299-e57f-4f92-aa75-26185123d7b9",
        comments = "Producer: ClassElement{originElement=colesico.framework.dslvalidator.t9n.ResourceConfProducer}"
)
public final class ResourceConfIoclet implements Ioclet {
    private final LazySingleton producer = new LazySingleton() {
        @Override
        public final ResourceConfProducer create() {
            return new ResourceConfProducer();
        }
    };

    @Override
    public final String getProducerId() {
        return "colesico.framework.dslvalidator.t9n.ResourceConfProducer";
    }

    @Override
    public final String getRank() {
        return "default";
    }

    /**
     * Factory to produce colesico.framework.resource.ResourceOptionsPrototype class instance
     * Scope: SINGLETON; Custom: null
     * Polyproduce: true
     */
    public Factory getResourceConfFactory0() {
        return new SingletonFactory() {
            private Factory configFac;

            @Override
            public final void setup(final AdvancedIoc ioc) {
                // Initialize dependencies for: colesico.framework.resource.ResourceOptionsPrototype
                this.configFac = ioc.factory(new TypeKey(ResourceConf.class));
            }

            @Override
            public final ResourceOptionsPrototype create(final Object message) {
                try {
                    // Perform instance producing
                    ResourceOptionsPrototype instance = producer.get().getResourceConf(this.configFac.get(message));
                    return instance;
                } catch (InstanceProducingException ipe) {
                    throw ipe;
                } catch (Throwable t) {
                    throw new InstanceProducingException(t, ResourceOptionsPrototype.class);
                }
            }
        };
    }

    /**
     * Factory to produce colesico.framework.dslvalidator.t9n.ResourceConf class instance
     * Scope: UNSCOPED; Custom: null
     */
    public Factory getResourceConfFactory1() {
        return new Factory() {
            @Override
            public final void setup(final AdvancedIoc ioc) {
                // Initialize dependencies for: colesico.framework.dslvalidator.t9n.ResourceConf
            }

            @Override
            public final ResourceConf get(final Object message) {
                try {
                    // Perform instance producing
                    ResourceConf instance = new ResourceConf();
                    // Post construct listeners invocations:
                    return instance;
                } catch (InstanceProducingException ipe) {
                    throw ipe;
                } catch (Throwable t) {
                    throw new InstanceProducingException(t, ResourceConf.class);
                }
            }
        };
    }

    @Override
    public final void addFactories(final Catalog catalog) {
        if(catalog.accept(Catalog.Entry.of(new TypeKey("colesico.framework.resource.ResourceOptionsPrototype"),true))){
            catalog.add(getResourceConfFactory0());
        }

        if(catalog.accept(Catalog.Entry.of(new TypeKey("colesico.framework.dslvalidator.t9n.ResourceConf"),false))){
            catalog.add(getResourceConfFactory1());
        }

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy