Class CompositeLoggerImpl<T>

  • Type Parameters:
    T - The type of the Record instances managed by the Logger.
    All Implemented Interfaces:
    java.io.Flushable, org.refcodes.component.Closable, org.refcodes.component.CompositeComponent, org.refcodes.component.Decomposeable, org.refcodes.component.Destroyable, org.refcodes.component.Flushable, org.refcodes.component.Initializable, org.refcodes.component.LifeCycleComponent, org.refcodes.component.LinkComponent, org.refcodes.component.Openable, org.refcodes.component.Pausable, org.refcodes.component.Resetable, org.refcodes.component.Resumable, org.refcodes.component.Startable, org.refcodes.component.Stoppable, LogDecorator, Logger<T>, org.refcodes.mixin.Disposable


    public class CompositeLoggerImpl<T>
    extends java.lang.Object
    implements org.refcodes.component.CompositeComponent
    The CompositeLoggerImpl is a ready to use implementation of a composite Logger extending the AbstractCompositeLogger.
    See Also:
    AbstractCompositeLogger
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.component.Closable

        org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
      • Nested classes/interfaces inherited from interface org.refcodes.component.CompositeComponent

        org.refcodes.component.CompositeComponent.ExtendedCompositeComponent<CTX extends java.lang.Object,CON extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.component.Decomposeable

        org.refcodes.component.Decomposeable.DecomposeAutomaton
      • Nested classes/interfaces inherited from interface org.refcodes.component.Destroyable

        org.refcodes.component.Destroyable.DestroyAutomaton
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.Disposable

        org.refcodes.mixin.Disposable.Disposedable
      • Nested classes/interfaces inherited from interface org.refcodes.component.Flushable

        org.refcodes.component.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>
      • Nested classes/interfaces inherited from interface org.refcodes.component.Initializable

        org.refcodes.component.Initializable.InitializeAutomaton, org.refcodes.component.Initializable.InitializeBuilder<B extends org.refcodes.component.Initializable.InitializeBuilder<B>>, org.refcodes.component.Initializable.UncheckedInitializable
      • Nested classes/interfaces inherited from interface org.refcodes.component.LifeCycleComponent

        org.refcodes.component.LifeCycleComponent.LifeCycleAutomaton, org.refcodes.component.LifeCycleComponent.UncheckedLifeCycleComponent
      • Nested classes/interfaces inherited from interface org.refcodes.component.LinkComponent

        org.refcodes.component.LinkComponent.LinkAutomaton, org.refcodes.component.LinkComponent.LinkComponentBuilder<B extends org.refcodes.component.LinkComponent.LinkComponentBuilder<B>>
      • Nested classes/interfaces inherited from interface org.refcodes.component.Openable

        org.refcodes.component.Openable.OpenAutomaton, org.refcodes.component.Openable.OpenBuilder<B extends org.refcodes.component.Openable.OpenBuilder<B>>
      • Nested classes/interfaces inherited from interface org.refcodes.component.Pausable

        org.refcodes.component.Pausable.PauseAutomaton, org.refcodes.component.Pausable.PauseBuilder<B extends org.refcodes.component.Pausable.PauseBuilder<B>>, org.refcodes.component.Pausable.UncheckedPausable
      • Nested classes/interfaces inherited from interface org.refcodes.component.Resumable

        org.refcodes.component.Resumable.ResumeAutomaton, org.refcodes.component.Resumable.ResumeBuilder<B extends org.refcodes.component.Resumable.ResumeBuilder<B>>, org.refcodes.component.Resumable.UncheckedResumable
      • Nested classes/interfaces inherited from interface org.refcodes.component.Startable

        org.refcodes.component.Startable.StartAutomaton, org.refcodes.component.Startable.StartBuilder<B extends org.refcodes.component.Startable.StartBuilder<B>>, org.refcodes.component.Startable.UncheckedStartable
      • Nested classes/interfaces inherited from interface org.refcodes.component.Stoppable

        org.refcodes.component.Stoppable.StopAutomaton, org.refcodes.component.Stoppable.StopBuilder<B extends org.refcodes.component.Stoppable.StopBuilder<B>>, org.refcodes.component.Stoppable.UncheckedStoppable
    • Constructor Summary

      Constructors 
      Constructor Description
      CompositeLoggerImpl​(org.refcodes.controlflow.ExecutionStrategy aComponentExecutionStrategy, Logger<T>... aLoggers)
      Similar to the CompositeLoggerImpl(Logger...) with the additional option of determining the execution strategy of the state change request calls for the encapsulated Logger instances (as of CompositeComponent).
      CompositeLoggerImpl​(Logger<T>... aLoggers)
      Instantiates a new composite logger impl.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close​()
      void decompose​()
      void destroy​()
      void dispose​()
      void flush​()
      protected java.util.Collection<L> getLoggers​()
      Gets the loggers.
      void initialize​()
      void log​(org.refcodes.tabular.Record<? extends T> aRecord)
      Logs a Record.
      void open​()
      void pause​()
      void reset​()
      void resume​()
      void start​()
      void stop​()
      • Methods inherited from interface org.refcodes.component.Closable

        closeIn, closeQuietly, closeUnchecked
      • Methods inherited from interface org.refcodes.component.Flushable

        flushUnchecked, isFlushable
      • Methods inherited from interface org.refcodes.component.Initializable

        initializeUnchecked
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.refcodes.component.Openable

        openUnchecked
      • Methods inherited from interface org.refcodes.component.Pausable

        pauseUnchecked
      • Methods inherited from interface org.refcodes.component.Resumable

        resumeUnchecked
      • Methods inherited from interface org.refcodes.component.Startable

        startUnchecked
      • Methods inherited from interface org.refcodes.component.Stoppable

        stopUnchecked
    • Constructor Detail

      • CompositeLoggerImpl

        @SafeVarargs
        public CompositeLoggerImpl​(Logger<T>... aLoggers)
        Instantiates a new composite logger impl.
        Parameters:
        aLoggers - the loggers
        See Also:
        AbstractCompositeLogger(Logger...)
      • CompositeLoggerImpl

        @SafeVarargs
        public CompositeLoggerImpl​(org.refcodes.controlflow.ExecutionStrategy aComponentExecutionStrategy,
                                   Logger<T>... aLoggers)
        Similar to the CompositeLoggerImpl(Logger...) with the additional option of determining the execution strategy of the state change request calls for the encapsulated Logger instances (as of CompositeComponent).
        Parameters:
        aComponentExecutionStrategy - The strategy to be used when invoking a component's (encapsulated Logger instance's) state change request call (as of CompositeComponent).
    • Method Detail

      • initialize

        public void initialize​()
                        throws org.refcodes.component.InitializeException
        Specified by:
        initialize in interface org.refcodes.component.Initializable
        Throws:
        org.refcodes.component.InitializeException
      • start

        public void start​()
                   throws org.refcodes.component.StartException
        Specified by:
        start in interface org.refcodes.component.Startable
        Throws:
        org.refcodes.component.StartException
      • pause

        public void pause​()
                   throws org.refcodes.component.PauseException
        Specified by:
        pause in interface org.refcodes.component.Pausable
        Throws:
        org.refcodes.component.PauseException
      • resume

        public void resume​()
                    throws org.refcodes.component.ResumeException
        Specified by:
        resume in interface org.refcodes.component.Resumable
        Throws:
        org.refcodes.component.ResumeException
      • stop

        public void stop​()
                  throws org.refcodes.component.StopException
        Specified by:
        stop in interface org.refcodes.component.Stoppable
        Throws:
        org.refcodes.component.StopException
      • decompose

        public void decompose​()
        Specified by:
        decompose in interface org.refcodes.component.Decomposeable
      • flush

        public void flush​()
                   throws org.refcodes.component.OpenException
        Specified by:
        flush in interface java.io.Flushable
        Specified by:
        flush in interface org.refcodes.component.Flushable
        Throws:
        org.refcodes.component.OpenException
      • destroy

        public void destroy​()
        Specified by:
        destroy in interface org.refcodes.component.Destroyable
      • reset

        public void reset​()
        Specified by:
        reset in interface org.refcodes.component.Resetable
      • open

        public void open​()
                  throws org.refcodes.component.OpenException
        Specified by:
        open in interface org.refcodes.component.Openable
        Throws:
        org.refcodes.component.OpenException
      • close

        public void close​()
        Specified by:
        close in interface org.refcodes.component.Closable
      • dispose

        public void dispose​()
        Specified by:
        dispose in interface org.refcodes.mixin.Disposable
      • log

        public void log​(org.refcodes.tabular.Record<? extends T> aRecord)
                 throws IllegalRecordRuntimeException,
                        UnexpectedLogRuntimeException
        Logs a Record. The targeted data sink for the Record instances (where them are physically stored) depends on the implementation of the Logger. It can be a console, a file, a stream or a database.
        Specified by:
        log in interface Logger<L extends Logger<T>>
        Parameters:
        aRecord - The Record to be logged.
        Throws:
        IllegalRecordRuntimeException - Thrown in case the record cannot be logged as a specific implementation might expect some dedicated Column instances to be contained in the provided Record.
        UnexpectedLogRuntimeException - Thrown in case some other problems regarding logging occurred, e.g. the data sink (physical system where to log to) experiences problems.
      • getLoggers

        protected java.util.Collection<L> getLoggers​()
        Gets the loggers.
        Returns:
        the loggers