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

colesico.framework.telehttp.internal.WritersIoclet Maven / Gradle / Ivy

// This is automatically generated file. Do not modify!
package colesico.framework.telehttp.internal;

import colesico.framework.assist.LazySingleton;
import colesico.framework.assist.codegen.Genstamp;
import colesico.framework.http.CookieFactory;
import colesico.framework.http.HttpContext;
import colesico.framework.ioc.ioclet.AdvancedIoc;
import colesico.framework.ioc.ioclet.Catalog;
import colesico.framework.ioc.ioclet.DefaultProvider;
import colesico.framework.ioc.ioclet.Factory;
import colesico.framework.ioc.ioclet.Ioclet;
import colesico.framework.ioc.ioclet.SingletonFactory;
import colesico.framework.ioc.key.TypeKey;
import colesico.framework.ioc.production.InstanceProducingException;
import colesico.framework.profile.teleapi.ProfileSerializer;
import colesico.framework.security.teleapi.PrincipalSerializer;
import colesico.framework.telehttp.PrincipalHttpConfigPrototype;
import colesico.framework.telehttp.ProfileHttpConfigPrototype;
import colesico.framework.telehttp.writer.PlainTextWriter;
import colesico.framework.telehttp.writer.PrincipalWriter;
import colesico.framework.telehttp.writer.ProfileWriter;

@Genstamp(
        generator = "colesico.framework.ioc.codegen.generator.IocletGenerator",
        timestamp = "2023-11-27T16:01:26.485Z",
        hashId = "b8ee61e7-bdd3-455e-8cf4-dfc3cce93816",
        comments = "Producer: colesico.framework.telehttp.internal.WritersProducer"
)
public final class WritersIoclet implements Ioclet {
    private final LazySingleton producer = new LazySingleton() {
        @Override
        public final WritersProducer create() {
            return new WritersProducer();
        }
    };

    @Override
    public final String getId() {
        return "colesico.framework.telehttp.internal.WritersProducer";
    }

    /**
     * Factory to produce colesico.framework.telehttp.writer.PlainTextWriter class instance
     * Scope: SINGLETON; Custom: null
     */
    public Factory getPlainTextWriterFactory0() {
        return new SingletonFactory() {
            private Factory httpContextProvFac;

            @Override
            public final void setup(final AdvancedIoc ioc) {
                // Initialize dependencies for: colesico.framework.telehttp.writer.PlainTextWriter
                this.httpContextProvFac = ioc.factory(new TypeKey("colesico.framework.http.HttpContext"));
            }

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

    /**
     * Factory to produce colesico.framework.telehttp.writer.PrincipalWriter class instance
     * Scope: SINGLETON; Custom: null
     */
    public Factory getPrincipalWriterFactory1() {
        return new SingletonFactory() {
            private Factory httpContextProvFac;

            private Factory configFac;

            private Factory httpContextProv1Fac;

            private Factory principalSerializerFac;

            private Factory cookieFactoryFac;

            @Override
            public final void setup(final AdvancedIoc ioc) {
                // Initialize dependencies for: colesico.framework.telehttp.writer.PrincipalWriter
                this.httpContextProvFac = ioc.factory(new TypeKey("colesico.framework.http.HttpContext"));
                this.configFac = ioc.factory(new TypeKey("colesico.framework.telehttp.PrincipalHttpConfigPrototype"));
                this.httpContextProv1Fac = ioc.factory(new TypeKey("colesico.framework.http.HttpContext"));
                this.principalSerializerFac = ioc.factory(new TypeKey("colesico.framework.security.teleapi.PrincipalSerializer"));
                this.cookieFactoryFac = ioc.factory(new TypeKey("colesico.framework.http.CookieFactory"));
            }

            @Override
            public final PrincipalWriter create(final Object message) {
                try {
                    // Perform instance producing
                    PrincipalWriter instance = new PrincipalWriter(new DefaultProvider(this.httpContextProvFac,message),this.configFac.get(message),new DefaultProvider(this.httpContextProv1Fac,message),this.principalSerializerFac.get(message),this.cookieFactoryFac.get(message));
                    // Post construct listeners invocations:
                    return instance;
                } catch (InstanceProducingException ipe) {
                    throw ipe;
                } catch (Throwable t) {
                    throw new InstanceProducingException(t, PrincipalWriter.class);
                }
            }
        };
    }

    /**
     * Factory to produce colesico.framework.telehttp.writer.ProfileWriter class instance
     * Scope: SINGLETON; Custom: null
     */
    public Factory getProfileWriterFactory2() {
        return new SingletonFactory() {
            private Factory httpContextProvFac;

            private Factory configFac;

            private Factory profileSerializerFac;

            private Factory cookieFactoryFac;

            @Override
            public final void setup(final AdvancedIoc ioc) {
                // Initialize dependencies for: colesico.framework.telehttp.writer.ProfileWriter
                this.httpContextProvFac = ioc.factory(new TypeKey("colesico.framework.http.HttpContext"));
                this.configFac = ioc.factory(new TypeKey("colesico.framework.telehttp.ProfileHttpConfigPrototype"));
                this.profileSerializerFac = ioc.factory(new TypeKey("colesico.framework.profile.teleapi.ProfileSerializer"));
                this.cookieFactoryFac = ioc.factory(new TypeKey("colesico.framework.http.CookieFactory"));
            }

            @Override
            public final ProfileWriter create(final Object message) {
                try {
                    // Perform instance producing
                    ProfileWriter instance = new ProfileWriter(new DefaultProvider(this.httpContextProvFac,message),this.configFac.get(message),this.profileSerializerFac.get(message),this.cookieFactoryFac.get(message));
                    // Post construct listeners invocations:
                    return instance;
                } catch (InstanceProducingException ipe) {
                    throw ipe;
                } catch (Throwable t) {
                    throw new InstanceProducingException(t, ProfileWriter.class);
                }
            }
        };
    }

    @Override
    public final void addFactories(final Catalog catalog) {
        if(catalog.accept(new TypeKey("colesico.framework.telehttp.writer.PlainTextWriter"), null, null, false)){
            catalog.add(getPlainTextWriterFactory0());
        }

        if(catalog.accept(new TypeKey("colesico.framework.telehttp.writer.PrincipalWriter"), null, null, false)){
            catalog.add(getPrincipalWriterFactory1());
        }

        if(catalog.accept(new TypeKey("colesico.framework.telehttp.writer.ProfileWriter"), null, null, false)){
            catalog.add(getProfileWriterFactory2());
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy