- java.lang.Object
-
- org.refcodes.logger.CompositeQueryLoggerFactoryImpl<T>
-
- Type Parameters:
T
- The type of theRecord
instances managed by theLogger
.
- All Implemented Interfaces:
org.refcodes.factory.LookupFactory<QueryLogger<T>,String>
,LoggerFactory<QueryLogger<T>>
public class CompositeQueryLoggerFactoryImpl<T> extends Object
Specialization and instantiateable (non abstract) implementation of theAbstractCompositeLoggerFactory
creating compositeQueryLogger
instances.
-
-
Constructor Summary
Constructors Constructor Description CompositeQueryLoggerFactoryImpl(LoggerFactory<QueryLogger<T>> aLoggerFactory, int aNumEndpoints)
Instantiates a new composite query logger factory impl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected QueryLogger<T>
createCompositeLogger(QueryLogger<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(String aSchemaBody)
Creates a compoundLogger
containingLogger
instances fabricated by the providedLoggerFactory
(as passed to the constructor).L
createInstance(String aSchemaBody, Map<String,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 theLookupFactory.createInstance(String)
orLookupFactory.createInstance(String, Map)
methods.protected int
getNumEndpoints()
-
-
-
Constructor Detail
-
CompositeQueryLoggerFactoryImpl
public CompositeQueryLoggerFactoryImpl(LoggerFactory<QueryLogger<T>> aLoggerFactory, int aNumEndpoints)
Instantiates a new composite query logger factory impl.- Parameters:
aLoggerFactory
- the logger factoryaNumEndpoints
- the num endpoints
-
-
Method Detail
-
createCompositeLogger
protected QueryLogger<T> createCompositeLogger(QueryLogger<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(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<?>,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(String aSchemaBody, Map<String,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<?>,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 theLookupFactory.createInstance(String)
orLookupFactory.createInstance(String, Map)
methods.- Returns:
- The
LoggerFactory
to be used by theAbstractCompositeLoggerFactory
when creating the encapsulatedLogger
instances to be contained in the compositeLogger
instances..
-
-