diff --git a/build.sbt b/build.sbt index b4f0d301..3e1104a7 100644 --- a/build.sbt +++ b/build.sbt @@ -11,3 +11,4 @@ scalaVersion := "2.10.3" lazy val spi = project lazy val tck = project.dependsOn(spi) + diff --git a/project/Build.scala b/project/Build.scala new file mode 100644 index 00000000..c69eac96 --- /dev/null +++ b/project/Build.scala @@ -0,0 +1,17 @@ +import sbt._ +import Keys._ + +object Common { + lazy val JavaDoc = config("genjavadoc") extend Compile + + val javadocSettings = inConfig(JavaDoc)(Defaults.configSettings) ++ Seq( + packageDoc in Compile <<= packageDoc in JavaDoc, + sources in JavaDoc <<= (target, compile in Compile, sources in Compile) map ((t, c, s) => + (t / "java" ** "*.java").get ++ s.filter(_.getName.endsWith(".java")) + ), + javacOptions in JavaDoc := Seq(), + artifactName in packageDoc in JavaDoc := ((sv, mod, art) => "" + mod.name + "_" + sv.binary + "-" + mod.revision + "-javadoc.jar"), + libraryDependencies += compilerPlugin("com.typesafe.genjavadoc" %% "genjavadoc-plugin" % "0.5" cross CrossVersion.full), + scalacOptions in Compile <+= target map (t => "-P:genjavadoc:out=" + (t / "java")) + ) +} diff --git a/spi/build.sbt b/spi/build.sbt index 6d576a7d..4c385634 100644 --- a/spi/build.sbt +++ b/spi/build.sbt @@ -1,3 +1,5 @@ organization := "org.reactivestreams" name := "reactive-streams-spi" + +Common.javadocSettings diff --git a/spi/src/main/scala/org/reactivestreams/api/Producer.scala b/spi/src/main/scala/org/reactivestreams/api/Producer.scala index 6616ff5c..99a24f4e 100644 --- a/spi/src/main/scala/org/reactivestreams/api/Producer.scala +++ b/spi/src/main/scala/org/reactivestreams/api/Producer.scala @@ -3,7 +3,7 @@ package api /** * A Producer is the logical source of elements of a given type. - * The underlying implementation is done by way of a [[asyncrx.spi.Publisher]]. + * The underlying implementation is done by way of a [[org.reactivestreams.spi.Publisher]]. * This interface is the user-level API for a source while a Publisher is the * SPI. * @@ -15,6 +15,8 @@ trait Producer[T] { /** * Get the underlying Publisher for this Producer. This method should only be used by * implementations of this API. + * + * @return the underlying publisher for this producer */ def getPublisher: spi.Publisher[T] @@ -24,19 +26,20 @@ trait Producer[T] { * underlying Publisher, which will initiate the transfer of the produced * stream of elements from producer to consumer until either of three things * happen: - * *
null
. The Publisher must not call this method more often than
* the Subscriber has signaled demand for via the corresponding [[Subscription]].
+ *
+ * @param element The element that is passed from publisher to subscriber.
*/
def onNext(element: T): Unit
@@ -75,6 +83,8 @@ trait Subscriber[T] {
* This method is not intended to pass validation errors or similar from Publisher to Subscriber
* in order to initiate an orderly shutdown of the exchange; it is intended only for fatal
* failure conditions which make it impossible to continue processing further elements.
+ *
+ * @param cause An exception which describes the reason for tearing down this stream.
*/
def onError(cause: Throwable): Unit
}