improved javadoc documentation

This commit is contained in:
Jonas Boner 2009-04-27 20:06:48 +02:00
parent 7dec0a747c
commit 21e7a6f4b8
6 changed files with 43 additions and 0 deletions

View file

@ -12,6 +12,8 @@ import java.lang.reflect.Method
import java.net.{URL, URLClassLoader} import java.net.{URL, URLClassLoader}
/** /**
* Bootstraps the Akka server by isolating the server classes and all its dependency JARs into its own classloader.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a> * @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
object Boot extends Logging { object Boot extends Logging {

View file

@ -12,8 +12,14 @@ import scala.reflect.BeanProperty
// ============================================ // ============================================
// Java version of the configuration API // Java version of the configuration API
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
sealed class ConfigurationException(msg: String) extends RuntimeException(msg) sealed class ConfigurationException(msg: String) extends RuntimeException(msg)
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
sealed abstract class Configuration sealed abstract class Configuration
class RestartStrategy(@BeanProperty val scheme: FailOverScheme, @BeanProperty val maxNrOfRetries: Int, @BeanProperty val withinTimeRange: Int) extends Configuration { class RestartStrategy(@BeanProperty val scheme: FailOverScheme, @BeanProperty val maxNrOfRetries: Int, @BeanProperty val withinTimeRange: Int) extends Configuration {

View file

@ -12,6 +12,11 @@ import scala.actors.Actor._
import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.atomic.AtomicReference
import java.util.concurrent.{ConcurrentLinkedQueue, LinkedBlockingQueue} import java.util.concurrent.{ConcurrentLinkedQueue, LinkedBlockingQueue}
/**
* Implements Oz-style dataflow (single assignment) variables.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
object DataFlow { object DataFlow {
def thread(body: => Unit) = { def thread(body: => Unit) = {
val thread = new IsolatedEventBasedThread(body).start val thread = new IsolatedEventBasedThread(body).start
@ -40,6 +45,9 @@ object DataFlow {
} }
} }
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
sealed class DataFlowVariable[T] { sealed class DataFlowVariable[T] {
private sealed abstract class DataFlowVariableMessage private sealed abstract class DataFlowVariableMessage
@ -95,6 +103,9 @@ object DataFlow {
def shutdown = in ! 'exit def shutdown = in ! 'exit
} }
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
class DataFlowStream[T] extends Seq[T] { class DataFlowStream[T] extends Seq[T] {
private[this] val queue = new LinkedBlockingQueue[DataFlowVariable[T]] private[this] val queue = new LinkedBlockingQueue[DataFlowVariable[T]]
@ -131,6 +142,9 @@ object DataFlow {
override def toList: List[T] = queue.toArray.toList.asInstanceOf[List[T]] override def toList: List[T] = queue.toArray.toList.asInstanceOf[List[T]]
} }
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
class DataFlowVariableException(msg: String) extends RuntimeException(msg) class DataFlowVariableException(msg: String) extends RuntimeException(msg)
} }

View file

@ -15,6 +15,8 @@ import java.net.UnknownHostException;
/** /**
* Base trait for all classes that wants to be able use the logging infrastructure. * Base trait for all classes that wants to be able use the logging infrastructure.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
trait Logging { trait Logging {
@transient val log = Logger.get(this.getClass.getName) @transient val log = Logger.get(this.getClass.getName)
@ -27,6 +29,8 @@ trait Logging {
* It keeps track of the exception is logged or not and also stores the unique id, * It keeps track of the exception is logged or not and also stores the unique id,
* so that it can be carried all along to the client tier and displayed to the end user. * so that it can be carried all along to the client tier and displayed to the end user.
* The end user can call up the customer support using this number. * The end user can call up the customer support using this number.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
class LoggableException extends Exception with Logging { class LoggableException extends Exception with Logging {
private val uniqueId = getExceptionID private val uniqueId = getExceptionID

View file

@ -6,6 +6,9 @@ package se.scalablesolutions.akka.kernel
import java.io.{ObjectOutputStream, ByteArrayOutputStream, ObjectInputStream, ByteArrayInputStream} import java.io.{ObjectOutputStream, ByteArrayOutputStream, ObjectInputStream, ByteArrayInputStream}
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
object Serializer { object Serializer {
def deepClone[T <: AnyRef](obj: T): T = in(out(obj)).asInstanceOf[T] def deepClone[T <: AnyRef](obj: T): T = in(out(obj)).asInstanceOf[T]

View file

@ -17,6 +17,8 @@ trait Transactional {
* Base trait for all state implementations (persistent or in-memory). * Base trait for all state implementations (persistent or in-memory).
* *
* TODO: Make this class inherit scala.collection.mutable.Map and/or java.util.Map * TODO: Make this class inherit scala.collection.mutable.Map and/or java.util.Map
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
trait TransactionalMap[K, V] extends Transactional { trait TransactionalMap[K, V] extends Transactional {
def put(key: K, value: V) def put(key: K, value: V)
@ -33,6 +35,8 @@ trait TransactionalMap[K, V] extends Transactional {
* Implements a Unit of Work, records changes into a change set. * Implements a Unit of Work, records changes into a change set.
* *
* Not thread-safe, but should only be using from within an Actor, e.g. one single thread at a time. * Not thread-safe, but should only be using from within an Actor, e.g. one single thread at a time.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
abstract class PersistentTransactionalMap[K, V] extends TransactionalMap[K, V] { abstract class PersistentTransactionalMap[K, V] extends TransactionalMap[K, V] {
protected[kernel] val changeSet = new HashMap[K, V] protected[kernel] val changeSet = new HashMap[K, V]
@ -54,6 +58,8 @@ abstract class PersistentTransactionalMap[K, V] extends TransactionalMap[K, V] {
/** /**
* Not thread-safe, but should only be using from within an Actor, e.g. one single thread at a time. * Not thread-safe, but should only be using from within an Actor, e.g. one single thread at a time.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
class InMemoryTransactionalMap[K, V] extends TransactionalMap[K, V] { class InMemoryTransactionalMap[K, V] extends TransactionalMap[K, V] {
protected[kernel] var state = new HashTrie[K, V] protected[kernel] var state = new HashTrie[K, V]
@ -74,6 +80,8 @@ class InMemoryTransactionalMap[K, V] extends TransactionalMap[K, V] {
/** /**
* Implements a persistent state based on the Cassandra distributed P2P key-value storage. * Implements a persistent state based on the Cassandra distributed P2P key-value storage.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
class CassandraPersistentTransactionalMap(val actorName: String) extends PersistentTransactionalMap[String, String] { class CassandraPersistentTransactionalMap(val actorName: String) extends PersistentTransactionalMap[String, String] {
override def begin = {} override def begin = {}
@ -117,6 +125,8 @@ class CassandraPersistentTransactionalMap(val actorName: String) extends Persist
/** /**
* TODO: extend scala.Seq * TODO: extend scala.Seq
* Base for all transactional vector implementations. * Base for all transactional vector implementations.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
abstract class TransactionalVector[T] extends Transactional { abstract class TransactionalVector[T] extends Transactional {
def add(elem: T) def add(elem: T)
@ -128,6 +138,8 @@ abstract class TransactionalVector[T] extends Transactional {
* Implements an in-memory transactional vector. * Implements an in-memory transactional vector.
* *
* Not thread-safe, but should only be using from within an Actor, e.g. one single thread at a time. * Not thread-safe, but should only be using from within an Actor, e.g. one single thread at a time.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
class InMemoryTransactionalVector[T] extends TransactionalVector[T] { class InMemoryTransactionalVector[T] extends TransactionalVector[T] {
private[kernel] var state: Vector[T] = EmptyVector private[kernel] var state: Vector[T] = EmptyVector
@ -146,6 +158,8 @@ class InMemoryTransactionalVector[T] extends TransactionalVector[T] {
* Implements a transactional reference. * Implements a transactional reference.
* *
* Not thread-safe, but should only be using from within an Actor, e.g. one single thread at a time. * Not thread-safe, but should only be using from within an Actor, e.g. one single thread at a time.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
class TransactionalRef[T] extends Transactional { class TransactionalRef[T] extends Transactional {
private[kernel] var ref: Option[T] = None private[kernel] var ref: Option[T] = None