Class CompositeQueryLoggerFactoryImpl<T>

  • Type Parameters:
    T - The type of the Record instances managed by the Logger.
    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 the AbstractCompositeLoggerFactory creating composite QueryLogger instances.
    • Constructor Detail

      • CompositeQueryLoggerFactoryImpl

        public CompositeQueryLoggerFactoryImpl​(LoggerFactory<QueryLogger<T>> aLoggerFactory,
                                               int aNumEndpoints)
        Instantiates a new composite query logger factory impl.
        Parameters:
        aLoggerFactory - the logger factory
        aNumEndpoints - the num endpoints
    • Method Detail

      • createCompositeLogger

        protected QueryLogger<T> createCompositeLogger​(QueryLogger<T>[] aLoggers)
        To be implemented by sub-classes, this method creates a CompositeLoggerImpl (or its sub-classes) from the provided Logger instances (or its sub-types).
        Parameters:
        aLoggers - The Logger instances (or its sub-types) to be contained in the composite.
        Returns:
        The composite containing the given Logger instances.
      • createInstance

        public L createInstance​(String aSchemaBody)
        Creates a compound Logger containing Logger instances fabricated by the provided LoggerFactory (as passed to the constructor). The provided schema body is used when creating the Logger instances with this LoggerFactory. When creating those Logger instances by the provided LoggerFactory (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 interface org.refcodes.factory.LookupFactory<L extends Logger<?>,​String>
        Parameters:
        aSchemaBody - The 'schema'# to be used by the Logger instances created by the provided LoggerFactory (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 actual Logger implementation returned by the LoggerFactory (as passed to the constructor).
        Returns:
        The composite Logger instance as fabricated by this AbstractCompositeLoggerFactory.
      • createInstance

        public L createInstance​(String aSchemaBody,
                                Map<String,​String> aProperties)
        Creates a compound Logger containing Logger instances fabricated by the provided LoggerFactory (as passed to the constructor). The provided schema body is used when creating the Logger instances with this LoggerFactory. When creating those Logger instances by the provided LoggerFactory (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 interface org.refcodes.factory.LookupFactory<L extends Logger<?>,​String>
        Parameters:
        aSchemaBody - The 'schema'# to be used by the Logger instances created by the provided LoggerFactory (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 actual Logger implementation returned by the LoggerFactory (as passed to the constructor).
        aProperties - Properties which may be used to pass additional configuration settings to the LoggerFactory (as passed to the constructor) when creating the encapsulated Logger instances.
        Returns:
        The composite Logger instance as fabricated by this AbstractCompositeLoggerFactory.
      • getNumEndpoints

        protected int getNumEndpoints()
        Retrieves the number if Logger instances to be created when creating a composite Logger.
        Returns:
        The number of Logger instances to be contained in the composite Logger.
      • getLoggerFactory

        protected LoggerFactory<L> getLoggerFactory()
        The LoggerFactory which to use in order to create the encapsulated Logger instances contained in the composite Logger instances created by the LookupFactory.createInstance(String) or LookupFactory.createInstance(String, Map) methods.
        Returns:
        The LoggerFactory to be used by the AbstractCompositeLoggerFactory when creating the encapsulated Logger instances to be contained in the composite Logger instances..