| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.4) on Fri Sep 20 12:10:30 CEST 2019 --> |
| <title>WarningListeners (Apache SIS 1.0 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2019-09-20"> |
| <meta name="keywords" content="org.apache.sis.util.logging.WarningListeners class"> |
| <meta name="keywords" content="getSource()"> |
| <meta name="keywords" content="getLocale()"> |
| <meta name="keywords" content="getLogger()"> |
| <meta name="keywords" content="warning()"> |
| <meta name="keywords" content="addWarningListener()"> |
| <meta name="keywords" content="removeWarningListener()"> |
| <meta name="keywords" content="getListeners()"> |
| <meta name="keywords" content="hasListeners()"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../sis.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="WarningListeners (Apache SIS 1.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":42,"i1":42,"i2":42,"i3":42,"i4":42,"i5":42,"i6":42,"i7":42,"i8":42,"i9":42}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../../"; |
| var useModuleDirectories = false; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/WarningListeners.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.sis.util.logging</a></div> |
| <h2 title="Class WarningListeners" class="title">Class WarningListeners<S></h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>WarningListeners<S></li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>S</code> - the type of the source of warnings.</dd> |
| </dl> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code><a href="../Localized.html" title="interface in org.apache.sis.util">Localized</a></code></dd> |
| </dl> |
| <dl> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><code><a href="../../storage/event/StoreListeners.html" title="class in org.apache.sis.storage.event">StoreListeners</a></code></dd> |
| </dl> |
| <hr> |
| <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang" class="externalLink">@Deprecated</a> |
| public class <span class="typeNameLabel">WarningListeners<S></span> |
| extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> |
| implements <a href="../Localized.html" title="interface in org.apache.sis.util">Localized</a></pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="deprecationComment">Replaced by <a href="../../storage/event/StoreListeners.html" title="class in org.apache.sis.storage.event"><code>StoreListeners</code></a>.</div> |
| </div> |
| <div class="block">Holds a list of <a href="WarningListener.html" title="interface in org.apache.sis.util.logging"><code>WarningListener</code></a> instances and provides convenience methods for emitting warnings. |
| This is a helper class for <a href="../../storage/DataStore.html" title="class in org.apache.sis.storage"><code>DataStore</code></a> implementations or for other services |
| susceptible to emit warnings. |
| Observers can <a href="#addWarningListener(org.apache.sis.util.logging.WarningListener)">can add listeners</a> for being notified about warnings, and |
| processes can invoke one of the <code>warning(…)</code> methods for emitting warnings. All warnings are given |
| to the listeners as <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogRecord.html?is-external=true" title="class or interface in java.util.logging" class="externalLink"><code>LogRecord</code></a> instances (this allows localizable messages and additional information |
| like <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogRecord.html?is-external=true#getMillis()" title="class or interface in java.util.logging" class="externalLink">timestamp</a> and <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogRecord.html?is-external=true#getThrown()" title="class or interface in java.util.logging" class="externalLink">stack trace</a>). |
| This <code>WarningListeners</code> class provides convenience methods like <a href="#warning(java.lang.String,java.lang.Exception)"><code>warning(String, Exception)</code></a>, |
| which builds <code>LogRecord</code> from an exception or from a string, but all those <code>warning(…)</code> methods |
| ultimately delegate to <a href="#warning(java.util.logging.LogRecord)"><code>warning(LogRecord)</code></a>, thus providing a single point that subclasses can override. |
| When a warning is emitted, the default behavior is: |
| |
| <ul> |
| <li>If at least one <a href="WarningListener.html" title="interface in org.apache.sis.util.logging"><code>WarningListener</code></a> is registered, |
| then all listeners are notified and the warning is <strong>not</strong> logged. |
| <li>Otherwise if the value returned by <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogRecord.html?is-external=true#getLoggerName()" title="class or interface in java.util.logging" class="externalLink"><code>LogRecord.getLoggerName()</code></a> is non-null, |
| then the warning will be logged to that named logger.</li> |
| <li>Otherwise the warning is logged to the logger returned by <a href="#getLogger()"><code>getLogger()</code></a>.</li> |
| </ul> |
| |
| <div class="section">Thread safety</div> |
| The same <code>WarningListeners</code> instance can be safely used by many threads without synchronization |
| on the part of the caller. Subclasses should make sure that any overridden methods remain safe to call |
| from multiple threads.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.3</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="WarningListener.html" title="interface in org.apache.sis.util.logging"><code>WarningListener</code></a>, |
| <a href="../../storage/DataStore.html#listeners"><code>DataStore.listeners</code></a></dd> |
| |
| <p><font size="-1">Defined in the <code>sis-utility</code> module</font></p> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(S)">WarningListeners</a></span>​(<a href="WarningListeners.html" title="type parameter in WarningListeners">S</a> source)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Creates a new instance with initially no listener.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(S,org.apache.sis.util.logging.WarningListeners)">WarningListeners</a></span>​(<a href="WarningListeners.html" title="type parameter in WarningListeners">S</a> source, |
| <a href="WarningListeners.html" title="class in org.apache.sis.util.logging">WarningListeners</a><? super <a href="WarningListeners.html" title="type parameter in WarningListeners">S</a>> other)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Creates a new instance initialized with the same listeners than the given instance.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addWarningListener(org.apache.sis.util.logging.WarningListener)">addWarningListener</a></span>​(<a href="WarningListener.html" title="interface in org.apache.sis.util.logging">WarningListener</a><? super <a href="WarningListeners.html" title="type parameter in WarningListeners">S</a>> listener)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Adds a listener to be notified when a warning occurred.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="WarningListener.html" title="interface in org.apache.sis.util.logging">WarningListener</a><? super <a href="WarningListeners.html" title="type parameter in WarningListeners">S</a>>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getListeners()">getListeners</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Returns all registered warning listeners, or an empty list if none.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util" class="externalLink">Locale</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getLocale()">getLocale</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">The locale to use for formatting warning messages, or <code>null</code> for the default locale.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html?is-external=true" title="class or interface in java.util.logging" class="externalLink">Logger</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getLogger()">getLogger</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Returns the logger where to send the warnings when no other destination is specified.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code><a href="WarningListeners.html" title="type parameter in WarningListeners">S</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSource()">getSource</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Returns the source declared source of warnings.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hasListeners()">hasListeners</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Returns <code>true</code> if this object contains at least one listener.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeWarningListener(org.apache.sis.util.logging.WarningListener)">removeWarningListener</a></span>​(<a href="WarningListener.html" title="interface in org.apache.sis.util.logging">WarningListener</a><? super <a href="WarningListeners.html" title="type parameter in WarningListeners">S</a>> listener)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Removes a previously registered listener.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#warning(java.lang.String,java.lang.Exception)">warning</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> message, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang" class="externalLink">Exception</a> exception)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Reports a warning represented by the given message and exception.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#warning(java.util.logging.Level,java.lang.String,java.lang.Exception)">warning</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html?is-external=true" title="class or interface in java.util.logging" class="externalLink">Level</a> level, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> message, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang" class="externalLink">Exception</a> exception)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Reports a warning at the given level represented by the given message and exception.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#warning(java.util.logging.LogRecord)">warning</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogRecord.html?is-external=true" title="class or interface in java.util.logging" class="externalLink">LogRecord</a> record)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Reports a warning represented by the given log record.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a id="<init>(java.lang.Object)"> |
| <!-- --> |
| </a><a id="<init>(S)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>WarningListeners</h4> |
| <pre>public WarningListeners​(<a href="WarningListeners.html" title="type parameter in WarningListeners">S</a> source)</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Creates a new instance with initially no listener. |
| Warnings will be logger to the destination given by <a href="#getLogger()"><code>getLogger()</code></a>, |
| unless at least one listener is <a href="#addWarningListener(org.apache.sis.util.logging.WarningListener)">registered</a>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>source</code> - the declared source of warnings. This is not necessarily the real source, |
| but this is the source that the implementer wants to declare as public API.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="<init>(java.lang.Object,org.apache.sis.util.logging.WarningListeners)"> |
| <!-- --> |
| </a><a id="<init>(S,org.apache.sis.util.logging.WarningListeners)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>WarningListeners</h4> |
| <pre>public WarningListeners​(<a href="WarningListeners.html" title="type parameter in WarningListeners">S</a> source, |
| <a href="WarningListeners.html" title="class in org.apache.sis.util.logging">WarningListeners</a><? super <a href="WarningListeners.html" title="type parameter in WarningListeners">S</a>> other)</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Creates a new instance initialized with the same listeners than the given instance. |
| This constructor is useful when a <code>DataStore</code> or other data producer needs to |
| be duplicated for concurrency reasons.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>source</code> - the declared source of warnings. This is not necessarily the real source, |
| but this is the source that the implementer wants to declare as public API.</dd> |
| <dd><code>other</code> - the existing instance from which to copy the listeners, or <code>null</code> if none.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.8</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="getSource()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getSource</h4> |
| <pre class="methodSignature">public <a href="WarningListeners.html" title="type parameter in WarningListeners">S</a> getSource()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Returns the source declared source of warnings. |
| This value is specified at construction time.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the declared source of warnings.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.8</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getLocale()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getLocale</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util" class="externalLink">Locale</a> getLocale()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">The locale to use for formatting warning messages, or <code>null</code> for the default locale. |
| If the <code>source</code> object given to the constructor implements the <a href="../Localized.html" title="interface in org.apache.sis.util"><code>Localized</code></a> interface, |
| then this method delegates to its <code>getLocale()</code> method. Otherwise this method returns <code>null</code>.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../Localized.html#getLocale()">getLocale</a></code> in interface <code><a href="../Localized.html" title="interface in org.apache.sis.util">Localized</a></code></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the locale, or <code>null</code> if not explicitly defined.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getLogger()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getLogger</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html?is-external=true" title="class or interface in java.util.logging" class="externalLink">Logger</a> getLogger()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Returns the logger where to send the warnings when no other destination is specified. |
| This logger is used when: |
| |
| <ul> |
| <li>no listener has been <a href="#addWarningListener(org.apache.sis.util.logging.WarningListener)">registered</a>, and</li> |
| <li>the <code>LogRecord</code> does not <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogRecord.html?is-external=true#getLoggerName()" title="class or interface in java.util.logging" class="externalLink">specify a logger</a>.</li> |
| </ul> |
| |
| The default implementation infers a logger name from the package name of the <code>source</code> object. |
| Subclasses should override this method if they can provide a more determinist logger instance, |
| typically from a static final constant.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the logger where to send the warnings when there is no other destination.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="warning(java.util.logging.LogRecord)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>warning</h4> |
| <pre class="methodSignature">public void warning​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogRecord.html?is-external=true" title="class or interface in java.util.logging" class="externalLink">LogRecord</a> record)</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Reports a warning represented by the given log record. The default implementation forwards |
| the given record to <strong>one</strong> of the following destinations, in preference order: |
| |
| <ol> |
| <li><code><a href="WarningListener.html#warningOccured(S,java.util.logging.LogRecord)">WarningListener.warningOccured</a>(source, record)</code> |
| on all <a href="#addWarningListener(org.apache.sis.util.logging.WarningListener)">registered listeners</a> it at least one such listener exists.</li> |
| <li><code><a href="Logging.html#getLogger(java.lang.String)">Logging.getLogger</a>(record.<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogRecord.html?is-external=true#getLoggerName()" title="class or interface in java.util.logging" class="externalLink">getLoggerName()</a>).<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html?is-external=true#log(java.util.logging.LogRecord)" title="class or interface in java.util.logging" class="externalLink">log</a>(record)</code> if the logger name is non-null.</li> |
| <li><code><a href="#getLogger()">getLogger()</a>.<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html?is-external=true#log(java.util.logging.LogRecord)" title="class or interface in java.util.logging" class="externalLink">log</a>(record)</code> otherwise.</li> |
| </ol></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>record</code> - the warning as a log record.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="warning(java.lang.String,java.lang.Exception)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>warning</h4> |
| <pre class="methodSignature">public void warning​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> message, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang" class="externalLink">Exception</a> exception)</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Reports a warning represented by the given message and exception. |
| At least one of <code>message</code> and <code>exception</code> shall be non-null. |
| If both are non-null, then the exception message will be concatenated after the given message. |
| If the exception is non-null, its stack trace will be omitted at logging time for avoiding to |
| pollute console output (keeping in mind that this method should be invoked only for non-fatal |
| warnings). See <a href="#warning(java.util.logging.Level,java.lang.String,java.lang.Exception)">below</a> for more explanation. |
| |
| <p>This method is a shortcut for <code><a href="#warning(java.util.logging.Level,java.lang.String,java.lang.Exception)">warning</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html?is-external=true#WARNING" title="class or interface in java.util.logging" class="externalLink">Level.WARNING</a>, message, exception)</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>message</code> - the message to log, or <code>null</code> if none.</dd> |
| <dd><code>exception</code> - the exception to log, or <code>null</code> if none.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="warning(java.util.logging.Level,java.lang.String,java.lang.Exception)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>warning</h4> |
| <pre class="methodSignature">public void warning​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html?is-external=true" title="class or interface in java.util.logging" class="externalLink">Level</a> level, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> message, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang" class="externalLink">Exception</a> exception)</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Reports a warning at the given level represented by the given message and exception. |
| At least one of <code>message</code> and <code>exception</code> shall be non-null. |
| If both are non-null, then the exception message will be concatenated after the given message. |
| |
| <div class="section">Stack trace omission</div> |
| If there is no registered listener, then the <a href="#warning(java.util.logging.LogRecord)"><code>warning(LogRecord)</code></a> method will send the record to the |
| <a href="#getLogger()">logger</a>, but <em>without</em> the stack trace. This is done that way because stack |
| traces consume lot of space in the logging files, while being considered implementation details in the context |
| of <code>WarningListeners</code> (on the assumption that the logging message provides sufficient information). |
| If the stack trace is desired, then users can either: |
| <ul> |
| <li>invoke <code>warning(LogRecord)</code> directly, or</li> |
| <li>override <code>warning(LogRecord)</code> and invoke <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogRecord.html?is-external=true#setThrown(java.lang.Throwable)" title="class or interface in java.util.logging" class="externalLink"><code>LogRecord.setThrown(Throwable)</code></a> explicitly, or</li> |
| <li>register a listener which will log the record itself.</li> |
| </ul></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>level</code> - the warning level.</dd> |
| <dd><code>message</code> - the message to log, or <code>null</code> if none.</dd> |
| <dd><code>exception</code> - the exception to log, or <code>null</code> if none.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="addWarningListener(org.apache.sis.util.logging.WarningListener)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>addWarningListener</h4> |
| <pre class="methodSignature">public void addWarningListener​(<a href="WarningListener.html" title="interface in org.apache.sis.util.logging">WarningListener</a><? super <a href="WarningListeners.html" title="type parameter in WarningListeners">S</a>> listener) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Adds a listener to be notified when a warning occurred. |
| When a warning occurs, there is a choice: |
| |
| <ul> |
| <li>If this object has no warning listener, then the warning is logged at |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html?is-external=true#WARNING" title="class or interface in java.util.logging" class="externalLink"><code>Level.WARNING</code></a>.</li> |
| <li>If this object has at least one warning listener, then all listeners are notified |
| and the warning is <strong>not</strong> logged by this object.</li> |
| </ul></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>listener</code> - the listener to add.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - if the given listener is already registered.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="removeWarningListener(org.apache.sis.util.logging.WarningListener)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>removeWarningListener</h4> |
| <pre class="methodSignature">public void removeWarningListener​(<a href="WarningListener.html" title="interface in org.apache.sis.util.logging">WarningListener</a><? super <a href="WarningListeners.html" title="type parameter in WarningListeners">S</a>> listener) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/util/NoSuchElementException.html?is-external=true" title="class or interface in java.util" class="externalLink">NoSuchElementException</a></pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Removes a previously registered listener.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>listener</code> - the listener to remove.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/NoSuchElementException.html?is-external=true" title="class or interface in java.util" class="externalLink">NoSuchElementException</a></code> - if the given listener is not registered.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getListeners()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getListeners</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="WarningListener.html" title="interface in org.apache.sis.util.logging">WarningListener</a><? super <a href="WarningListeners.html" title="type parameter in WarningListeners">S</a>>> getListeners()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Returns all registered warning listeners, or an empty list if none. |
| This method returns an unmodifiable snapshot of the listener list at the time this method is invoked.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>immutable list of all registered warning listeners.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.8</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="hasListeners()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>hasListeners</h4> |
| <pre class="methodSignature">public boolean hasListeners()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Returns <code>true</code> if this object contains at least one listener.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if this object contains at least one listener, <code>false</code> otherwise.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.4</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/WarningListeners.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2010–2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |