L
- The type (sub-type) of the Logger
to be created.public abstract class AbstractCompositeLoggerFactory<L extends Logger<?>> extends Object implements LoggerFactory<L>
AbstractCompositeLoggerFactory
is a LoggerFactory
which
creates composite Logger
instances, which themselves encapsulate
Logger
instances. The factory methods createInstance(String)
and createInstance(String)
actually return composite Logger
instances which in turn contain Logger
instances being created by the
provided LoggerFactory
.Constructor and Description |
---|
AbstractCompositeLoggerFactory(LoggerFactory<L> aLoggerFactory,
int aNumEndpoints)
Constructs a
AbstractCompositeLoggerFactory specifying the number
of Logger instances to be encapsulated by the created composites
to when invoking the methods createInstance(String) or
createInstance(String, Properties) . |
Modifier and Type | Method and Description |
---|---|
protected abstract L |
createCompositeLogger(L[] 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). |
L |
createInstance(String aSchemaBody)
Creates a compound
Logger containing Logger instances
fabricated by the provided LoggerFactory (as passed to the
constructor). |
L |
createInstance(String aSchemaBody,
Properties aProperties)
Creates a compound
Logger containing Logger instances
fabricated by the provided LoggerFactory (as passed to the
constructor). |
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 createInstance(String)
or createInstance(String, Properties) methods. |
protected int |
getNumEndpoints()
|
public AbstractCompositeLoggerFactory(LoggerFactory<L> aLoggerFactory, int aNumEndpoints)
AbstractCompositeLoggerFactory
specifying the number
of Logger
instances to be encapsulated by the created composites
to when invoking the methods createInstance(String)
or
createInstance(String, Properties)
. The provided
LoggerFactory
(as passed to the constructor) actually creates the
Logger
instances encapsulated in the composite, backed by a
physical data sink (or other composite or parted Logger
instances).aLoggerFactory
- The LoggerFactory
to create the (atomic)
Logger
instances (or other composite or parted
Logger
instances).aNumEndpoints
- The number of Logger
instances to be
included for each composite returned by the
createInstance(String)
or the
createInstance(String, Properties)
methods.public L createInstance(String aSchemaBody)
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.createInstance
in interface org.refcodes.factory.TypedLookupIdFactory<L extends Logger<?>,String>
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).Logger
instance as fabricated by this
AbstractCompositeLoggerFactory
.public L createInstance(String aSchemaBody, Properties aProperties)
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.createInstance
in interface org.refcodes.factory.TypedLookupIdFactory<L extends Logger<?>,String>
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.Logger
instance as fabricated by this
AbstractCompositeLoggerFactory
.protected abstract L createCompositeLogger(L[] aLoggers)
CompositeLoggerImpl
(or its sub-classes) from the provided
Logger
instances (or its sub-types).protected int getNumEndpoints()
protected LoggerFactory<L> getLoggerFactory()
LoggerFactory
which to use in order to create the
encapsulated Logger
instances contained in the composite
Logger
instances created by the createInstance(String)
or createInstance(String, Properties)
methods.LoggerFactory
to be used by the
AbstractCompositeLoggerFactory
when creating the
encapsulated Logger
instances to be contained in the
composite Logger
instances..Copyright © 2016. All rights reserved.