Package io.github.factoryfx.factory
Class FactoryBase<L,R extends FactoryBase<?,R>>
- java.lang.Object
-
- io.github.factoryfx.factory.FactoryBase<L,R>
-
- Type Parameters:
L- liveobject created from this factoryR- root factory
- Direct Known Subclasses:
ParametrizedObjectCreatorFactory,PolymorphicFactoryBase,SimpleFactoryBase
public class FactoryBase<L,R extends FactoryBase<?,R>> extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFactoryBase.AttributeMatchVisitor<V>static interfaceFactoryBase.BiCopyAttributeVisitor<V>static classFactoryBase.DataConfigurationstatic classFactoryBase.Internal<L,R extends FactoryBase<?,R>>static classFactoryBase.LifeCycleConfig<L,R extends FactoryBase<?,R>>static interfaceFactoryBase.TriAttributeVisitor<V>static classFactoryBase.UtilityFactory<L,R extends FactoryBase<?,R>>
-
Constructor Summary
Constructors Constructor Description FactoryBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FactoryBase.DataConfigurationconfig()data configurations api.protected FactoryBase.LifeCycleConfig<L,R>configLifeCycle()life cycle configurations api
Update Order
1.java.util.UUIDgetId()booleanidEquals(FactoryBase<?,?> factory)compares idsFactoryBase.Internal<L,R>internal()internal methods should be only used from the framework. They may change in the Future.FactoryBase.UtilityFactory<L,R>utility()
-
-
-
Method Detail
-
getId
public java.util.UUID getId()
-
idEquals
public boolean idEquals(FactoryBase<?,?> factory)
compares ids- Parameters:
factory- factory- Returns:
- true if id are equals
-
config
protected FactoryBase.DataConfiguration config()
data configurations api. Should be used in the default constructor- Returns:
- the configuration api
-
internal
public FactoryBase.Internal<L,R> internal()
internal methods should be only used from the framework. They may change in the Future. There is no fitting visibility in java therefore this workaround.- Returns:
- the internal api
-
configLifeCycle
protected FactoryBase.LifeCycleConfig<L,R> configLifeCycle()
life cycle configurations api
Update Order
1. recreate for changed, create for new
2. destroy removed and updated
3. start new
The goal is to keep the time between destroy and start as short as possible cause that's essentially the application downtime. Therefore slow operation should be executed in create.
Once usable resources like ports should be claimed in start and released in destroy
should be used in the default constructor- Returns:
- configuration api
-
utility
public FactoryBase.UtilityFactory<L,R> utility()
-
-