- java.lang.Object
-
- org.refcodes.logger.CompositeLoggerFactoryImpl<T>
-
- Type Parameters:
T- The type of theRecordinstances managed by theLogger.
- All Implemented Interfaces:
org.refcodes.factory.LookupFactory<Logger<T>,String>,LoggerFactory<Logger<T>>
public class CompositeLoggerFactoryImpl<T> extends Object
Specialization and instantiateable (non abstract) implementation of theAbstractCompositeLoggerFactorycreating compositeLoggerinstances.
-
-
Constructor Summary
Constructors Constructor Description CompositeLoggerFactoryImpl(LoggerFactory<Logger<T>> aLoggerFactory, int aNumEndpoints)Instantiates a new composite logger factory impl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Logger<T>createCompositeLogger(Logger<T>[] aLoggers)To be implemented by sub-classes, this method creates aCompositeLoggerImpl(or its sub-classes) from the providedLoggerinstances (or its sub-types).LcreateInstance(String aSchemaBody)Creates a compoundLoggercontainingLoggerinstances fabricated by the providedLoggerFactory(as passed to the constructor).LcreateInstance(String aSchemaBody, Map<String,String> aProperties)Creates a compoundLoggercontainingLoggerinstances fabricated by the providedLoggerFactory(as passed to the constructor).protected LoggerFactory<L>getLoggerFactory()TheLoggerFactorywhich to use in order to create the encapsulatedLoggerinstances contained in the compositeLoggerinstances created by theLookupFactory.createInstance(String)orLookupFactory.createInstance(String, Map)methods.protected intgetNumEndpoints()
-
-
-
Constructor Detail
-
CompositeLoggerFactoryImpl
public CompositeLoggerFactoryImpl(LoggerFactory<Logger<T>> aLoggerFactory, int aNumEndpoints)
Instantiates a new composite logger factory impl.- Parameters:
aLoggerFactory- the logger factoryaNumEndpoints- the num endpoints
-
-
Method Detail
-
createCompositeLogger
protected Logger<T> createCompositeLogger(Logger<T>[] aLoggers)
To be implemented by sub-classes, this method creates aCompositeLoggerImpl(or its sub-classes) from the providedLoggerinstances (or its sub-types).
-
createInstance
public L createInstance(String aSchemaBody)
Creates a compoundLoggercontainingLoggerinstances fabricated by the providedLoggerFactory(as passed to the constructor). The provided schema body is used when creating theLoggerinstances with thisLoggerFactory. When creating thoseLoggerinstances 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:
createInstancein interfaceorg.refcodes.factory.LookupFactory<L extends Logger<?>,String>- Parameters:
aSchemaBody- The 'schema'# to be used by theLoggerinstances 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 actualLoggerimplementation returned by theLoggerFactory(as passed to the constructor).- Returns:
- The composite
Loggerinstance as fabricated by thisAbstractCompositeLoggerFactory.
-
createInstance
public L createInstance(String aSchemaBody, Map<String,String> aProperties)
Creates a compoundLoggercontainingLoggerinstances fabricated by the providedLoggerFactory(as passed to the constructor). The provided schema body is used when creating theLoggerinstances with thisLoggerFactory. When creating thoseLoggerinstances 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:
createInstancein interfaceorg.refcodes.factory.LookupFactory<L extends Logger<?>,String>- Parameters:
aSchemaBody- The 'schema'# to be used by theLoggerinstances 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 actualLoggerimplementation 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 encapsulatedLoggerinstances.- Returns:
- The composite
Loggerinstance as fabricated by thisAbstractCompositeLoggerFactory.
-
getNumEndpoints
protected int getNumEndpoints()
-
getLoggerFactory
protected LoggerFactory<L> getLoggerFactory()
TheLoggerFactorywhich to use in order to create the encapsulatedLoggerinstances contained in the compositeLoggerinstances created by theLookupFactory.createInstance(String)orLookupFactory.createInstance(String, Map)methods.- Returns:
- The
LoggerFactoryto be used by theAbstractCompositeLoggerFactorywhen creating the encapsulatedLoggerinstances to be contained in the compositeLoggerinstances..
-
-