Package org.refcodes.logger
Class CompositeTrimLoggerFactoryImpl<T>
- java.lang.Object
-
- org.refcodes.logger.CompositeTrimLoggerFactoryImpl<T>
-
- Type Parameters:
T
- The type of theRecord
instances managed by theLogger
.
- All Implemented Interfaces:
org.refcodes.factory.LookupFactory<TrimLogger<T>,java.lang.String>
,LoggerFactory<TrimLogger<T>>
public class CompositeTrimLoggerFactoryImpl<T> extends java.lang.Object
Specialization and instantiateable (non abstract) implementation of theAbstractCompositeLoggerFactory
creating compositeTrimLogger
instances.
-
-
Constructor Summary
Constructors Constructor Description CompositeTrimLoggerFactoryImpl(LoggerFactory<TrimLogger<T>> aLoggerFactory, int aNumEndpoints)
Instantiates a new composite trim logger factory impl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TrimLogger<T>
createCompositeLogger(TrimLogger<T>[] aLoggers)
To be implemented by sub-classes, this method creates aCompositeLoggerImpl
(or its sub-classes) from the providedLogger
instances (or its sub-types).L
createInstance(java.lang.String aSchemaBody)
Creates a compoundLogger
containingLogger
instances fabricated by the providedLoggerFactory
(as passed to the constructor).L
createInstance(java.lang.String aSchemaBody, java.util.Map<java.lang.String,java.lang.String> aProperties)
Creates a compoundLogger
containingLogger
instances fabricated by the providedLoggerFactory
(as passed to the constructor).protected LoggerFactory<L>
getLoggerFactory()
TheLoggerFactory
which to use in order to create the encapsulatedLogger
instances contained in the compositeLogger
instances created by thecreateInstance(String)
orcreateInstance(String, Map)
methods.protected int
getNumEndpoints()
-
-
-
Constructor Detail
-
CompositeTrimLoggerFactoryImpl
public CompositeTrimLoggerFactoryImpl(LoggerFactory<TrimLogger<T>> aLoggerFactory, int aNumEndpoints)
Instantiates a new composite trim logger factory impl.- Parameters:
aLoggerFactory
- the logger factoryaNumEndpoints
- the num endpoints
-
-
Method Detail
-
createCompositeLogger
protected TrimLogger<T> createCompositeLogger(TrimLogger<T>[] aLoggers)
To be implemented by sub-classes, this method creates aCompositeLoggerImpl
(or its sub-classes) from the providedLogger
instances (or its sub-types).
-
createInstance
public L createInstance(java.lang.String aSchemaBody)
Creates a compoundLogger
containingLogger
instances fabricated by the providedLoggerFactory
(as passed to the constructor). The provided schema body is used when creating theLogger
instances with thisLoggerFactory
. When creating thoseLogger
instances by the providedLoggerFactory
(as passed to the constructor), the schema body is suffixed by a '.###' for each instance where "###" represents the actual number of an individual instance. Numbers reach from '000' to the actual number of endpoints provided to the constructor.- Specified by:
createInstance
in interfaceorg.refcodes.factory.LookupFactory<L extends Logger<?>,java.lang.String>
- Parameters:
aSchemaBody
- The 'schema'# to be used by theLogger
instances created by the providedLoggerFactory
(as passed to the constructor). The schema body may be part of a DB schema name or a SimpleDB domain name, this depends on the actualLogger
implementation returned by theLoggerFactory
(as passed to the constructor).- Returns:
- The composite
Logger
instance as fabricated by thisAbstractCompositeLoggerFactory
.
-
createInstance
public L createInstance(java.lang.String aSchemaBody, java.util.Map<java.lang.String,java.lang.String> aProperties)
Creates a compoundLogger
containingLogger
instances fabricated by the providedLoggerFactory
(as passed to the constructor). The provided schema body is used when creating theLogger
instances with thisLoggerFactory
. When creating thoseLogger
instances by the providedLoggerFactory
(as passed to the constructor), the schema body is suffixed by a '.###' for each instance where "###" represents the actual number of an individual instance. Numbers reach from '000' to the actual number of endpoints provided to the constructor.- Specified by:
createInstance
in interfaceorg.refcodes.factory.LookupFactory<L extends Logger<?>,java.lang.String>
- Parameters:
aSchemaBody
- The 'schema'# to be used by theLogger
instances created by the providedLoggerFactory
(as passed to the constructor). The schema body may be part of a DB schema name or a SimpleDB domain name, this depends on the actualLogger
implementation returned by theLoggerFactory
(as passed to the constructor).aProperties
- Properties which may be used to pass additional configuration settings to theLoggerFactory
(as passed to the constructor) when creating the encapsulatedLogger
instances.- Returns:
- The composite
Logger
instance as fabricated by thisAbstractCompositeLoggerFactory
.
-
getNumEndpoints
protected int getNumEndpoints()
-
getLoggerFactory
protected LoggerFactory<L> getLoggerFactory()
TheLoggerFactory
which to use in order to create the encapsulatedLogger
instances contained in the compositeLogger
instances created by thecreateInstance(String)
orcreateInstance(String, Map)
methods.- Returns:
- The
LoggerFactory
to be used by theAbstractCompositeLoggerFactory
when creating the encapsulatedLogger
instances to be contained in the compositeLogger
instances..
-
-