Modified: incubator/reef/site/tang.html URL: http://svn.apache.org/viewvc/incubator/reef/site/tang.html?rev=1685045&r1=1685044&r2=1685045&view=diff ============================================================================== --- incubator/reef/site/tang.html (original) +++ incubator/reef/site/tang.html Fri Jun 12 07:52:47 2015 @@ -1,21 +1,21 @@ <!DOCTYPE html> <!-- - | Generated by Apache Maven Doxia at 2015-06-03 - | Rendered using Apache Maven Fluido Skin 1.3.1 + | Generated by Apache Maven Doxia at 2015-06-12 + | Rendered using Apache Maven Fluido Skin 1.4 --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> - <meta name="Date-Revision-yyyymmdd" content="20150603" /> + <meta name="Date-Revision-yyyymmdd" content="20150612" /> <meta http-equiv="Content-Language" content="en" /> <title>Apache REEF - Tang</title> - <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.1.min.css" /> + <link rel="stylesheet" href="./css/apache-maven-fluido-1.4.min.css" /> <link rel="stylesheet" href="./css/site.css" /> <link rel="stylesheet" href="./css/print.css" media="print" /> - <script type="text/javascript" src="./js/apache-maven-fluido-1.3.1.min.js"></script> + <script type="text/javascript" src="./js/apache-maven-fluido-1.4.min.js"></script> @@ -53,12 +53,6 @@ <li> <a href="downloads.html" title="Downloads">Downloads</a> </li> - - <li> <a href="apidocs/0.10.0-incubating/index.html" title="0.10.0-incubating API">0.10.0-incubating API</a> -</li> - - <li> <a href="apidocs/0.11.0-incubating/index.html" title="0.11.0-incubating API">0.11.0-incubating API</a> -</li> </ul> </li> <li class="dropdown"> @@ -71,6 +65,9 @@ <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Tutorials" title="REEF Tutorial">REEF Tutorial</a> </li> + <li> <a href="talks.html" title="Talks">Talks</a> +</li> + <li> <a href="glossary.html" title="Glossary">Glossary</a> </li> @@ -79,6 +76,12 @@ <li> <a href="wake.html" title="Wake">Wake</a> </li> + + <li> <a href="apidocs/0.10.0-incubating/index.html" title="0.10.0-incubating API">0.10.0-incubating API</a> +</li> + + <li> <a href="apidocs/0.11.0-incubating/index.html" title="0.11.0-incubating API">0.11.0-incubating API</a> +</li> </ul> </li> <li class="dropdown"> @@ -202,98 +205,105 @@ <li> <a href="index.html" title="Overview"> - <i class="none"></i> + <span class="none"></span> Overview</a> </li> <li> <a href="faq.html" title="FAQ"> - <i class="none"></i> + <span class="none"></span> FAQ</a> </li> <li> <a href="license.html" title="License"> - <i class="none"></i> + <span class="none"></span> License</a> </li> <li> <a href="downloads.html" title="Downloads"> - <i class="none"></i> + <span class="none"></span> Downloads</a> </li> - - <li> - - <a href="apidocs/0.10.0-incubating/index.html" title="0.10.0-incubating API"> - <i class="none"></i> - 0.10.0-incubating API</a> - </li> - - <li> - - <a href="apidocs/0.11.0-incubating/index.html" title="0.11.0-incubating API"> - <i class="none"></i> - 0.11.0-incubating API</a> - </li> <li class="nav-header">Documentation</li> <li> <a href="introduction.html" title="Introduction to REEF"> - <i class="none"></i> + <span class="none"></span> Introduction to REEF</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Tutorials" class="externalLink" title="REEF Tutorial"> - <i class="none"></i> + <span class="none"></span> REEF Tutorial</a> </li> <li> + <a href="talks.html" title="Talks"> + <span class="none"></span> + Talks</a> + </li> + + <li> + <a href="glossary.html" title="Glossary"> - <i class="none"></i> + <span class="none"></span> Glossary</a> </li> <li class="active"> - <a href="#"><i class="none"></i>Tang</a> + <a href="#"><span class="none"></span>Tang</a> </li> <li> <a href="wake.html" title="Wake"> - <i class="none"></i> + <span class="none"></span> Wake</a> </li> + + <li> + + <a href="apidocs/0.10.0-incubating/index.html" title="0.10.0-incubating API"> + <span class="none"></span> + 0.10.0-incubating API</a> + </li> + + <li> + + <a href="apidocs/0.11.0-incubating/index.html" title="0.11.0-incubating API"> + <span class="none"></span> + 0.11.0-incubating API</a> + </li> <li class="nav-header">Contribution</li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Contributing" class="externalLink" title="Contributing"> - <i class="none"></i> + <span class="none"></span> Contributing</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Committer+Guide" class="externalLink" title="Committer Guide"> - <i class="none"></i> + <span class="none"></span> Committer Guide</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Coding+Guidelines" class="externalLink" title="Coding Guidelines"> - <i class="none"></i> + <span class="none"></span> Coding Guidelines</a> </li> <li class="nav-header">Community</li> @@ -301,28 +311,28 @@ <li> <a href="team.html" title="Team"> - <i class="none"></i> + <span class="none"></span> Team</a> </li> <li> <a href="mailing-list.html" title="Mailing List"> - <i class="none"></i> + <span class="none"></span> Mailing List</a> </li> <li> <a href="https://issues.apache.org/jira/browse/REEF" class="externalLink" title="Issue Tracker"> - <i class="none"></i> + <span class="none"></span> Issue Tracker</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Powered+by+REEF" class="externalLink" title="Powered By"> - <i class="none"></i> + <span class="none"></span> Powered By</a> </li> <li class="nav-header">ASF</li> @@ -330,42 +340,42 @@ <li> <a href="http://www.apache.org/foundation/" class="externalLink" title="Apache Software Foundation"> - <i class="none"></i> + <span class="none"></span> Apache Software Foundation</a> </li> <li> <a href="http://www.apache.org/foundation/how-it-works.html" class="externalLink" title="How Apache Works"> - <i class="none"></i> + <span class="none"></span> How Apache Works</a> </li> <li> <a href="http://incubator.apache.org/" class="externalLink" title="Apache Incubator"> - <i class="none"></i> + <span class="none"></span> Apache Incubator</a> </li> <li> <a href="http://www.apache.org/licenses/LICENSE-2.0.html" class="externalLink" title="Apache License"> - <i class="none"></i> + <span class="none"></span> Apache License</a> </li> <li> <a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship"> - <i class="none"></i> + <span class="none"></span> Sponsorship</a> </li> <li> <a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"> - <i class="none"></i> + <span class="none"></span> Thanks</a> </li> </ul> @@ -484,8 +494,7 @@ under the License. --><h1>Tang</h1> <h2><a name="configuration-parameters"></a>Constructors, @Inject and @Parameter<a name="Constructors_Inject_and_Parameter"></a></h2> <p>Suppose you are implementing a new class, and would like to automatically pass configuration parameters to it at runtime:</p> -<div class="source"> -<pre>package com.example; +<div class="source"><pre class="prettyprint">package com.example; public class Timer { private final int seconds; @@ -505,8 +514,7 @@ public class Timer { <p>Tang encourages applications to use Plain Old Java Objects (POJOs), and emphasizes the use of immutable state for configuration parameters. This reduces boiler plate (there is no need for extra setter methods), and does not interfere with encapsulation (the fields and even the constructor can be private). Furthermore, it is trivial for well-written classes to ensure that all objects are completely and properly instantiated: They simply need to check constructor parameters as any other POJO would, except that Tang never passes <tt>null</tt> references into constructors, allowing their implementations to assume that all parameter values are non-null.</p> <p>Tang aims to provide end users with error messages as early as possible, and encourages developers to throw exceptions inside of constructors. This allows it to automatically provide additional information to end-users when things go wrong:</p> -<div class="source"> -<pre>Exception in thread "main" org.apache.reef.tang.exceptions.InjectionException: Could not invoke constructor: new Timer(Integer Seconds = -1) +<div class="source"><pre class="prettyprint">Exception in thread "main" org.apache.reef.tang.exceptions.InjectionException: Could not invoke constructor: new Timer(Integer Seconds = -1) at org.apache.reef.tang.implementation.java.InjectorImpl.injectFromPlan(InjectorImpl.java:585) at org.apache.reef.tang.implementation.java.InjectorImpl.getInstance(InjectorImpl.java:449) at org.apache.reef.tang.implementation.java.InjectorImpl.getInstance(InjectorImpl.java:466) @@ -522,8 +530,7 @@ Caused by: java.lang.IllegalArgumentExce </pre></div> <p>In order for Tang to instantiate an object, we need to annotate the constructor with an <tt>@Inject</tt> annotation. While we’re at it, we’ll define a configuration parameter, allowing us to specify seconds on the command line and in a config file:</p> -<div class="source"> -<pre>package com.example; +<div class="source"><pre class="prettyprint">package com.example; import javax.inject.Inject; @@ -577,8 +584,7 @@ public class Timer { <p>In the example below, we extend the Timer API to include a second implementation that simply outputs the amount of time a real timer would have slept to stderr. In a real unit testing example, it would likely interact with a scheduler based on logical time. Of course, in isolation, having the ability to specify configuration parameters is not particularly useful; this example also adds a <tt>main()</tt> method that invokes Tang, and instantiates an object.</p> <p>The process of instantiting an object with Tang is called <i>injection</i>. As with configurations, Tang’s injection process is designed to catch as many potential runtime errors as possible before application code begins to run. This simplifies debugging and eliminates many types of runtime error handling code, since many configurations can be caught before running (or examining) application-specific initialization code. </p> -<div class="source"> -<pre>package org.apache.reef.tang.examples.timer; +<div class="source"><pre class="prettyprint">package org.apache.reef.tang.examples.timer; import javax.inject.Inject; @@ -681,14 +687,12 @@ public class TimerMock implements Timer </ul> <p>These tools are provided by <tt>org.apache.reef.tang.util.Tint</tt>, which is included by default in all Tang builds. As long as Tang is on the classpath, invoking:</p> -<div class="source"> -<pre>java org.apache.reef.tang.util.Tint --doc tangdoc.html +<div class="source"><pre class="prettyprint">java org.apache.reef.tang.util.Tint --doc tangdoc.html </pre></div> <p>will perform full static analysis of all classes the class path, and emit a nicely formatted HTML document. The documentation generated by Tint includes cross-references between configuration options, interfaces, classes, and the <tt>ConfigurationModules</tt> that use and set them. </p> <p>Here are some sample Tint errors. These (and others) can be run by passing <tt>--tang-tests</tt> into Tint, and ensuring that Tang’s unit tests are on the class path.:</p> -<div class="source"> -<pre>interface org.apache.reef.tang.MyEventHandlerIface declares its default implementation to be non-subclass class org.apache.reef.tang.MyEventHandler +<div class="source"><pre class="prettyprint">interface org.apache.reef.tang.MyEventHandlerIface declares its default implementation to be non-subclass class org.apache.reef.tang.MyEventHandler class org.apache.reef.tang.WaterBottleName defines a default class org.apache.reef.tang.GasCan with a type that does not extend its target's type org.apache.reef.tang.Bottle<org.apache.reef.tang.Water> Named parameters org.apache.reef.tang.examples.Timer$Seconds and org.apache.reef.tang.examples.TimerV1$Seconds have the same short name: sec Named parameter org.apache.reef.tang.implementation.AnnotatedNameMultipleInterfaces implements multiple interfaces. It is only allowed to implement Name<T> @@ -740,8 +744,7 @@ Field org.apache.reef.tang.formats.MyMis <p>When Tang encounters a constructor parameter of type <tt>InjectionFuture<T></tt>, it injects an object that provides a method <tt>T get()</tt> that returns an injected instance of <tt>T</tt>. </p> <p>This can be used to break cycles:</p> -<div class="source"> -<pre>A(B b) {...} +<div class="source"><pre class="prettyprint">A(B b) {...} B(InjectionFuture<A> a) {...} </pre></div> <p>In order to inject an instance of <tt>A</tt>, Tang first injects an instance of <tt>B</tt> by passing it an <tt>InjectionFuture<A></tt>. Tang then invoke’s <tt>A</tt>’s constructor, passing in the instance of <tt>B</tt>. Once the constructor returns, the new instance of <tt>A</tt> is passed into <tt>B</tt>’s <tt>InjectionFuture<A></tt>. At this point, it becomes safe for <tt>B</tt> to invoke <tt>get()</tt>, which establishes the circular reference.</p> @@ -754,8 +757,7 @@ B(InjectionFuture<A> a) {...} <h2><a name="raw-configuration-api"></a>Raw configuration API<a name="Raw_configuration_API"></a></h2> <p>Tang also provides a lower level configurtion API for applications that need more dynamic control over their configurations:</p> -<div class="source"> -<pre>... +<div class="source"><pre class="prettyprint">... import org.apache.reef.tang.Tang; import org.apache.reef.tang.ConfigurationBuilder; import org.apache.reef.tang.Configuration; @@ -805,8 +807,7 @@ import org.apache.reef.tang.exceptions.I <p>New parameters are created and passed into constructors as in the examples above, by creating implementations of <tt>Name<T></tt>, and adding <tt>@NamedParameter</tt>, <tt>@Parameter</tt> and <tt>@Inject</tt> annotations as necessary. Specifying implementations for interfaces is a bit more involved, as a number of subtle use cases arise.</p> <p>However, all configuration settings in Tang can be unambiguously represented as a <tt>key=value</tt> pair that can be interpreted either asan <tt>interface=implementation</tt> pair or a <tt>configuration_parameter=value</tt> pair. This maps well to Java-style properties files. For example:</p> -<div class="source"> -<pre>com.examples.Interface=com.examples.Implementation +<div class="source"><pre class="prettyprint">com.examples.Interface=com.examples.Implementation </pre></div> <p>tells Tang to create a new Implementation each time it wants to invoke a constructor that asks for an instance of Interface. In most circumstances, Implementation extends or implements Interface (<tt>ExternalConstructors</tt> are the exception – see the next section). In such cases, Tang makes sure that Implementation contains at least one constructor with an <tt>@Inject</tt> annotation, and performs the binding.</p> <p>See the <tt>ConfigurationFile</tt> API for more information about processing configuration files in this format.</p></div> @@ -816,8 +817,7 @@ import org.apache.reef.tang.exceptions.I <h3><a name="injectionPlan"></a>InjectionPlan<a name="InjectionPlan"></a></h3> <p>InjectionPlan objects explain what Tang would do to instantiate a new object, but don’t actually instantiate anything. Add the following lines to the Timer example;</p> -<div class="source"> -<pre>import org.apache.reef.tang.implementation.InjectionPlan; +<div class="source"><pre class="prettyprint">import org.apache.reef.tang.implementation.InjectionPlan; import org.apache.reef.tang.implementation.InjectorImpl; ... InjectorImpl injector = (InjectorImpl)tang.newInjector(conf); @@ -827,8 +827,7 @@ System.out.println("Number of plans </pre></div> <p>Running the program now produces a bit of additional output:</p> -<div class="source"> -<pre>new Timer(Integer Seconds = 10) +<div class="source"><pre class="prettyprint">new Timer(Integer Seconds = 10) Number of plans:1 </pre></div> <p>InjectionPlan objects can be serialized to protocol buffers. The following file documents their format:</p> @@ -850,14 +849,7 @@ Number of plans:1 <footer> <div class="container-fluid"> <div class="row-fluid"> - <p >Copyright © 2015 - <a href="http://www.apache.org/">The Apache Software Foundation</a>. - All rights reserved. - - </p> - </div> - - + <div class="container-fluid"> <div class="row-fluid"> <a href="http://www.apache.org">Apache Software Foundation</a> @@ -867,7 +859,8 @@ Number of plans:1 <div class="row span12">Apache REEF, REEF, Apache, the Apache feather logo, and the Apache REEF logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.</div> - + </div> + </div> </footer>
Modified: incubator/reef/site/team.html URL: http://svn.apache.org/viewvc/incubator/reef/site/team.html?rev=1685045&r1=1685044&r2=1685045&view=diff ============================================================================== --- incubator/reef/site/team.html (original) +++ incubator/reef/site/team.html Fri Jun 12 07:52:47 2015 @@ -1,21 +1,21 @@ <!DOCTYPE html> <!-- - | Generated by Apache Maven Doxia at 2015-06-03 - | Rendered using Apache Maven Fluido Skin 1.3.1 + | Generated by Apache Maven Doxia at 2015-06-12 + | Rendered using Apache Maven Fluido Skin 1.4 --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> - <meta name="Date-Revision-yyyymmdd" content="20150603" /> + <meta name="Date-Revision-yyyymmdd" content="20150612" /> <meta http-equiv="Content-Language" content="en" /> <title>Apache REEF - Team</title> - <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.1.min.css" /> + <link rel="stylesheet" href="./css/apache-maven-fluido-1.4.min.css" /> <link rel="stylesheet" href="./css/site.css" /> <link rel="stylesheet" href="./css/print.css" media="print" /> - <script type="text/javascript" src="./js/apache-maven-fluido-1.3.1.min.js"></script> + <script type="text/javascript" src="./js/apache-maven-fluido-1.4.min.js"></script> @@ -53,12 +53,6 @@ <li> <a href="downloads.html" title="Downloads">Downloads</a> </li> - - <li> <a href="apidocs/0.10.0-incubating/index.html" title="0.10.0-incubating API">0.10.0-incubating API</a> -</li> - - <li> <a href="apidocs/0.11.0-incubating/index.html" title="0.11.0-incubating API">0.11.0-incubating API</a> -</li> </ul> </li> <li class="dropdown"> @@ -71,6 +65,9 @@ <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Tutorials" title="REEF Tutorial">REEF Tutorial</a> </li> + <li> <a href="talks.html" title="Talks">Talks</a> +</li> + <li> <a href="glossary.html" title="Glossary">Glossary</a> </li> @@ -79,6 +76,12 @@ <li> <a href="wake.html" title="Wake">Wake</a> </li> + + <li> <a href="apidocs/0.10.0-incubating/index.html" title="0.10.0-incubating API">0.10.0-incubating API</a> +</li> + + <li> <a href="apidocs/0.11.0-incubating/index.html" title="0.11.0-incubating API">0.11.0-incubating API</a> +</li> </ul> </li> <li class="dropdown"> @@ -202,127 +205,134 @@ <li> <a href="index.html" title="Overview"> - <i class="none"></i> + <span class="none"></span> Overview</a> </li> <li> <a href="faq.html" title="FAQ"> - <i class="none"></i> + <span class="none"></span> FAQ</a> </li> <li> <a href="license.html" title="License"> - <i class="none"></i> + <span class="none"></span> License</a> </li> <li> <a href="downloads.html" title="Downloads"> - <i class="none"></i> + <span class="none"></span> Downloads</a> </li> - - <li> - - <a href="apidocs/0.10.0-incubating/index.html" title="0.10.0-incubating API"> - <i class="none"></i> - 0.10.0-incubating API</a> - </li> - - <li> - - <a href="apidocs/0.11.0-incubating/index.html" title="0.11.0-incubating API"> - <i class="none"></i> - 0.11.0-incubating API</a> - </li> <li class="nav-header">Documentation</li> <li> <a href="introduction.html" title="Introduction to REEF"> - <i class="none"></i> + <span class="none"></span> Introduction to REEF</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Tutorials" class="externalLink" title="REEF Tutorial"> - <i class="none"></i> + <span class="none"></span> REEF Tutorial</a> </li> <li> + <a href="talks.html" title="Talks"> + <span class="none"></span> + Talks</a> + </li> + + <li> + <a href="glossary.html" title="Glossary"> - <i class="none"></i> + <span class="none"></span> Glossary</a> </li> <li> <a href="tang.html" title="Tang"> - <i class="none"></i> + <span class="none"></span> Tang</a> </li> <li> <a href="wake.html" title="Wake"> - <i class="none"></i> + <span class="none"></span> Wake</a> </li> + + <li> + + <a href="apidocs/0.10.0-incubating/index.html" title="0.10.0-incubating API"> + <span class="none"></span> + 0.10.0-incubating API</a> + </li> + + <li> + + <a href="apidocs/0.11.0-incubating/index.html" title="0.11.0-incubating API"> + <span class="none"></span> + 0.11.0-incubating API</a> + </li> <li class="nav-header">Contribution</li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Contributing" class="externalLink" title="Contributing"> - <i class="none"></i> + <span class="none"></span> Contributing</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Committer+Guide" class="externalLink" title="Committer Guide"> - <i class="none"></i> + <span class="none"></span> Committer Guide</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Coding+Guidelines" class="externalLink" title="Coding Guidelines"> - <i class="none"></i> + <span class="none"></span> Coding Guidelines</a> </li> <li class="nav-header">Community</li> <li class="active"> - <a href="#"><i class="none"></i>Team</a> + <a href="#"><span class="none"></span>Team</a> </li> <li> <a href="mailing-list.html" title="Mailing List"> - <i class="none"></i> + <span class="none"></span> Mailing List</a> </li> <li> <a href="https://issues.apache.org/jira/browse/REEF" class="externalLink" title="Issue Tracker"> - <i class="none"></i> + <span class="none"></span> Issue Tracker</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Powered+by+REEF" class="externalLink" title="Powered By"> - <i class="none"></i> + <span class="none"></span> Powered By</a> </li> <li class="nav-header">ASF</li> @@ -330,42 +340,42 @@ <li> <a href="http://www.apache.org/foundation/" class="externalLink" title="Apache Software Foundation"> - <i class="none"></i> + <span class="none"></span> Apache Software Foundation</a> </li> <li> <a href="http://www.apache.org/foundation/how-it-works.html" class="externalLink" title="How Apache Works"> - <i class="none"></i> + <span class="none"></span> How Apache Works</a> </li> <li> <a href="http://incubator.apache.org/" class="externalLink" title="Apache Incubator"> - <i class="none"></i> + <span class="none"></span> Apache Incubator</a> </li> <li> <a href="http://www.apache.org/licenses/LICENSE-2.0.html" class="externalLink" title="Apache License"> - <i class="none"></i> + <span class="none"></span> Apache License</a> </li> <li> <a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship"> - <i class="none"></i> + <span class="none"></span> Sponsorship</a> </li> <li> <a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"> - <i class="none"></i> + <span class="none"></span> Thanks</a> </li> </ul> @@ -515,14 +525,7 @@ <footer> <div class="container-fluid"> <div class="row-fluid"> - <p >Copyright © 2015 - <a href="http://www.apache.org/">The Apache Software Foundation</a>. - All rights reserved. - - </p> - </div> - - + <div class="container-fluid"> <div class="row-fluid"> <a href="http://www.apache.org">Apache Software Foundation</a> @@ -532,7 +535,8 @@ <div class="row span12">Apache REEF, REEF, Apache, the Apache feather logo, and the Apache REEF logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.</div> - + </div> + </div> </footer> Modified: incubator/reef/site/wake.html URL: http://svn.apache.org/viewvc/incubator/reef/site/wake.html?rev=1685045&r1=1685044&r2=1685045&view=diff ============================================================================== --- incubator/reef/site/wake.html (original) +++ incubator/reef/site/wake.html Fri Jun 12 07:52:47 2015 @@ -1,21 +1,21 @@ <!DOCTYPE html> <!-- - | Generated by Apache Maven Doxia at 2015-06-03 - | Rendered using Apache Maven Fluido Skin 1.3.1 + | Generated by Apache Maven Doxia at 2015-06-12 + | Rendered using Apache Maven Fluido Skin 1.4 --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> - <meta name="Date-Revision-yyyymmdd" content="20150603" /> + <meta name="Date-Revision-yyyymmdd" content="20150612" /> <meta http-equiv="Content-Language" content="en" /> <title>Apache REEF - Wake</title> - <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.1.min.css" /> + <link rel="stylesheet" href="./css/apache-maven-fluido-1.4.min.css" /> <link rel="stylesheet" href="./css/site.css" /> <link rel="stylesheet" href="./css/print.css" media="print" /> - <script type="text/javascript" src="./js/apache-maven-fluido-1.3.1.min.js"></script> + <script type="text/javascript" src="./js/apache-maven-fluido-1.4.min.js"></script> @@ -53,12 +53,6 @@ <li> <a href="downloads.html" title="Downloads">Downloads</a> </li> - - <li> <a href="apidocs/0.10.0-incubating/index.html" title="0.10.0-incubating API">0.10.0-incubating API</a> -</li> - - <li> <a href="apidocs/0.11.0-incubating/index.html" title="0.11.0-incubating API">0.11.0-incubating API</a> -</li> </ul> </li> <li class="dropdown"> @@ -71,6 +65,9 @@ <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Tutorials" title="REEF Tutorial">REEF Tutorial</a> </li> + <li> <a href="talks.html" title="Talks">Talks</a> +</li> + <li> <a href="glossary.html" title="Glossary">Glossary</a> </li> @@ -79,6 +76,12 @@ <li> <a href="wake.html" title="Wake">Wake</a> </li> + + <li> <a href="apidocs/0.10.0-incubating/index.html" title="0.10.0-incubating API">0.10.0-incubating API</a> +</li> + + <li> <a href="apidocs/0.11.0-incubating/index.html" title="0.11.0-incubating API">0.11.0-incubating API</a> +</li> </ul> </li> <li class="dropdown"> @@ -202,98 +205,105 @@ <li> <a href="index.html" title="Overview"> - <i class="none"></i> + <span class="none"></span> Overview</a> </li> <li> <a href="faq.html" title="FAQ"> - <i class="none"></i> + <span class="none"></span> FAQ</a> </li> <li> <a href="license.html" title="License"> - <i class="none"></i> + <span class="none"></span> License</a> </li> <li> <a href="downloads.html" title="Downloads"> - <i class="none"></i> + <span class="none"></span> Downloads</a> </li> - - <li> - - <a href="apidocs/0.10.0-incubating/index.html" title="0.10.0-incubating API"> - <i class="none"></i> - 0.10.0-incubating API</a> - </li> - - <li> - - <a href="apidocs/0.11.0-incubating/index.html" title="0.11.0-incubating API"> - <i class="none"></i> - 0.11.0-incubating API</a> - </li> <li class="nav-header">Documentation</li> <li> <a href="introduction.html" title="Introduction to REEF"> - <i class="none"></i> + <span class="none"></span> Introduction to REEF</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Tutorials" class="externalLink" title="REEF Tutorial"> - <i class="none"></i> + <span class="none"></span> REEF Tutorial</a> </li> <li> + <a href="talks.html" title="Talks"> + <span class="none"></span> + Talks</a> + </li> + + <li> + <a href="glossary.html" title="Glossary"> - <i class="none"></i> + <span class="none"></span> Glossary</a> </li> <li> <a href="tang.html" title="Tang"> - <i class="none"></i> + <span class="none"></span> Tang</a> </li> <li class="active"> - <a href="#"><i class="none"></i>Wake</a> + <a href="#"><span class="none"></span>Wake</a> </li> + + <li> + + <a href="apidocs/0.10.0-incubating/index.html" title="0.10.0-incubating API"> + <span class="none"></span> + 0.10.0-incubating API</a> + </li> + + <li> + + <a href="apidocs/0.11.0-incubating/index.html" title="0.11.0-incubating API"> + <span class="none"></span> + 0.11.0-incubating API</a> + </li> <li class="nav-header">Contribution</li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Contributing" class="externalLink" title="Contributing"> - <i class="none"></i> + <span class="none"></span> Contributing</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Committer+Guide" class="externalLink" title="Committer Guide"> - <i class="none"></i> + <span class="none"></span> Committer Guide</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Coding+Guidelines" class="externalLink" title="Coding Guidelines"> - <i class="none"></i> + <span class="none"></span> Coding Guidelines</a> </li> <li class="nav-header">Community</li> @@ -301,28 +311,28 @@ <li> <a href="team.html" title="Team"> - <i class="none"></i> + <span class="none"></span> Team</a> </li> <li> <a href="mailing-list.html" title="Mailing List"> - <i class="none"></i> + <span class="none"></span> Mailing List</a> </li> <li> <a href="https://issues.apache.org/jira/browse/REEF" class="externalLink" title="Issue Tracker"> - <i class="none"></i> + <span class="none"></span> Issue Tracker</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/REEF/Powered+by+REEF" class="externalLink" title="Powered By"> - <i class="none"></i> + <span class="none"></span> Powered By</a> </li> <li class="nav-header">ASF</li> @@ -330,42 +340,42 @@ <li> <a href="http://www.apache.org/foundation/" class="externalLink" title="Apache Software Foundation"> - <i class="none"></i> + <span class="none"></span> Apache Software Foundation</a> </li> <li> <a href="http://www.apache.org/foundation/how-it-works.html" class="externalLink" title="How Apache Works"> - <i class="none"></i> + <span class="none"></span> How Apache Works</a> </li> <li> <a href="http://incubator.apache.org/" class="externalLink" title="Apache Incubator"> - <i class="none"></i> + <span class="none"></span> Apache Incubator</a> </li> <li> <a href="http://www.apache.org/licenses/LICENSE-2.0.html" class="externalLink" title="Apache License"> - <i class="none"></i> + <span class="none"></span> Apache License</a> </li> <li> <a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship"> - <i class="none"></i> + <span class="none"></span> Sponsorship</a> </li> <li> <a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"> - <i class="none"></i> + <span class="none"></span> Thanks</a> </li> </ul> @@ -424,16 +434,14 @@ under the License. --><h1>Wake</h1> <h3>Event Handlers<a name="Event_Handlers"></a></h3> <p>Wake provides two APIs for event handler implementations. The first is the <a class="externalLink" href="https://github.com/apache/incubator-reef/blob/master/reef-wake/wake/src/main/java/org/apache/reef/wake/EventHandler.java">EventHandler</a> interface:</p> -<div class="source"> -<pre>public interface EventHandler<T> { +<div class="source"><pre class="prettyprint">public interface EventHandler<T> { void onNext(T value); } </pre></div> <p>Callers of <tt>onNext()</tt> should assume that it is asynchronous, and that it always succeeds. Unrecoverable errors should be reported by throwing a runtime exception (which should not be caught, and will instead take down the process). Recoverable errors are reported by invoking an event handler that contains the appropriate error handling logic.</p> <p>The latter approach can be implemented by registering separate event handlers for each type of error. However, for convenience, it is formalized in Wake’s simplified version of the Rx <a class="externalLink" href="https://github.com/apache/incubator-reef/blob/master/reef-wake/wake/src/main/java/org/apache/reef/wake/rx/Observer.java">Observer</a> interface:</p> -<div class="source"> -<pre>public interface Observer<T> { +<div class="source"><pre class="prettyprint">public interface Observer<T> { void onNext(final T value); void onError(final Exception error); void onCompleted(); @@ -446,18 +454,15 @@ under the License. --><h1>Wake</h1> <h3>Stages<a name="Stages"></a></h3> <p>Wake Stages are responsible for resource management. The base <a class="externalLink" href="https://github.com/apache/incubator-reef/blob/master/reef-wake/wake/src/main/java/org/apache/reef/wake/Stage.java">Stage</a> interface is fairly simple:</p> -<div class="source"> -<pre>public interface Stage extends AutoCloseable { } +<div class="source"><pre class="prettyprint">public interface Stage extends AutoCloseable { } </pre></div> <p>The only method it contains is <tt>close()</tt> from auto-closable. This reflects the fact that Wake stages can either contain <tt>EventHandler</tt>s, as <a class="externalLink" href="https://github.com/apache/incubator-reef/blob/master/reef-wake/wake/src/main/java/org/apache/reef/wake/EStage.java">EStage</a> implementations do:</p> -<div class="source"> -<pre>public interface EStage<T> extends EventHandler<T>, Stage { } +<div class="source"><pre class="prettyprint">public interface EStage<T> extends EventHandler<T>, Stage { } </pre></div> <p>or they can contain <tt>Observable</tt>s, as <a class="externalLink" href="https://github.com/apache/incubator-reef/blob/master/reef-wake/wake/src/main/java/org/apache/reef/wake/rx/RxStage.java">RxStage</a> implementations do:</p> -<div class="source"> -<pre>public interface RxStage<T> extends Observer<T>, Stage { } +<div class="source"><pre class="prettyprint">public interface RxStage<T> extends Observer<T>, Stage { } </pre></div> <p>In both cases, the stage simply exposes the same API as the event handler that it manages. This allows code that produces events to treat downstream stages and raw <tt>EventHandlers</tt> / <tt>Observers</tt> interchangebly. Recall that Wake implements thread sharing by allowing EventHandlers and Observers to directly invoke each other. Since Stages implement the same interface as raw EventHandlers and Observers, this pushes the placement of thread boundaries and other scheduling tradeoffs to the code that is instantiating the application. In turn, this simplifies testing and improves the reusability of code written on top of Wake.</p> <div class="section"> @@ -489,14 +494,7 @@ under the License. --><h1>Wake</h1> <footer> <div class="container-fluid"> <div class="row-fluid"> - <p >Copyright © 2015 - <a href="http://www.apache.org/">The Apache Software Foundation</a>. - All rights reserved. - - </p> - </div> - - + <div class="container-fluid"> <div class="row-fluid"> <a href="http://www.apache.org">Apache Software Foundation</a> @@ -506,7 +504,8 @@ under the License. --><h1>Wake</h1> <div class="row span12">Apache REEF, REEF, Apache, the Apache feather logo, and the Apache REEF logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.</div> - + </div> + </div> </footer>
