270 lines
12 KiB
HTML
270 lines
12 KiB
HTML
|
<!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_151) on Tue Oct 31 17:36:52 EDT 2017 -->
|
||
|
<title>je.rep.quote (Oracle - Berkeley DB Java Edition Examples)</title>
|
||
|
<meta name="date" content="2017-10-31">
|
||
|
<link rel="stylesheet" type="text/css" href="../../../style.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="je.rep.quote (Oracle - Berkeley DB Java Edition Examples)";
|
||
|
}
|
||
|
}
|
||
|
catch(err) {
|
||
|
}
|
||
|
//-->
|
||
|
</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="../../../je/rep/quote/package-summary.html">Package</a></li>
|
||
|
<li>Class</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 class="aboutLanguage"><b>Berkeley DB Java Edition Examples</b><br><font size=\"-1\"> version 7.5.11</font>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="subNav">
|
||
|
<ul class="navList">
|
||
|
<li>Prev Package</li>
|
||
|
<li>Next Package</li>
|
||
|
</ul>
|
||
|
<ul class="navList">
|
||
|
<li><a href="../../../index.html?je/rep/quote/package-summary.html" target="_top">Frames</a></li>
|
||
|
<li><a href="package-summary.html" target="_top">No Frames</a></li>
|
||
|
</ul>
|
||
|
<ul class="navList" id="allclasses_navbar_top">
|
||
|
<li><a href="../../../allclasses-noframe.html">All 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>
|
||
|
<a name="skip.navbar.top">
|
||
|
<!-- -->
|
||
|
</a></div>
|
||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||
|
<div class="header">
|
||
|
<h1 title="Package" class="title">Package je.rep.quote</h1>
|
||
|
<div class="docSummary">
|
||
|
<div class="block">JE Replication Stock Quote example.</div>
|
||
|
</div>
|
||
|
<p>See: <a href="#package.description">Description</a></p>
|
||
|
</div>
|
||
|
<div class="contentContainer">
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
|
||
|
<caption><span>Interface Summary</span><span class="tabEnd"> </span></caption>
|
||
|
<tr>
|
||
|
<th class="colFirst" scope="col">Interface</th>
|
||
|
<th class="colLast" scope="col">Description</th>
|
||
|
</tr>
|
||
|
<tbody>
|
||
|
<tr class="altColor">
|
||
|
<td class="colFirst"><a href="../../../je/rep/quote/StockQuotesRMIForwarding.WriteServices.html" title="interface in je.rep.quote">StockQuotesRMIForwarding.WriteServices</a></td>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
|
||
|
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
|
||
|
<tr>
|
||
|
<th class="colFirst" scope="col">Class</th>
|
||
|
<th class="colLast" scope="col">Description</th>
|
||
|
</tr>
|
||
|
<tbody>
|
||
|
<tr class="altColor">
|
||
|
<td class="colFirst"><a href="../../../je/rep/quote/HARouter.html" title="class in je.rep.quote">HARouter</a></td>
|
||
|
<td class="colLast">
|
||
|
<div class="block">This example illustrates use of an HA aware Router used to forward high
|
||
|
level requests to replication nodes implemented by
|
||
|
<a href="../../../je/rep/quote/RouterDrivenStockQuotes.html" title="class in je.rep.quote"><code>RouterDrivenStockQuotes</code></a>.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="rowColor">
|
||
|
<td class="colFirst"><a href="../../../je/rep/quote/RouterDrivenStockQuotes.html" title="class in je.rep.quote">RouterDrivenStockQuotes</a></td>
|
||
|
<td class="colLast">
|
||
|
<div class="block">This class is based on <a href="../../../je/rep/quote/StockQuotes.html" title="class in je.rep.quote"><code>StockQuotes</code></a> and illustrates use of an
|
||
|
HA-aware router (implemented by <a href="../../../je/rep/quote/HARouter.html" title="class in je.rep.quote"><code>HARouter</code></a>), in conjunction with the
|
||
|
<a href="../../../../java/com/sleepycat/je/rep/monitor/Monitor.html?is-external=true" title="class or interface in com.sleepycat.je.rep.monitor"><code>Monitor</code></a> class, to direct
|
||
|
application requests, based upon the type of request (read or write) and the
|
||
|
state (Master or Replica) of a node in the replication group.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="altColor">
|
||
|
<td class="colFirst"><a href="../../../je/rep/quote/RunTransaction.html" title="class in je.rep.quote">RunTransaction</a></td>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Utility class to begin and commit/abort a transaction and handle exceptions
|
||
|
according to this application's policies.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="rowColor">
|
||
|
<td class="colFirst"><a href="../../../je/rep/quote/SimpleRouter.html" title="class in je.rep.quote">SimpleRouter</a></td>
|
||
|
<td class="colLast">
|
||
|
<div class="block">This example illustrates the use of a simple HA-unaware router that is used
|
||
|
in conjunction with <a href="../../../je/rep/quote/UpdateForwardingStockQuotes.html" title="class in je.rep.quote"><code>UpdateForwardingStockQuotes</code></a>.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="altColor">
|
||
|
<td class="colFirst"><a href="../../../je/rep/quote/StockQuotes.html" title="class in je.rep.quote">StockQuotes</a></td>
|
||
|
<td class="colLast">
|
||
|
<div class="block">The most basic demonstration of a replicated application.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="rowColor">
|
||
|
<td class="colFirst"><a href="../../../je/rep/quote/StockQuotesRMIForwarding.html" title="class in je.rep.quote">StockQuotesRMIForwarding</a></td>
|
||
|
<td class="colLast">
|
||
|
<div class="block">This example is a small variation on the basic <a href="../../../je/rep/quote/StockQuotes.html" title="class in je.rep.quote"><code>StockQuotes</code></a> example.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="rowColor">
|
||
|
<td class="colFirst"><a href="../../../je/rep/quote/UpdateForwardingStockQuotes.html" title="class in je.rep.quote">UpdateForwardingStockQuotes</a></td>
|
||
|
<td class="colLast">
|
||
|
<div class="block">This class is based on <a href="../../../je/rep/quote/RouterDrivenStockQuotes.html" title="class in je.rep.quote"><code>RouterDrivenStockQuotes</code></a> and illustrates use
|
||
|
of an HA unaware router (implemented by <a href="../../../je/rep/quote/SimpleRouter.html" title="class in je.rep.quote"><code>SimpleRouter</code></a>), that load
|
||
|
balances requests (both read and write) across all the nodes in a
|
||
|
replication group.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<a name="package.description">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<h2 title="Package je.rep.quote Description">Package je.rep.quote Description</h2>
|
||
|
<div class="block">JE Replication Stock Quote example.
|
||
|
|
||
|
<h2>Example Overview</h2>
|
||
|
This example is a simple but complete demonstration of a replicated
|
||
|
application. The application is a mock stock ticker which stores stock values
|
||
|
in a replicated JE environment. The following commands are accepted:
|
||
|
<ul>
|
||
|
<li><stock> <number> : enter this stock price into the
|
||
|
database</li>
|
||
|
<li>print : print all the stocks and current prices held in the database</li>
|
||
|
<li>quit : shut down</li>
|
||
|
</ul>
|
||
|
<p>
|
||
|
There are three versions of the example which illustrate different application
|
||
|
designs and aspects of JE functionality. Please be sure to walk through the
|
||
|
three examples in the order listed below, since the information in one example
|
||
|
builds on the one before it. The javadoc description for each class describes
|
||
|
the example and explains how to run it. More detailed information is found in
|
||
|
the example source code.
|
||
|
<ol>
|
||
|
<li><a href="../../../je/rep/quote/StockQuotes.html" title="class in je.rep.quote"><code>StockQuotes</code></a>: This example is the most
|
||
|
basic demonstration of a replicated application. It's intended to help gain an
|
||
|
understanding of basic HA concepts and demonstrate use of the HA APIs to create
|
||
|
a replicated environment and issue read and write transactions.
|
||
|
</li><br>
|
||
|
<li><a href="../../../je/rep/quote/RouterDrivenStockQuotes.html" title="class in je.rep.quote"><code>RouterDrivenStockQuotes</code></a> and
|
||
|
<a href="../../../je/rep/quote/HARouter.html" title="class in je.rep.quote"><code>HARouter</code></a>: This example is based on <code>StockQuotes</code> and illustrates use of an HA-aware router (implemented by <code>HARouter</code>), in conjunction with the <a href="../../../../java/com/sleepycat/je/rep/monitor/Monitor.html?is-external=true" title="class or interface in com.sleepycat.je.rep.monitor"><code>Monitor</code></a> class, to direct application requests, based upon the type of request
|
||
|
(read or write) and the state (Master or Replica) of a node in the replication
|
||
|
group. This example is meant to illustrate how a software load balancer might
|
||
|
be integrated with JE HA, where <code>HARouter</code> plays the role of the load
|
||
|
balancer for purposes of the example.
|
||
|
</li><br>
|
||
|
<li><a href="../../../je/rep/quote/UpdateForwardingStockQuotes.html" title="class in je.rep.quote"><code>UpdateForwardingStockQuotes</code></a> and <a href="../../../je/rep/quote/SimpleRouter.html" title="class in je.rep.quote"><code>SimpleRouter</code></a>: This example is based on <code>RouterDrivenStockQuotes</code> and
|
||
|
illustrates use of an HA unaware router (implemented by <code>SimpleRouter</code>),
|
||
|
that load balances requests (both read and write) across all the nodes in a
|
||
|
replication group. This example is meant to illustrate how a load balancer
|
||
|
appliance might fit into the JE HA architecture, where <code>SimpleRouter</code>
|
||
|
plays the role of the load balancer appliance for purposes of the example.
|
||
|
</li>
|
||
|
</ol>
|
||
|
<em>Disclaimer:</em> This example is intended to be illustrative. The example
|
||
|
is single threaded, while actual applications may be multithreaded. The
|
||
|
example forwards requests as text and receives responses in text form, while
|
||
|
actual applications may for example, forward HTTP requests, or use some other
|
||
|
application level network protocol to forward such requests. The example opens
|
||
|
and closes a socket to send each request, while actual applications will
|
||
|
typically use a connection management facility.
|
||
|
<p>
|
||
|
The example
|
||
|
<a href="../../../je/rep/quote/StockQuotesRMIForwarding.html" title="class in je.rep.quote"><code>StockQuotesRMIForwarding</code></a>,
|
||
|
a minor variation to the basic <a href="../../../je/rep/quote/StockQuotes.html" title="class in je.rep.quote"><code>StockQuotes</code></a>
|
||
|
example is also included in this package. It's intended to help illustrate how
|
||
|
RMI could be used to forward write requests from a Replica to the Master.
|
||
|
</p></div>
|
||
|
</div>
|
||
|
<!-- ======= 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="../../../je/rep/quote/package-summary.html">Package</a></li>
|
||
|
<li>Class</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 class="aboutLanguage"><b>Berkeley DB Java Edition Examples</b><br><font size=\"-1\"> version 7.5.11</font>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="subNav">
|
||
|
<ul class="navList">
|
||
|
<li>Prev Package</li>
|
||
|
<li>Next Package</li>
|
||
|
</ul>
|
||
|
<ul class="navList">
|
||
|
<li><a href="../../../index.html?je/rep/quote/package-summary.html" target="_top">Frames</a></li>
|
||
|
<li><a href="package-summary.html" target="_top">No Frames</a></li>
|
||
|
</ul>
|
||
|
<ul class="navList" id="allclasses_navbar_bottom">
|
||
|
<li><a href="../../../allclasses-noframe.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>
|
||
|
</div>
|
||
|
<a name="skip.navbar.bottom">
|
||
|
<!-- -->
|
||
|
</a></div>
|
||
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||
|
<p class="legalCopy"><small><font size=1>Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.</font> </small></p>
|
||
|
</body>
|
||
|
</html>
|