blob: ea57bd6e4d79615b9538781d45fb450c5caf93bf [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0) on Sun Aug 28 20:42:44 EST 2016 -->
<title>EventLog (Apache River v3.0.0 API Documentation (internals))</title>
<meta name="date" content="2016-08-28">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="EventLog (Apache River v3.0.0 API Documentation (internals))";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/EventLog.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">
<li><a href="../../../../org/apache/river/mercury/EventID.html" title="class in org.apache.river.mercury"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/river/mercury/EventLogFactory.html" title="class in org.apache.river.mercury"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/river/mercury/EventLog.html" target="_top">Frames</a></li>
<li><a href="EventLog.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></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>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.river.mercury</div>
<h2 title="Interface EventLog" class="title">Interface EventLog</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../org/apache/river/mercury/PersistentEventLog.html" title="class in org.apache.river.mercury">PersistentEventLog</a>, <a href="../../../../org/apache/river/mercury/TransientEventLog.html" title="class in org.apache.river.mercury">TransientEventLog</a></dd>
</dl>
<hr>
<br>
<pre>interface <span class="typeNameLabel">EventLog</span></pre>
<div class="block">Interface implemented by event storage objects.
This class encapsulates the details of reading/writing events from/to
some underlying persistence mechanism.
This interface makes certain assumptions. First, the <tt>next</tt> and
<tt>remove</tt> methods are intended to be called in pairs. If
<tt>remove</tt> is not called, then subsequent calls to <tt>next</tt>
will attempt to return the same object. Calling <tt>remove</tt>
essentially advances the read pointer to the next object, if any.
Second, if any <tt>IOExceptions</tt> are encountered during the reading
or writing of an event the associated read/write pointer is advanced
past the offending event. This means that events can be lost if I/O
errors are encountered.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.1</dd>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Sun Microsystems, Inc.</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/river/mercury/EventLog.html#add-net.jini.core.event.RemoteEvent-">add</a></span>(<a href="../../../../net/jini/core/event/RemoteEvent.html" title="class in net.jini.core.event">RemoteEvent</a>&nbsp;event)</code>
<div class="block">Writes the given <tt>RemoteEvent</tt> to the underlying
storage mechanism, if possible.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/river/mercury/EventLog.html#close--">close</a></span>()</code>
<div class="block">Close this log and release any associated runtime resources.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/river/mercury/EventLog.html#delete--">delete</a></span>()</code>
<div class="block">Delete associated storage resources for this log.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/river/mercury/EventLog.html#init--">init</a></span>()</code>
<div class="block">Initializes the state of this <tt>EventLog</tt> object.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/river/mercury/EventLog.html#isEmpty--">isEmpty</a></span>()</code>
<div class="block">Returns <tt>true</tt> if this log contains no events and
false otherwise.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/river/mercury/EventLog.html#moveAhead-java.lang.Object-">moveAhead</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;cookie)</code>
<div class="block">Effectively removes the last set of read events from the log.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../../../net/jini/core/event/RemoteEvent.html" title="class in net.jini.core.event">RemoteEvent</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/river/mercury/EventLog.html#next--">next</a></span>()</code>
<div class="block">Return the next <tt>RemoteEvent</tt> to be read.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/river/mercury/RemoteEventData.html" title="class in org.apache.river.mercury">RemoteEventData</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/river/mercury/EventLog.html#readAhead-int-">readAhead</a></span>(int&nbsp;maxEvents)</code>
<div class="block">Return an array of <tt>RemoteEventData</tt> with a limit of
<tt>maxEvents</tt> elements.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/river/mercury/EventLog.html#remove--">remove</a></span>()</code>
<div class="block">Effectively removes the last read event from the log.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="init--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>init</h4>
<pre>void&nbsp;init()
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Initializes the state of this <tt>EventLog</tt> object.
The required functionality can potentially throw an
<tt>IOException</tt> and has therefore been separated from
from object construction.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O error occurs</dd>
</dl>
</li>
</ul>
<a name="add-net.jini.core.event.RemoteEvent-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>void&nbsp;add(<a href="../../../../net/jini/core/event/RemoteEvent.html" title="class in net.jini.core.event">RemoteEvent</a>&nbsp;event)
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Writes the given <tt>RemoteEvent</tt> to the underlying
storage mechanism, if possible. If an <tt>IOException</tt>
occurs, then the write cannot be guaranteed.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O error occurs</dd>
</dl>
</li>
</ul>
<a name="next--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>next</h4>
<pre><a href="../../../../net/jini/core/event/RemoteEvent.html" title="class in net.jini.core.event">RemoteEvent</a>&nbsp;next()
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ClassNotFoundException.html?is-external=true" title="class or interface in java.lang">ClassNotFoundException</a></pre>
<div class="block">Return the next <tt>RemoteEvent</tt> to be read. Note that
<tt>next</tt> is meant to be used in conjunction with
<tt>remove</tt>. Subsequent calls to <tt>next</tt> will
return the same event until <tt>remove</tt> is called, which
actually updates the read pointer to the next event (indicating
that the previously read event was successfully processed).</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O error occurs</dd>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ClassNotFoundException.html?is-external=true" title="class or interface in java.lang">ClassNotFoundException</a></code> - if a class for the serialized
object could not be found</dd>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/NoSuchElementException.html?is-external=true" title="class or interface in java.util">NoSuchElementException</a></code> - if no event is available</dd>
</dl>
</li>
</ul>
<a name="isEmpty--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEmpty</h4>
<pre>boolean&nbsp;isEmpty()
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Returns <tt>true</tt> if this log contains no events and
false otherwise.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="remove--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>remove</h4>
<pre>void&nbsp;remove()
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Effectively removes the last read event from the log.
It does this by advancing the read pointer to the
next available event, if any.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/NoSuchElementException.html?is-external=true" title="class or interface in java.util">NoSuchElementException</a></code> - if no events are available</dd>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="readAhead-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readAhead</h4>
<pre><a href="../../../../org/apache/river/mercury/RemoteEventData.html" title="class in org.apache.river.mercury">RemoteEventData</a>[]&nbsp;readAhead(int&nbsp;maxEvents)
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ClassNotFoundException.html?is-external=true" title="class or interface in java.lang">ClassNotFoundException</a></pre>
<div class="block">Return an array of <tt>RemoteEventData</tt> with a limit of
<tt>maxEvents</tt> elements. Note that
<tt>readAhead</tt> is meant to be used in conjunction with
<tt>moveAhead</tt>. Subsequent calls to <tt>readAhead</tt> with
the same argument value will return the same set of events until
<tt>moveAhead</tt> is called, which
actually updates the read pointer to the next unread event (indicating
that the previously read events were successfully processed).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>maxEvents</code> - maximum number of events/elements to return</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O error occurs</dd>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ClassNotFoundException.html?is-external=true" title="class or interface in java.lang">ClassNotFoundException</a></code> - if a class for the serialized
object could not be found</dd>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/util/NoSuchElementException.html?is-external=true" title="class or interface in java.util">NoSuchElementException</a></code> - if no event is available</dd>
</dl>
</li>
</ul>
<a name="moveAhead-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>moveAhead</h4>
<pre>void&nbsp;moveAhead(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;cookie)
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Effectively removes the last set of read events from the log.
It does this by advancing the read pointer to the
next available event after the event associated with the provided
cookie object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>cookie</code> - object associated with event to read past. This object
should have been obtained from a call to
<code>getCookie()</code> on a <code>RemoteEventData</code> object
obtained from a call to <code>readAhead</code> on this event log.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there was a problem advancing the read pointer.</dd>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if <code>cookie</code> is null.</dd>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if <code>cookie</code>
is not an expected type.</dd>
</dl>
</li>
</ul>
<a name="close--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre>void&nbsp;close()
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Close this log and release any associated runtime resources.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="delete--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>delete</h4>
<pre>void&nbsp;delete()
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Delete associated storage resources for this log.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an IO error occurs</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/EventLog.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">
<li><a href="../../../../org/apache/river/mercury/EventID.html" title="class in org.apache.river.mercury"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/river/mercury/EventLogFactory.html" title="class in org.apache.river.mercury"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/river/mercury/EventLog.html" target="_top">Frames</a></li>
<li><a href="EventLog.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;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>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright 2007-2013, multiple authors.<br>Licensed under the <a href=http://www.apache.org/licenses/LICENSE-2.0 target=child >Apache License, Version 2.0</a>, see the <a href=../../../../doc-files/NOTICE target=child >NOTICE</a> file for attributions.</small></p>
</body>
</html>