View Javadoc
1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.classic.spi;
15  
16  import java.io.Serializable;
17  
18  import ch.qos.logback.classic.LoggerContext;
19  
20  /**
21   * An interface that allows Logger objects and LoggerSer objects to be used the
22   * same way be client of the LoggingEvent object.
23   * <p>
24   * See {@link LoggerContextVO} for the rationale of this class.
25   * 
26   * @author Ceki G&uuml;lc&uuml;
27   * @author S&eacute;bastien Pennec
28   */
29  public class LoggerRemoteView implements Serializable {
30  
31      private static final long serialVersionUID = 5028223666108713696L;
32  
33      final LoggerContextVO loggerContextView;
34      final String name;
35  
36      public LoggerRemoteView(String name, LoggerContext lc) {
37          this.name = name;
38          assert lc.getLoggerContextRemoteView() != null;
39          loggerContextView = lc.getLoggerContextRemoteView();
40      }
41  
42      public LoggerContextVO getLoggerContextView() {
43          return loggerContextView;
44      }
45  
46      public String getName() {
47          return name;
48      }
49  
50  }