colesico.framework.weblet.t9n.ResourceConfIoclet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of colesico-weblet Show documentation
Show all versions of colesico-weblet Show documentation
Colesico framework http requests handling service
// This is automatically generated file. Do not modify!
package colesico.framework.weblet.t9n;
import colesico.framework.assist.LazySingleton;
import colesico.framework.assist.codegen.Genstamp;
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.ioc.key.TypeKey;
import colesico.framework.ioc.production.InstanceProducingException;
import colesico.framework.resource.ResourceOptionsPrototype;
@Genstamp(
generator = "colesico.framework.ioc.codegen.generator.IocletGenerator",
timestamp = "2020-04-23T17:31:26.291Z",
hashId = "31eda4bb-5df6-425a-8d75-fa168642590e",
comments = "Producer: ClassElement{originElement=colesico.framework.weblet.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 getId() {
return "colesico.framework.weblet.t9n.ResourceConfProducer";
}
/**
* 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.weblet.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.weblet.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(new TypeKey("colesico.framework.resource.ResourceOptionsPrototype"), null, null, true)){
catalog.add(getResourceConfFactory0());
}
if(catalog.accept(new TypeKey("colesico.framework.weblet.t9n.ResourceConf"), null, null, false)){
catalog.add(getResourceConfFactory1());
}
}
}