improved javadoc documentation
This commit is contained in:
parent
7dec0a747c
commit
21e7a6f4b8
6 changed files with 43 additions and 0 deletions
|
|
@ -12,6 +12,8 @@ import java.lang.reflect.Method
|
|||
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ér</a>
|
||||
*/
|
||||
object Boot extends Logging {
|
||||
|
|
|
|||
|
|
@ -12,8 +12,14 @@ import scala.reflect.BeanProperty
|
|||
// ============================================
|
||||
// Java version of the configuration API
|
||||
|
||||
/**
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
sealed class ConfigurationException(msg: String) extends RuntimeException(msg)
|
||||
|
||||
/**
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
sealed abstract class Configuration
|
||||
|
||||
class RestartStrategy(@BeanProperty val scheme: FailOverScheme, @BeanProperty val maxNrOfRetries: Int, @BeanProperty val withinTimeRange: Int) extends Configuration {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,11 @@ import scala.actors.Actor._
|
|||
import java.util.concurrent.atomic.AtomicReference
|
||||
import java.util.concurrent.{ConcurrentLinkedQueue, LinkedBlockingQueue}
|
||||
|
||||
/**
|
||||
* Implements Oz-style dataflow (single assignment) variables.
|
||||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
object DataFlow {
|
||||
def thread(body: => Unit) = {
|
||||
val thread = new IsolatedEventBasedThread(body).start
|
||||
|
|
@ -40,6 +45,9 @@ object DataFlow {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
sealed class DataFlowVariable[T] {
|
||||
|
||||
private sealed abstract class DataFlowVariableMessage
|
||||
|
|
@ -95,6 +103,9 @@ object DataFlow {
|
|||
def shutdown = in ! 'exit
|
||||
}
|
||||
|
||||
/**
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
class DataFlowStream[T] extends Seq[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]]
|
||||
}
|
||||
|
||||
/**
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
class DataFlowVariableException(msg: String) extends RuntimeException(msg)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import java.net.UnknownHostException;
|
|||
|
||||
/**
|
||||
* Base trait for all classes that wants to be able use the logging infrastructure.
|
||||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
trait Logging {
|
||||
@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,
|
||||
* 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.
|
||||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
class LoggableException extends Exception with Logging {
|
||||
private val uniqueId = getExceptionID
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@ package se.scalablesolutions.akka.kernel
|
|||
|
||||
import java.io.{ObjectOutputStream, ByteArrayOutputStream, ObjectInputStream, ByteArrayInputStream}
|
||||
|
||||
/**
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
object Serializer {
|
||||
def deepClone[T <: AnyRef](obj: T): T = in(out(obj)).asInstanceOf[T]
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ trait Transactional {
|
|||
* Base trait for all state implementations (persistent or in-memory).
|
||||
*
|
||||
* TODO: Make this class inherit scala.collection.mutable.Map and/or java.util.Map
|
||||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
trait TransactionalMap[K, V] extends Transactional {
|
||||
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.
|
||||
*
|
||||
* 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ér</a>
|
||||
*/
|
||||
abstract class PersistentTransactionalMap[K, V] extends TransactionalMap[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.
|
||||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
class InMemoryTransactionalMap[K, V] extends TransactionalMap[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.
|
||||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
class CassandraPersistentTransactionalMap(val actorName: String) extends PersistentTransactionalMap[String, String] {
|
||||
override def begin = {}
|
||||
|
|
@ -117,6 +125,8 @@ class CassandraPersistentTransactionalMap(val actorName: String) extends Persist
|
|||
/**
|
||||
* TODO: extend scala.Seq
|
||||
* Base for all transactional vector implementations.
|
||||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
abstract class TransactionalVector[T] extends Transactional {
|
||||
def add(elem: T)
|
||||
|
|
@ -128,6 +138,8 @@ abstract class TransactionalVector[T] extends Transactional {
|
|||
* 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.
|
||||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
class InMemoryTransactionalVector[T] extends TransactionalVector[T] {
|
||||
private[kernel] var state: Vector[T] = EmptyVector
|
||||
|
|
@ -146,6 +158,8 @@ class InMemoryTransactionalVector[T] extends TransactionalVector[T] {
|
|||
* Implements a transactional reference.
|
||||
*
|
||||
* 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ér</a>
|
||||
*/
|
||||
class TransactionalRef[T] extends Transactional {
|
||||
private[kernel] var ref: Option[T] = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue