fix formatting of Java API in doc comments + genjavadoc 0.3

This commit is contained in:
Roland 2013-03-07 09:05:55 +01:00
parent cd847e3a29
commit bcfbea42c1
36 changed files with 169 additions and 222 deletions

View file

@ -61,7 +61,7 @@ import java.util.concurrent.TimeUnit
* }}}
*
* Note that `actor` can be used with an implicit [[akka.actor.ActorRefFactory]]
* as shown with `"barney"` (where the [[akka.actor.ActorContext serves this
* as shown with `"barney"` (where the [[akka.actor.ActorContext]] serves this
* purpose), but since nested declarations share the same
* lexical context `"fred"`s ActorContext would be ambiguous
* if the [[akka.actor.ActorSystem]] were declared `implicit` (this could also

View file

@ -60,7 +60,7 @@ sealed trait ActorPath extends Comparable[ActorPath] with Serializable {
def /(child: String): ActorPath
/**
* ''Java API'': Create a new child actor path.
* Java API: Create a new child actor path.
*/
def child(child: String): ActorPath = /(child)
@ -70,7 +70,7 @@ sealed trait ActorPath extends Comparable[ActorPath] with Serializable {
def /(child: Iterable[String]): ActorPath = (this /: child)((path, elem) if (elem.isEmpty) path else path / elem)
/**
* ''Java API'': Recursively create a descendants path by appending all child names.
* Java API: Recursively create a descendants path by appending all child names.
*/
def descendant(names: java.lang.Iterable[String]): ActorPath = /(immutableSeq(names))
@ -80,7 +80,7 @@ sealed trait ActorPath extends Comparable[ActorPath] with Serializable {
def elements: immutable.Iterable[String]
/**
* ''Java API'': Sequence of names for this path from root to this. Performance implication: has to allocate a list.
* Java API: Sequence of names for this path from root to this. Performance implication: has to allocate a list.
*/
def getElements: java.lang.Iterable[String] =
scala.collection.JavaConverters.asJavaIterableConverter(elements).asJava

View file

@ -88,7 +88,8 @@ abstract class ActorRef extends java.lang.Comparable[ActorRef] with Serializable
final def compareTo(other: ActorRef) = this.path compareTo other.path
/**
* Sends the specified message to the sender, i.e. fire-and-forget semantics.<p/>
* Sends the specified message to the sender, i.e. fire-and-forget semantics.
*
* <pre>
* actor.tell(message);
* </pre>
@ -97,10 +98,10 @@ abstract class ActorRef extends java.lang.Comparable[ActorRef] with Serializable
final def tell(msg: Any): Unit = this.!(msg)(null: ActorRef)
/**
* Java API. <p/>
* Sends the specified message to the sender, i.e. fire-and-forget
* Java API: Sends the specified message to the sender, i.e. fire-and-forget
* semantics, including the sender reference if possible (pass `null` if
* there is nobody to reply to).<p/>
* there is nobody to reply to).
*
* <pre>
* actor.tell(message, context);
* </pre>
@ -109,7 +110,7 @@ abstract class ActorRef extends java.lang.Comparable[ActorRef] with Serializable
/**
* Forwards the message and passes the original sender actor as the sender.
* <p/>
*
* Works with '!' and '?'/'ask'.
*/
def forward(message: Any)(implicit context: ActorContext) = tell(message, context.sender)

View file

@ -258,7 +258,7 @@ trait ActorRefFactory {
def actorFor(path: Iterable[String]): ActorRef = provider.actorFor(lookupRoot, path)
/**
* ''Java API'': Look-up an actor by applying the given path elements, starting from the
* Java API: Look-up an actor by applying the given path elements, starting from the
* current context, where `".."` signifies the parent of an actor.
*
* Example:

View file

@ -263,7 +263,7 @@ abstract class ActorSystem extends ActorRefFactory {
def /(name: String): ActorPath
/**
* ''Java API'': Create a new child actor path.
* Java API: Create a new child actor path.
*/
def child(child: String): ActorPath = /(child)
@ -273,7 +273,7 @@ abstract class ActorSystem extends ActorRefFactory {
def /(name: Iterable[String]): ActorPath
/**
* ''Java API'': Recursively create a descendants path by appending all child names.
* Java API: Recursively create a descendants path by appending all child names.
*/
def descendant(names: java.lang.Iterable[String]): ActorPath = /(immutableSeq(names))
@ -338,15 +338,13 @@ abstract class ActorSystem extends ActorRefFactory {
def registerOnTermination[T](code: T): Unit
/**
* Register a block of code (callback) to run after ActorSystem.shutdown has been issued and
* Java API: Register a block of code (callback) to run after ActorSystem.shutdown has been issued and
* all actors in this actor system have been stopped.
* Multiple code blocks may be registered by calling this method multiple times.
* The callbacks will be run sequentially in reverse order of registration, i.e.
* last registration is run first.
*
* @throws a RejectedExecutionException if the System has already shut down or if shutdown has been initiated.
*
* Java API
*/
def registerOnTermination(code: Runnable): Unit

View file

@ -95,6 +95,7 @@ trait ExtensionIdProvider {
* public MyExt(ExtendedActorSystem system) {
* ...
* }
* }
* }}}
*/
abstract class ExtensionKey[T <: Extension](implicit m: ClassTag[T]) extends ExtensionId[T] with ExtensionIdProvider {

View file

@ -117,26 +117,24 @@ object SupervisorStrategy extends SupervisorStrategyLowPriorityImplicits {
case object Escalate extends Directive
/**
* Resumes message processing for the failed Actor
* Java API
* Java API: Returning this directive resumes message processing for the failed Actor
*/
def resume = Resume
/**
* Discards the old Actor instance and replaces it with a new,
* Java API: Returning this directive discards the old Actor instance and replaces it with a new,
* then resumes message processing.
* Java API
*/
def restart = Restart
/**
* Stops the Actor
* Java API: Returning this directive stops the Actor
* Java API
*/
def stop = Stop
/**
* Escalates the failure to the supervisor of the supervisor,
* Java API: Returning this directive escalates the failure to the supervisor of the supervisor,
* by rethrowing the cause of the failure.
* Java API
*/

View file

@ -121,14 +121,14 @@ case class Props(
dispatcher = Dispatchers.DefaultDispatcherId)
/**
* Java API.
* Java API: create Props from an [[UntypedActorFactory]]
*/
def this(factory: UntypedActorFactory) = this(
creator = () factory.create(),
dispatcher = Dispatchers.DefaultDispatcherId)
/**
* Java API.
* Java API: create Props from a given [[Class]]
*/
def this(actorClass: Class[_ <: Actor]) = this(
creator = FromClassCreator(actorClass),
@ -136,27 +136,21 @@ case class Props(
routerConfig = Props.defaultRoutedProps)
/**
* Returns a new Props with the specified creator set.
* Scala API: Returns a new Props with the specified creator set.
*
* The creator must not return the same instance multiple times.
*
* Scala API.
*/
def withCreator(c: Actor): Props = copy(creator = () c)
/**
* Returns a new Props with the specified creator set.
* Java API: Returns a new Props with the specified creator set.
*
* The creator must not return the same instance multiple times.
*
* Java API.
*/
def withCreator(c: Creator[Actor]): Props = copy(creator = () c.create)
/**
* Returns a new Props with the specified creator set.
*
* Java API.
* Java API: Returns a new Props with the specified creator set.
*/
def withCreator(c: Class[_ <: Actor]): Props = copy(creator = FromClassCreator(c))

View file

@ -532,24 +532,20 @@ case class TypedProps[T <: AnyRef] protected[TypedProps] (
creator = instantiator(implementation))
/**
* Uses the supplied Creator as the factory for the TypedActor implementation,
* Java API: Uses the supplied Creator as the factory for the TypedActor implementation,
* and that has the specified interface,
* or if the interface class is not an interface, all the interfaces it implements,
* appended in the sequence of interfaces.
*
* Java API.
*/
def this(interface: Class[_ >: T], implementation: Creator[T]) =
this(interfaces = TypedProps.extractInterfaces(interface),
creator = implementation.create _)
/**
* Uses the supplied class as the factory for the TypedActor implementation,
* Java API: Uses the supplied class as the factory for the TypedActor implementation,
* and that has the specified interface,
* or if the interface class is not an interface, all the interfaces it implements,
* appended in the sequence of interfaces.
*
* Java API.
*/
def this(interface: Class[_ >: T], implementation: Class[T]) =
this(interfaces = TypedProps.extractInterfaces(interface),
@ -566,15 +562,13 @@ case class TypedProps[T <: AnyRef] protected[TypedProps] (
def withDeploy(d: Deploy): TypedProps[T] = copy(deploy = d)
/**
* @return a new TypedProps that will use the specified ClassLoader to create its proxy class in
* Java API: return a new TypedProps that will use the specified ClassLoader to create its proxy class in
* If loader is null, it will use the bootstrap classloader.
*
* Java API
*/
def withLoader(loader: ClassLoader): TypedProps[T] = withLoader(Option(loader))
/**
* @return a new TypedProps that will use the specified ClassLoader to create its proxy class in
* Scala API: return a new TypedProps that will use the specified ClassLoader to create its proxy class in
* If loader is null, it will use the bootstrap classloader.
*
* Scala API
@ -582,18 +576,16 @@ case class TypedProps[T <: AnyRef] protected[TypedProps] (
def withLoader(loader: Option[ClassLoader]): TypedProps[T] = this.copy(loader = loader)
/**
* @return a new TypedProps that will use the specified Timeout for its non-void-returning methods,
* Java API: return a new TypedProps that will use the specified Timeout for its non-void-returning methods,
* if null is specified, it will use the default timeout as specified in the configuration.
*
* Java API
*/
def withTimeout(timeout: Timeout): TypedProps[T] = this.copy(timeout = Option(timeout))
/**
* @return a new TypedProps that will use the specified Timeout for its non-void-returning methods,
* Scala API: return a new TypedProps that will use the specified Timeout for its non-void-returning methods,
* if None is specified, it will use the default timeout as specified in the configuration.
*
* Scala API
*
*/
def withTimeout(timeout: Option[Timeout]): TypedProps[T] = this.copy(timeout = timeout)

View file

@ -83,27 +83,34 @@ object ExecutionContexts {
object Futures {
import scala.collection.JavaConverters.iterableAsScalaIterableConverter
/**
* Java API, equivalent to Future.apply
* Starts an asynchronous computation and returns a `Future` object with the result of that computation.
*
* The result becomes available once the asynchronous computation is completed.
*
* @param body the asychronous computation
* @param executor the execution context on which the future is run
* @return the `Future` holding the result of the computation
*/
def future[T](body: Callable[T], executor: ExecutionContext): Future[T] = Future(body.call)(executor)
/**
* Java API, equivalent to Promise.apply
* Creates a promise object which can be completed with a value.
*
* @return the newly created `Promise` object
*/
def promise[T](): Promise[T] = Promise[T]()
/**
* Java API, creates an already completed Promise with the specified exception
* creates an already completed Promise with the specified exception
*/
def failed[T](exception: Throwable): Future[T] = Future.failed(exception)
/**
* Java API, Creates an already completed Promise with the specified result
* Creates an already completed Promise with the specified result
*/
def successful[T](result: T): Future[T] = Future.successful(result)
/**
* Java API.
* Returns a Future that will hold the optional result of the first Future with a result that matches the predicate
*/
def find[T <: AnyRef](futures: JIterable[Future[T]], predicate: JFunc[T, java.lang.Boolean], executor: ExecutionContext): Future[JOption[T]] = {
@ -112,14 +119,12 @@ object Futures {
}
/**
* Java API.
* Returns a Future to the result of the first future in the list that is completed
*/
def firstCompletedOf[T <: AnyRef](futures: JIterable[Future[T]], executor: ExecutionContext): Future[T] =
Future.firstCompletedOf(futures.asScala)(executor)
/**
* Java API
* A non-blocking fold over the specified futures, with the start value of the given zero.
* The fold is performed on the thread where the last future is completed,
* the result will be the first failure of any of the futures, or any failure in the actual fold,
@ -129,15 +134,13 @@ object Futures {
Future.fold(futures.asScala)(zero)(fun.apply)(executor)
/**
* Java API.
* Reduces the results of the supplied futures and binary function.
*/
def reduce[T <: AnyRef, R >: T](futures: JIterable[Future[T]], fun: akka.japi.Function2[R, T, R], executor: ExecutionContext): Future[R] =
Future.reduce[T, R](futures.asScala)(fun.apply)(executor)
/**
* Java API.
* Simple version of Future.traverse. Transforms a JIterable[Future[A]] into a Future[JIterable[A]].
* Simple version of [[#traverse]]. Transforms a JIterable[Future[A]] into a Future[JIterable[A]].
* Useful for reducing many Futures into a single Future.
*/
def sequence[A](in: JIterable[Future[A]], executor: ExecutionContext): Future[JIterable[A]] = {
@ -146,7 +149,6 @@ object Futures {
}
/**
* Java API.
* Transforms a JIterable[A] into a Future[JIterable[B]] using the provided Function A Future[B].
* This is useful for performing a parallel map. For example, to apply a function to all items of a list
* in parallel.

View file

@ -16,7 +16,7 @@ import scala.collection.immutable
* Represents the base type for EventBuses
* Internally has an Event type, a Classifier type and a Subscriber type
*
* For the Java API, @see akka.event.japi.*
* For the Java API, see akka.event.japi.*
*/
trait EventBus {
type Event

View file

@ -12,7 +12,9 @@ import scala.collection.immutable
import java.lang.{ Iterable JIterable }
object UdpConn extends ExtensionKey[UdpConnExt] {
// Java API
/**
* Java API: retrieve the UdpConn extension for the given system.
*/
override def get(system: ActorSystem): UdpConnExt = super.get(system)
trait Command extends IO.HasFailureMessage {
@ -71,7 +73,7 @@ class UdpConnExt(system: ExtendedActorSystem) extends IO.Extension {
}
/**
* Java API
* Java API: factory methods for the message types used when communicating with the UdpConn service.
*/
object UdpConnMessage {
import language.implicitConversions

View file

@ -12,7 +12,9 @@ import scala.collection.immutable
object UdpFF extends ExtensionKey[UdpFFExt] {
// Java API
/**
* Java API: retrieve the UdpFF extension for the given system.
*/
override def get(system: ActorSystem): UdpFFExt = super.get(system)
trait Command extends IO.HasFailureMessage {
@ -60,6 +62,9 @@ object UdpFF extends ExtensionKey[UdpFFExt] {
}
/**
* Java API: factory methods for the message types used when communicating with the UdpConn service.
*/
object UdpFFMessage {
import UdpFF._
import java.lang.{ Iterable JIterable }

View file

@ -113,8 +113,6 @@ abstract class JavaPartialFunction[A, B] extends AbstractPartialFunction[A, B] {
* This class represents optional values. Instances of <code>Option</code>
* are either instances of case class <code>Some</code> or it is case
* object <code>None</code>.
* <p>
* Java API
*/
sealed abstract class Option[A] extends java.lang.Iterable[A] {
def get: A
@ -179,24 +177,23 @@ object Util {
/**
* Returns a ClassTag describing the provided Class.
*
* Java API
*/
def classTag[T](clazz: Class[T]): ClassTag[T] = ClassTag(clazz)
/**
* Returns an immutable.Seq representing the provided array of Classes,
* an overloading of the generic immutableSeq in Util, to accommodate for erasure.
*
* Java API
*/
def immutableSeq(arr: Array[Class[_]]): immutable.Seq[Class[_]] = immutableSeq[Class[_]](arr)
/**
*
* Turns an array into an immutable Scala sequence (by copying it).
*/
def immutableSeq[T](arr: Array[T]): immutable.Seq[T] = if ((arr ne null) && arr.length > 0) Vector(arr: _*) else Nil
/**
* Turns an [[java.lang.Iterable]] into an immutable Scala sequence (by copying it).
*/
def immutableSeq[T](iterable: java.lang.Iterable[T]): immutable.Seq[T] =
iterable match {
case imm: immutable.Seq[_] imm.asInstanceOf[immutable.Seq[T]]

View file

@ -21,6 +21,8 @@ import akka.dispatch.ExecutionContexts.sameThreadExecutionContext
object CircuitBreaker {
/**
* Create a new CircuitBreaker.
*
* Callbacks run in caller's thread when using withSyncCircuitBreaker, and in same ExecutionContext as the passed
* in Future when using withCircuitBreaker. To use another ExecutionContext for the callbacks you can specify the
* executor in the constructor.
@ -34,10 +36,11 @@ object CircuitBreaker {
new CircuitBreaker(scheduler, maxFailures, callTimeout, resetTimeout)(sameThreadExecutionContext)
/**
* Java API: Create a new CircuitBreaker.
*
* Callbacks run in caller's thread when using withSyncCircuitBreaker, and in same ExecutionContext as the passed
* in Future when using withCircuitBreaker. To use another ExecutionContext for the callbacks you can specify the
* executor in the constructor.
* Java API alias for apply
*
* @param scheduler Reference to Akka scheduler
* @param maxFailures Maximum number of failures before opening the circuit
@ -110,7 +113,7 @@ class CircuitBreaker(scheduler: Scheduler, maxFailures: Int, callTimeout: Finite
def withCircuitBreaker[T](body: Future[T]): Future[T] = currentState.invoke(body)
/**
* Java API for withCircuitBreaker
* Java API for [[#withCircuitBreaker]]
*
* @param body Call needing protected
* @tparam T return type from call
@ -133,7 +136,7 @@ class CircuitBreaker(scheduler: Scheduler, maxFailures: Int, callTimeout: Finite
callTimeout)
/**
* Java API for withSyncCircuitBreaker
* Java API for [[#withSyncCircuitBreaker]]
*
* @param body Call needing protected
* @tparam T return type from call

View file

@ -41,10 +41,9 @@ class ConsistentHash[T: ClassTag] private (nodes: immutable.SortedMap[Int, T], v
new ConsistentHash(nodes ++ ((1 to virtualNodesFactor) map { r (nodeHashFor(node, r) -> node) }), virtualNodesFactor)
/**
* Adds a node to the node ring.
* Java API: Adds a node to the node ring.
* Note that the instance is immutable and this
* operation returns a new instance.
* JAVA API
*/
def add(node: T): ConsistentHash[T] = this :+ node
@ -57,10 +56,9 @@ class ConsistentHash[T: ClassTag] private (nodes: immutable.SortedMap[Int, T], v
new ConsistentHash(nodes -- ((1 to virtualNodesFactor) map { r nodeHashFor(node, r) }), virtualNodesFactor)
/**
* Removes a node from the node ring.
* Java API: Removes a node from the node ring.
* Note that the instance is immutable and this
* operation returns a new instance.
* JAVA API
*/
def remove(node: T): ConsistentHash[T] = this :- node
@ -112,8 +110,7 @@ object ConsistentHash {
}
/**
* Factory method to create a ConsistentHash
* JAVA API
* Java API: Factory method to create a ConsistentHash
*/
def create[T](nodes: java.lang.Iterable[T], virtualNodesFactor: Int): ConsistentHash[T] = {
import scala.collection.JavaConverters._

View file

@ -151,22 +151,20 @@ case class ConsistentHashingRouter(
extends RouterConfig with ConsistentHashingLike {
/**
* Constructor that sets nrOfInstances to be created.
* Java API
* Java API: Constructor that sets nrOfInstances to be created.
*/
def this(nr: Int) = this(nrOfInstances = nr)
/**
* Constructor that sets the routees to be used.
* Java API
* Java API: Constructor that sets the routees to be used.
*
* @param routeePaths string representation of the actor paths of the routees that will be looked up
* using `actorFor` in [[akka.actor.ActorRefProvider]]
*/
def this(routeePaths: java.lang.Iterable[String]) = this(routees = immutableSeq(routeePaths))
/**
* Constructor that sets the resizer to be used.
* Java API
* Java API: Constructor that sets the resizer to be used.
*/
def this(resizer: Resizer) = this(resizer = Some(resizer))

View file

@ -236,11 +236,10 @@ class RouteeProvider(val context: ActorContext, val routeeProps: Props, val resi
def registerRoutees(routees: immutable.Iterable[ActorRef]): Unit = routedCell.addRoutees(routees)
/**
* Adds the routees to the router.
* Java API: Adds the routees to the router.
* Adds death watch of the routees so that they are removed when terminated.
* Not thread safe, but intended to be called from protected points, such as
* `RouterConfig.createRoute` and `Resizer.resize`.
* Java API.
*/
def registerRoutees(routees: java.lang.Iterable[ActorRef]): Unit = registerRoutees(immutableSeq(routees))
@ -253,11 +252,10 @@ class RouteeProvider(val context: ActorContext, val routeeProps: Props, val resi
def unregisterRoutees(routees: immutable.Iterable[ActorRef]): Unit = routedCell.removeRoutees(routees)
/**
* Removes routees from the router. This method doesn't stop the routees.
* Java API: Removes routees from the router. This method doesn't stop the routees.
* Removes death watch of the routees.
* Not thread safe, but intended to be called from protected points, such as
* `Resizer.resize`.
* JAVA API
*/
def unregisterRoutees(routees: java.lang.Iterable[ActorRef]): Unit = unregisterRoutees(immutableSeq(routees))
@ -267,8 +265,7 @@ class RouteeProvider(val context: ActorContext, val routeeProps: Props, val resi
def registerRouteesFor(paths: immutable.Iterable[String]): Unit = registerRoutees(paths.map(context.actorFor(_)))
/**
* Looks up routes with specified paths and registers them.
* JAVA API
* Java API: Looks up routes with specified paths and registers them.
*/
def registerRouteesFor(paths: java.lang.Iterable[String]): Unit = registerRouteesFor(immutableSeq(paths))
@ -321,8 +318,7 @@ class RouteeProvider(val context: ActorContext, val routeeProps: Props, val resi
def routees: immutable.IndexedSeq[ActorRef] = routedCell.routees
/**
* All routees of the router
* JAVA API
* Java API: All routees of the router
*/
def getRoutees(): java.util.List[ActorRef] = routees.asJava
@ -347,12 +343,13 @@ abstract class CustomRouterConfig extends RouterConfig {
}
/**
* Java API helper for creating a single-destination routing.
*/
trait CustomRoute {
/**
* use akka.japi.Util.immutableSeq to convert a java.lang.Iterable to the return type needed for destinationsFor,
* or if you just want to return a single Destination, use akka.japi.Util.immutableSingletonSeq
*
* Java API
*/
def destinationsFor(sender: ActorRef, message: Any): immutable.Seq[Destination]
}
@ -561,22 +558,20 @@ case class RoundRobinRouter(nrOfInstances: Int = 0, routees: immutable.Iterable[
extends RouterConfig with RoundRobinLike {
/**
* Constructor that sets nrOfInstances to be created.
* Java API
* Java API: Constructor that sets nrOfInstances to be created.
*/
def this(nr: Int) = this(nrOfInstances = nr)
/**
* Constructor that sets the routees to be used.
* Java API
* Java API: Constructor that sets the routees to be used.
*
* @param routeePaths string representation of the actor paths of the routees that will be looked up
* using `actorFor` in [[akka.actor.ActorRefProvider]]
*/
def this(routeePaths: java.lang.Iterable[String]) = this(routees = immutableSeq(routeePaths))
/**
* Constructor that sets the resizer to be used.
* Java API
* Java API: Constructor that sets the resizer to be used.
*/
def this(resizer: Resizer) = this(resizer = Some(resizer))
@ -696,22 +691,20 @@ case class RandomRouter(nrOfInstances: Int = 0, routees: immutable.Iterable[Stri
extends RouterConfig with RandomLike {
/**
* Constructor that sets nrOfInstances to be created.
* Java API
* Java API: Constructor that sets nrOfInstances to be created.
*/
def this(nr: Int) = this(nrOfInstances = nr)
/**
* Constructor that sets the routees to be used.
* Java API
* Java API: Constructor that sets the routees to be used.
*
* @param routeePaths string representation of the actor paths of the routees that will be looked up
* using `actorFor` in [[akka.actor.ActorRefProvider]]
*/
def this(routeePaths: java.lang.Iterable[String]) = this(routees = immutableSeq(routeePaths))
/**
* Constructor that sets the resizer to be used.
* Java API
* Java API: Constructor that sets the resizer to be used.
*/
def this(resizer: Resizer) = this(resizer = Some(resizer))
@ -838,22 +831,20 @@ case class SmallestMailboxRouter(nrOfInstances: Int = 0, routees: immutable.Iter
extends RouterConfig with SmallestMailboxLike {
/**
* Constructor that sets nrOfInstances to be created.
* Java API
* Java API: Constructor that sets nrOfInstances to be created.
*/
def this(nr: Int) = this(nrOfInstances = nr)
/**
* Constructor that sets the routees to be used.
* Java API
* Java API: Constructor that sets the routees to be used.
*
* @param routeePaths string representation of the actor paths of the routees that will be looked up
* using `actorFor` in [[akka.actor.ActorRefProvider]]
*/
def this(routeePaths: java.lang.Iterable[String]) = this(routees = immutableSeq(routeePaths))
/**
* Constructor that sets the resizer to be used.
* Java API
* Java API: Constructor that sets the resizer to be used.
*/
def this(resizer: Resizer) = this(resizer = Some(resizer))
@ -1055,22 +1046,20 @@ case class BroadcastRouter(nrOfInstances: Int = 0, routees: immutable.Iterable[S
extends RouterConfig with BroadcastLike {
/**
* Constructor that sets nrOfInstances to be created.
* Java API
* Java API: Constructor that sets nrOfInstances to be created.
*/
def this(nr: Int) = this(nrOfInstances = nr)
/**
* Constructor that sets the routees to be used.
* Java API
* Java API: Constructor that sets the routees to be used.
*
* @param routeePaths string representation of the actor paths of the routees that will be looked up
* using `actorFor` in [[akka.actor.ActorRefProvider]]
*/
def this(routeePaths: java.lang.Iterable[String]) = this(routees = immutableSeq(routeePaths))
/**
* Constructor that sets the resizer to be used.
* Java API
* Java API: Constructor that sets the resizer to be used.
*/
def this(resizer: Resizer) = this(resizer = Some(resizer))
@ -1185,22 +1174,20 @@ case class ScatterGatherFirstCompletedRouter(nrOfInstances: Int = 0, routees: im
"[within: Duration] can not be zero or negative, was [" + within + "]")
/**
* Constructor that sets nrOfInstances to be created.
* Java API
* Java API: Constructor that sets nrOfInstances to be created.
*/
def this(nr: Int, w: FiniteDuration) = this(nrOfInstances = nr, within = w)
/**
* Constructor that sets the routees to be used.
* Java API
* Java API: Constructor that sets the routees to be used.
*
* @param routeePaths string representation of the actor paths of the routees that will be looked up
* using `actorFor` in [[akka.actor.ActorRefProvider]]
*/
def this(routeePaths: java.lang.Iterable[String], w: FiniteDuration) = this(routees = immutableSeq(routeePaths), within = w)
/**
* Constructor that sets the resizer to be used.
* Java API
* Java API: Constructor that sets the resizer to be used.
*/
def this(resizer: Resizer, w: FiniteDuration) = this(resizer = Some(resizer), within = w)

View file

@ -103,7 +103,8 @@ object JavaSerializer {
val currentSystem = new CurrentSystem
final class CurrentSystem extends DynamicVariable[ExtendedActorSystem](null) {
/**
* Java API
* Java API: invoke the callable with the current system being set to the given value for this thread.
*
* @param value - the current value under the call to callable.call()
* @param callable - the operation to be performed
* @tparam S - the return type

View file

@ -307,7 +307,8 @@ sealed abstract class ByteString extends IndexedSeq[Byte] with IndexedSeqOptimiz
override def indexOf[B >: Byte](elem: B): Int = iterator.indexOf(elem)
/**
* JAVA API
* Java API: copy this ByteString into a fresh byte array
*
* @return this ByteString copied into a byte array
*/
protected[ByteString] def toArray: Array[Byte] = toArray[Byte] // protected[ByteString] == public to Java but hidden to Scala * fnizz *
@ -355,18 +356,14 @@ sealed abstract class ByteString extends IndexedSeq[Byte] with IndexedSeqOptimiz
def asByteBuffer: ByteBuffer
/**
* Returns an immutable Iterable of read-only ByteBuffers that directly wraps this ByteStrings
* Scala API: Returns an immutable Iterable of read-only ByteBuffers that directly wraps this ByteStrings
* all fragments. Will always have at least one entry.
*
* Scala API
*/
def asByteBuffers: immutable.Iterable[ByteBuffer]
/**
* Returns an Iterable of read-only ByteBuffers that directly wraps this ByteStrings
* Java API: Returns an Iterable of read-only ByteBuffers that directly wraps this ByteStrings
* all fragments. Will always have at least one entry.
*
* Java API
*/
def getByteBuffers(): JIterable[ByteBuffer] = {
import scala.collection.JavaConverters.asJavaIterableConverter

View file

@ -15,8 +15,7 @@ object Agent {
def apply[T](initialValue: T)(implicit context: ExecutionContext): Agent[T] = new SecretAgent(initialValue, context)
/**
* Java API
* Factory method for creating an Agent.
* Java API: Factory method for creating an Agent.
*/
def create[T](initialValue: T, context: ExecutionContext): Agent[T] = Agent(initialValue)(context)
@ -161,8 +160,7 @@ object Agent {
abstract class Agent[T] {
/**
* Read the internal state of the agent.
* Java API
* Java API: Read the internal state of the agent.
*/
def get(): T

View file

@ -26,27 +26,21 @@ case class CamelMessage(body: Any, headers: Map[String, Any]) {
def headers(names: Set[String]): Map[String, Any] = headers filterKeys names
/**
* Returns those headers from this message whose name is contained in <code>names</code>.
* Java API: Returns those headers from this message whose name is contained in <code>names</code>.
* The returned headers map is backed up by an immutable headers map. Any attempt to modify
* the returned map will throw an exception.
* <p>
* Java API
*/
def getHeaders(names: JSet[String]): JMap[String, Any] = headers(names.toSet)
/**
* Returns all headers from this message. The returned headers map is backed up by this
* Java API: Returns all headers from this message. The returned headers map is backed up by this
* message's immutable headers map. Any attempt to modify the returned map will throw an
* exception.
* <p>
* Java API
*/
def getHeaders: JMap[String, Any] = headers
/**
* Creates a new CamelMessage with given <code>headers</code>. A copy of the headers map is made.
* <p>
* Java API
* Java API: Creates a new CamelMessage with given <code>headers</code>. A copy of the headers map is made.
*/
def withHeaders[A](headers: JMap[String, A]): CamelMessage = copy(this.body, headers.toMap)
@ -64,13 +58,11 @@ case class CamelMessage(body: Any, headers: Map[String, Any]) {
Try(headers.get(name).map(camelContext.getTypeConverter.mandatoryConvertTo[T](t.runtimeClass.asInstanceOf[Class[T]], _)).getOrElse(throw new NoSuchElementException(name)))
/**
* Returns the header by given <code>name</code> parameter. The header is converted to type <code>T</code> as defined by the <code>clazz</code> parameter.
* Java API: Returns the header by given <code>name</code> parameter. The header is converted to type <code>T</code> as defined by the <code>clazz</code> parameter.
* An exception is thrown when the conversion to the type <code>T</code> fails or when the header cannot be found.
* <p>
* The CamelContext is accessible in a [[akka.camel.javaapi.UntypedConsumerActor]] and [[akka.camel.javaapi.UntypedProducerActor]]
* using the `getCamelContext` method, and is available on the [[akka.camel.CamelExtension]].
* <p>
* Java API
*/
def getHeaderAs[T](name: String, clazz: Class[T], camelContext: CamelContext): T = headerAs[T](name)(ClassTag(clazz), camelContext).get
@ -81,10 +73,8 @@ case class CamelMessage(body: Any, headers: Map[String, Any]) {
def mapBody[A, B](transformer: A B): CamelMessage = copy(body = transformer(body.asInstanceOf[A]))
/**
* Returns a new CamelMessage with a transformed body using a <code>transformer</code> function.
* Java API: Returns a new CamelMessage with a transformed body using a <code>transformer</code> function.
* This method will throw a [[java.lang.ClassCastException]] if the body cannot be mapped to type A.
* <p>
* Java API
*/
def mapBody[A, B](transformer: Mapper[A, B]): CamelMessage = copy(body = transformer(body.asInstanceOf[A]))
@ -97,15 +87,12 @@ case class CamelMessage(body: Any, headers: Map[String, Any]) {
def bodyAs[T](implicit t: ClassTag[T], camelContext: CamelContext): T = getBodyAs(t.runtimeClass.asInstanceOf[Class[T]], camelContext)
/**
* Returns the body of the message converted to the type as given by the <code>clazz</code>
* Java API: Returns the body of the message converted to the type as given by the <code>clazz</code>
* parameter. Conversion is done using Camel's type converter. The type converter is obtained
* from the CamelContext that is passed in.
* <p>
* The CamelContext is accessible in a [[akka.camel.javaapi.UntypedConsumerActor]] and [[akka.camel.javaapi.UntypedProducerActor]]
* using the `getCamelContext` method, and is available on the [[akka.camel.CamelExtension]].
* <p>
* Java API
*
*/
def getBodyAs[T](clazz: Class[T], camelContext: CamelContext): T = {
val result = camelContext.getTypeConverter.mandatoryConvertTo[T](clazz, body)
@ -124,9 +111,7 @@ case class CamelMessage(body: Any, headers: Map[String, Any]) {
}
/**
* Returns a new CamelMessage with a new body, while keeping the same headers.
* <p>
* Java API
* Java API: Returns a new CamelMessage with a new body, while keeping the same headers.
*/
def withBody[T](body: T) = this.copy(body = body)
/**
@ -137,12 +122,10 @@ case class CamelMessage(body: Any, headers: Map[String, Any]) {
def withBodyAs[T](implicit t: ClassTag[T], camelContext: CamelContext): CamelMessage = withBodyAs(t.runtimeClass.asInstanceOf[Class[T]])
/**
* Creates a CamelMessage with current <code>body</code> converted to type <code>clazz</code>.
* Java API: Creates a CamelMessage with current <code>body</code> converted to type <code>clazz</code>.
* <p>
* The CamelContext is accessible in a [[akka.camel.javaapi.UntypedConsumerActor]] and [[akka.camel.javaapi.UntypedProducerActor]]
* using the `getCamelContext` method, and is available on the [[akka.camel.CamelExtension]].
* <p>
* Java API
*/
def withBodyAs[T](clazz: Class[T])(implicit camelContext: CamelContext): CamelMessage = copy(body = getBodyAs(clazz, camelContext))

View file

@ -71,7 +71,7 @@ trait Consumer extends Actor with CamelSupport {
}
/**
* Java API. Returns the [[akka.dispatch.Mapper]] function that will be used as a route definition handler
* Java API: Returns the [[akka.dispatch.Mapper]] function that will be used as a route definition handler
* for creating custom route to this consumer. By default it returns an identity function, override this method to
* return a custom route definition handler. The [[akka.dispatch.Mapper]] is not allowed to close over 'this', meaning it is
* not allowed to refer to the actor instance itself, since that can easily cause concurrent shared state issues.

View file

@ -17,24 +17,24 @@ abstract class UntypedConsumerActor extends UntypedActor with Consumer {
final def endpointUri: String = getEndpointUri
/**
* ''Java API'': Returns the Camel endpoint URI to consume messages from.
* Java API: Returns the Camel endpoint URI to consume messages from.
*/
def getEndpointUri(): String
/**
* ''Java API'': Returns the [[org.apache.camel.impl.DefaultCamelContext]]
* Java API: Returns the [[org.apache.camel.impl.DefaultCamelContext]]
* @return the CamelContext
*/
protected def getCamelContext(): DefaultCamelContext = camelContext
/**
* ''Java API'': Returns the [[org.apache.camel.ProducerTemplate]]
* Java API: Returns the [[org.apache.camel.ProducerTemplate]]
* @return the ProducerTemplate
*/
protected def getProducerTemplate(): ProducerTemplate = camel.template
/**
* ''Java API'': Returns the [[akka.camel.Activation]] interface
* Java API: Returns the [[akka.camel.Activation]] interface
* that can be used to wait on activation or de-activation of Camel endpoints.
* @return the Activation interface
*/

View file

@ -250,11 +250,10 @@ class Cluster(val system: ExtendedActorSystem) extends Extension {
registerOnMemberUp(new Runnable { def run = code })
/**
* The supplied callback will be run, once, when current cluster member is `Up`.
* Java API: The supplied callback will be run, once, when current cluster member is `Up`.
* Typically used together with configuration option `akka.cluster.min-nr-of-members'
* to defer some action, such as starting actors, until the cluster has reached
* a certain size.
* JAVA API
*/
def registerOnMemberUp(callback: Runnable): Unit = clusterDaemons ! InternalClusterAction.AddOnMemberUpListener(callback)

View file

@ -38,8 +38,7 @@ object ClusterEvent {
leader: Option[Address] = None) extends ClusterDomainEvent {
/**
* Java API
* Read only
* Java API: get current member list.
*/
def getMembers: java.lang.Iterable[Member] = {
import scala.collection.JavaConverters._
@ -47,22 +46,19 @@ object ClusterEvent {
}
/**
* Java API
* Read only
* Java API: get current unreachable set.
*/
def getUnreachable: java.util.Set[Member] =
scala.collection.JavaConverters.setAsJavaSetConverter(unreachable).asJava
/**
* Java API
* Read only
* Java API: get current seen-by set.
*/
def getSeenBy: java.util.Set[Address] =
scala.collection.JavaConverters.setAsJavaSetConverter(seenBy).asJava
/**
* Java API
* @return address of current leader, or null if none
* Java API: get address of current leader, or null if none
*/
def getLeader: Address = leader orNull
}
@ -137,8 +133,7 @@ object ClusterEvent {
extends ClusterDomainEvent {
/**
* Java API
* Read only
* Java API: get current member list
*/
def getMembers: java.lang.Iterable[Member] = {
import scala.collection.JavaConverters._

View file

@ -99,32 +99,32 @@ object MemberStatus {
case object Removed extends MemberStatus
/**
* JAVA API
* Java API: retrieve the joining status singleton
*/
def joining: MemberStatus = Joining
/**
* JAVA API
* Java API: retrieve the up status singleton
*/
def up: MemberStatus = Up
/**
* JAVA API
* Java API: retrieve the leaving status singleton
*/
def leaving: MemberStatus = Leaving
/**
* JAVA API
* Java API: retrieve the exiting status singleton
*/
def exiting: MemberStatus = Exiting
/**
* JAVA API
* Java API: retrieve the down status singleton
*/
def down: MemberStatus = Down
/**
* JAVA API
* Java API: retrieve the removed status singleton
*/
def removed: MemberStatus = Removed
}

View file

@ -79,16 +79,16 @@ case class AdaptiveLoadBalancingRouter(
extends RouterConfig with AdaptiveLoadBalancingRouterLike {
/**
* Constructor that sets nrOfInstances to be created.
* Java API
* Java API: Constructor that sets nrOfInstances to be created.
*
* @param selector the selector is responsible for producing weighted mix of routees from the node metrics
* @param nr number of routees to create
*/
def this(selector: MetricsSelector, nr: Int) = this(metricsSelector = selector, nrOfInstances = nr)
/**
* Constructor that sets the routees to be used.
* Java API
* Java API: Constructor that sets the routees to be used.
*
* @param selector the selector is responsible for producing weighted mix of routees from the node metrics
* @param routeePaths string representation of the actor paths of the routees that will be looked up
* using `actorFor` in [[akka.actor.ActorRefProvider]]
@ -97,8 +97,8 @@ case class AdaptiveLoadBalancingRouter(
this(metricsSelector = selector, routees = immutableSeq(routeePaths))
/**
* Constructor that sets the resizer to be used.
* Java API
* Java API: Constructor that sets the resizer to be used.
*
* @param selector the selector is responsible for producing weighted mix of routees from the node metrics
*/
def this(selector: MetricsSelector, resizer: Resizer) =
@ -307,7 +307,7 @@ abstract class MixMetricsSelectorBase(selectors: immutable.IndexedSeq[CapacityMe
extends CapacityMetricsSelector {
/**
* Java API
* Java API: construct a mix-selector from a sequence of selectors
*/
def this(selectors: java.lang.Iterable[CapacityMetricsSelector]) = this(immutableSeq(selectors).toVector)

View file

@ -109,15 +109,13 @@ case class ClusterRouterSettings private[akka] (
allowLocalRoutees: Boolean) {
/**
* Settings for create and deploy of the routees
* JAVA API
* Java API: Settings for create and deploy of the routees
*/
def this(totalInstances: Int, maxInstancesPerNode: Int, allowLocalRoutees: Boolean) =
this(totalInstances, maxInstancesPerNode, routeesPath = "", allowLocalRoutees)
/**
* Settings for lookup of the routees
* JAVA API
* Java API: Settings for lookup of the routees
*/
def this(totalInstances: Int, routeesPath: String, allowLocalRoutees: Boolean) =
this(totalInstances, maxInstancesPerNode = 1, routeesPath, allowLocalRoutees)

View file

@ -148,7 +148,7 @@ object TestActorRef {
}), name)
/**
* Java API
* Java API: create a TestActorRef in the given system for the given props
*/
def create[T <: Actor](system: ActorSystem, props: Props, name: String): TestActorRef[T] = apply(props, name)(system)
}

View file

@ -43,7 +43,7 @@ object TestEvent {
}
case class Mute(filters: immutable.Seq[EventFilter]) extends TestEvent with NoSerializationVerificationNeeded {
/**
* Java API
* Java API: create a Mute command from a list of filters
*/
def this(filters: JIterable[EventFilter]) = this(immutableSeq(filters))
}
@ -52,7 +52,7 @@ object TestEvent {
}
case class UnMute(filters: immutable.Seq[EventFilter]) extends TestEvent with NoSerializationVerificationNeeded {
/**
* Java API
* Java API: create an UnMute command from a list of filters
*/
def this(filters: JIterable[EventFilter]) = this(immutableSeq(filters))
}
@ -277,7 +277,7 @@ case class ErrorFilter(
}
/**
* Java API
* Java API: create an ErrorFilter
*
* @param source
* apply this filter only to events from the given source; do not filter on source if this is given as <code>null</code>
@ -326,7 +326,7 @@ case class WarningFilter(
}
/**
* Java API
* Java API: create a WarningFilter
*
* @param source
* apply this filter only to events from the given source; do not filter on source if this is given as <code>null</code>
@ -369,7 +369,7 @@ case class InfoFilter(
}
/**
* Java API
* Java API: create an InfoFilter
*
* @param source
* apply this filter only to events from the given source; do not filter on source if this is given as <code>null</code>
@ -412,7 +412,7 @@ case class DebugFilter(
}
/**
* Java API
* Java API: create a DebugFilter
*
* @param source
* apply this filter only to events from the given source; do not filter on source if this is given as <code>null</code>

View file

@ -679,7 +679,7 @@ object TestKit {
def now: Duration = System.nanoTime().nanos
/**
* Java API. Scale timeouts (durations) during tests with the configured
* Java API: Scale timeouts (durations) during tests with the configured
* 'akka.test.timefactor'.
*/
def dilated(duration: Duration, system: ActorSystem): Duration =

View file

@ -92,7 +92,7 @@ case class SendTo(actor: ActorRef, message: Option[Any] = None)
* can implement normal actor behavior, or use the normal STM atomic for
* local transactions.
*
* @see [[akka.transactor.Coordinated]] for more information about the underlying mechanism
* @see [[akka.transactor.Coordinated]]
*/
trait Transactor extends Actor {
private val settings = TransactorExtension(context.system)

View file

@ -229,7 +229,8 @@ object ZMQMessage {
if ((frames eq null) || frames.length == 0) empty else new ZMQMessage(frames.to[immutable.Seq])
/**
* Java API
* Java API: create a message from the given frames
*
* @param frames the frames of the returned ZMQMessage
* @return a ZMQMessage with the given frames
*/

View file

@ -72,64 +72,64 @@ class ZeroMQExtension(system: ActorSystem) extends Extension {
}
/**
* Java API helper
* Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Publisher socket actor.
* Java API: Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Publisher socket actor.
*
* @param socketParameters a varargs list of [[akka.zeromq.SocketOption]] to configure the socket
* @return the [[akka.actor.Props]]
*/
def newPubSocketProps(socketParameters: SocketOption*): Props = newSocketProps((SocketType.Pub +: socketParameters): _*)
/**
* Java API helper
* Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Subscriber socket actor.
* Java API: Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Subscriber socket actor.
*
* @param socketParameters a varargs list of [[akka.zeromq.SocketOption]] to configure the socket
* @return the [[akka.actor.Props]]
*/
def newSubSocketProps(socketParameters: SocketOption*): Props = newSocketProps((SocketType.Sub +: socketParameters): _*)
/**
* Java API helper
* Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Dealer socket actor.
* Java API: Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Dealer socket actor.
*
* @param socketParameters a varargs list of [[akka.zeromq.SocketOption]] to configure the socket
* @return the [[akka.actor.Props]]
*/
def newDealerSocketProps(socketParameters: SocketOption*): Props = newSocketProps((SocketType.Dealer +: socketParameters): _*)
/**
* Java API helper
* Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Router socket actor.
* Java API: Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Router socket actor.
*
* @param socketParameters a varargs list of [[akka.zeromq.SocketOption]] to configure the socket
* @return the [[akka.actor.Props]]
*/
def newRouterSocketProps(socketParameters: SocketOption*): Props = newSocketProps((SocketType.Router +: socketParameters): _*)
/**
* Java API helper
* Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Push socket actor.
* Java API: Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Push socket actor.
*
* @param socketParameters a varargs list of [[akka.zeromq.SocketOption]] to configure the socket
* @return the [[akka.actor.Props]]
*/
def newPushSocketProps(socketParameters: SocketOption*): Props = newSocketProps((SocketType.Push +: socketParameters): _*)
/**
* Java API helper
* Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Pull socket actor.
* Java API: Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Pull socket actor.
*
* @param socketParameters a varargs list of [[akka.zeromq.SocketOption]] to configure the socket
* @return the [[akka.actor.Props]]
*/
def newPullSocketProps(socketParameters: SocketOption*): Props = newSocketProps((SocketType.Pull +: socketParameters): _*)
/**
* Java API helper
* Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Req socket actor.
* Java API: Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Req socket actor.
*
* @param socketParameters a varargs list of [[akka.zeromq.SocketOption]] to configure the socket
* @return the [[akka.actor.Props]]
*/
def newReqSocketProps(socketParameters: SocketOption*): Props = newSocketProps((SocketType.Rep +: socketParameters): _*)
/**
* Java API helper
* Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Rep socket actor.
* Java API: Factory method to create the [[akka.actor.Props]] to build a ZeroMQ Rep socket actor.
*
* @param socketParameters a varargs list of [[akka.zeromq.SocketOption]] to configure the socket
* @return the [[akka.actor.Props]]
*/

View file

@ -879,7 +879,7 @@ object Dependencies {
val sigar = "org.fusesource" % "sigar" % "1.6.4" // ApacheV2
// Compiler plugins
val genjavadoc = compilerPlugin("com.typesafe.genjavadoc" %% "genjavadoc-plugin" % "0.2" cross CrossVersion.full) // ApacheV2
val genjavadoc = compilerPlugin("com.typesafe.genjavadoc" %% "genjavadoc-plugin" % "0.3" cross CrossVersion.full) // ApacheV2
// Test