Class TrimLoggerFactoryComposite<T>

java.lang.Object
org.refcodes.logger.TrimLoggerFactoryComposite<T>
Type Parameters:
T - The type of the Record instances managed by the Logger.
All Implemented Interfaces:
org.refcodes.factory.LookupFactory<TrimLogger<T>,String>, LoggerFactory<TrimLogger<T>>

public class TrimLoggerFactoryComposite<T> extends Object
Specialization and instantiateable (non abstract) implementation of the AbstractLoggerFactoryComposite creating composite TrimLogger instances.
  • Constructor Details

    • TrimLoggerFactoryComposite

      public TrimLoggerFactoryComposite(LoggerFactory<TrimLogger<T>> aLoggerFactory, int aNumEndpoints)
      Instantiates a new composite trim logger factory impl.
      Parameters:
      aLoggerFactory - the LoggerFactory populating this composite.
      aNumEndpoints - the num endpoints
  • Method Details

    • createCompositeLogger

      protected TrimLogger<T> createCompositeLogger(TrimLogger<T>[] aLoggers)
      To be implemented by sub-classes, this method creates a LoggerComposite (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 TrimLogger<T> 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 AbstractLoggerFactoryComposite.
    • createInstance

      public TrimLogger<T> 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 AbstractLoggerFactoryComposite.
    • 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<TrimLogger<T>> 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 AbstractLoggerFactoryComposite when creating the encapsulated Logger instances to be contained in the composite Logger instances..