concern
Version:
A library for seperating your application logic into concerns.
1,276 lines (332 loc) • 15.9 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: System</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: System</h1>
<section>
<header>
<h2>System</h2>
<div class="class-description"><p>System represents a collection of related Concerns that share a parent Context.
Use them to create to represent the root of a tree your application will
branch into.</p></div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="System"><span class="type-signature"></span>new System<span class="signature">(parent)</span><span class="type-signature"></span></h4>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>parent</code></td>
<td class="type">
<span class="param-type"><a href="Context.html">Context</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="implements">Implements:</dt>
<dd class="implements"><ul>
<li><a href="Context.html">Context</a></li>
</ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="System.js.html">System.js</a>, <a href="System.js.html#line39">line 39</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".create"><span class="type-signature">(static) </span>create<span class="signature">(name)</span><span class="type-signature"> → {<a href="System.html">System</a>}</span></h4>
<div class="description">
<p>create a new System</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="System.js.html">System.js</a>, <a href="System.js.html#line60">line 60</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="System.html">System</a></span>
</dd>
</dl>
<h4 class="name" id="concernOf"><span class="type-signature"></span>concernOf<span class="signature">(factory, name)</span><span class="type-signature"> → {<a href="Reference.html">Reference</a>}</span></h4>
<div class="description">
<p>concernOf considers a Concern part of this system when it activates.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>factory</code></td>
<td class="type">
<span class="param-type">System.ConcernFactory</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="implements">Implements:</dt>
<dd class="implements"><ul>
<li><a href="Context.html#concernOf">Context#concernOf</a></li>
</ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="System.js.html">System.js</a>, <a href="System.js.html#line170">line 170</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Reference.html">Reference</a></span>
</dd>
</dl>
<h4 class="name" id="publish"><span class="type-signature"></span>publish<span class="signature">(event)</span><span class="type-signature"></span></h4>
<div class="description">
<p>publish an event.
Events are distinguished by the 'name' of their constructor properties.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>event</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="implements">Implements:</dt>
<dd class="implements"><ul>
<li><a href="Context.html#publish">Context#publish</a></li>
</ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Context.js.html">Context.js</a>, <a href="Context.js.html#line26">line 26</a>
</li></ul></dd>
</dl>
<h4 class="name" id="select"><span class="type-signature"></span>select<span class="signature">(path)</span><span class="type-signature"></span></h4>
<div class="description">
<p>select a Concern based on it's path</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>path</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="implements">Implements:</dt>
<dd class="implements"><ul>
<li><a href="Context.html#select">Context#select</a></li>
</ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Context.js.html">Context.js</a>, <a href="Context.js.html#line34">line 34</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setEventBus"><span class="type-signature"></span>setEventBus<span class="signature">(bus)</span><span class="type-signature"></span></h4>
<div class="description">
<p>setEventBus allows the EventEmitter to be set.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>bus</code></td>
<td class="type">
<span class="param-type">events.EventEmitter</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="System.js.html">System.js</a>, <a href="System.js.html#line70">line 70</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setReferenceProvider"><span class="type-signature"></span>setReferenceProvider<span class="signature">(protocol, provider)</span><span class="type-signature"></span></h4>
<div class="description">
<p>setReferenceProvider allows a provider to be configured for
a protocol.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>protocol</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>provider</code></td>
<td class="type">
<span class="param-type"><a href="ReferenceProvider.html">ReferenceProvider</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="System.js.html">System.js</a>, <a href="System.js.html#line85">line 85</a>
</li></ul></dd>
</dl>
<h4 class="name" id="subscribe"><span class="type-signature"></span>subscribe<span class="signature">(event, handler)</span><span class="type-signature"></span></h4>
<div class="description">
<p>subscribe adds a listener for an event</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>event</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>handler</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="implements">Implements:</dt>
<dd class="implements"><ul>
<li><a href="Context.html#subscribe">Context#subscribe</a></li>
</ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Context.js.html">Context.js</a>, <a href="Context.js.html#line16">line 16</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Active.html">Active</a></li><li><a href="Address.html">Address</a></li><li><a href="ChildActiveState.html">ChildActiveState</a></li><li><a href="ChildReference.html">ChildReference</a></li><li><a href="ChildReferenceProvider.html">ChildReferenceProvider</a></li><li><a href="ChildStateProvider.html">ChildStateProvider</a></li><li><a href="Envelope.html">Envelope</a></li><li><a href="IgnoredMessage.html">IgnoredMessage</a></li><li><a href="InvalidMessageError.html">InvalidMessageError</a></li><li><a href="MailDispatcher.html">MailDispatcher</a></li><li><a href="MemoryStateProvider.html">MemoryStateProvider</a></li><li><a href="ParentReference.html">ParentReference</a></li><li><a href="Pause.html">Pause</a></li><li><a href="Paused.html">Paused</a></li><li><a href="ProcessRouter.html">ProcessRouter</a></li><li><a href="Ready.html">Ready</a></li><li><a href="ReceiveError.html">ReceiveError</a></li><li><a href="Reference.html">Reference</a></li><li><a href="RefState.html">RefState</a></li><li><a href="RemoteMessage.html">RemoteMessage</a></li><li><a href="RemoteteTerminatedError.html">RemoteteTerminatedError</a></li><li><a href="Resume.html">Resume</a></li><li><a href="Signal.html">Signal</a></li><li><a href="SimpleMailBox.html">SimpleMailBox</a></li><li><a href="SpawnChildProcessError.html">SpawnChildProcessError</a></li><li><a href="Start.html">Start</a></li><li><a href="Stop.html">Stop</a></li><li><a href="Stopped.html">Stopped</a></li><li><a href="StoppedConcernError.html">StoppedConcernError</a></li><li><a href="System.html">System</a></li><li><a href="UnhandledMessage.html">UnhandledMessage</a></li><li><a href="Unknown.html">Unknown</a></li></ul><h3>Interfaces</h3><ul><li><a href="Concern.html">Concern</a></li><li><a href="Context.html">Context</a></li><li><a href="EnqueueListener.html">EnqueueListener</a></li><li><a href="MailBox.html">MailBox</a></li><li><a href="ReferenceProvider.html">ReferenceProvider</a></li><li><a href="StateProvider.html">StateProvider</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.0-dev</a> on Mon Sep 26 2016 02:55:49 GMT-0400 (AST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>