From d9c040a88e9504e91f4164f2f0324009fe73d6f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Mon, 4 Oct 2010 17:45:43 +0200 Subject: [PATCH] Changed ReflectiveAccess to work with enterprise module --- .../main/scala/util/ReflectiveAccess.scala | 10 ++++---- .../src/main/scala/Storage.scala | 25 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/akka-actor/src/main/scala/util/ReflectiveAccess.scala b/akka-actor/src/main/scala/util/ReflectiveAccess.scala index ce6727e8e8..c2a7af6fd9 100644 --- a/akka-actor/src/main/scala/util/ReflectiveAccess.scala +++ b/akka-actor/src/main/scala/util/ReflectiveAccess.scala @@ -223,15 +223,15 @@ object ReflectiveAccess extends Logging { getClassFor("se.scalablesolutions.akka.serialization.Serializer") def ensureEnterpriseEnabled = if (!isEnterpriseEnabled) throw new ModuleNotAvailableException( - "Feature is only available in Akka Enterprise") + "Feature is only available in Akka Enterprise edition") - def createFileBasedMailbox(actorRef: ActorRef): Mailbox = createMailbox("se.scalablesolutions.akka.cluster.FileBasedMailbox", actorRef) + def createFileBasedMailbox(actorRef: ActorRef): Mailbox = createMailbox("se.scalablesolutions.akka.actor.mailbox.FileBasedMailbox", actorRef) - def createZooKeeperBasedMailbox(actorRef: ActorRef): Mailbox = createMailbox("se.scalablesolutions.akka.cluster.ZooKeeperBasedMailbox", actorRef) + def createZooKeeperBasedMailbox(actorRef: ActorRef): Mailbox = createMailbox("se.scalablesolutions.akka.actor.mailbox.ZooKeeperBasedMailbox", actorRef) - def createBeanstalkBasedMailbox(actorRef: ActorRef): Mailbox = createMailbox("se.scalablesolutions.akka.cluster.BeanstalkBasedMailbox", actorRef) + def createBeanstalkBasedMailbox(actorRef: ActorRef): Mailbox = createMailbox("se.scalablesolutions.akka.actor.mailbox.BeanstalkBasedMailbox", actorRef) - def createRedisBasedMailbox(actorRef: ActorRef): Mailbox = createMailbox("se.scalablesolutions.akka.cluster.RedisBasedMailbox", actorRef) + def createRedisBasedMailbox(actorRef: ActorRef): Mailbox = createMailbox("se.scalablesolutions.akka.actor.mailbox.RedisBasedMailbox", actorRef) private def createMailbox(mailboxClassname: String, actorRef: ActorRef): Mailbox = { ensureEnterpriseEnabled diff --git a/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala b/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala index e75fd9581c..2172f73dbb 100644 --- a/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala +++ b/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala @@ -271,7 +271,7 @@ trait PersistentMap[K, V] extends scala.collection.mutable.Map[K, V] def iterator: Iterator[Tuple2[K, V]] - private def register = { + protected def register = { if (transaction.get.isEmpty) throw new NoTransactionInScopeException transaction.get.get.register(uuid, this) } @@ -475,7 +475,7 @@ trait PersistentVector[T] extends IndexedSeq[T] with Transactional with Committa def length: Int = replay.length - private def register = { + protected def register = { if (transaction.get.isEmpty) throw new NoTransactionInScopeException transaction.get.get.register(uuid, this) } @@ -513,18 +513,18 @@ trait PersistentRef[T] extends Transactional with Committable with Abortable { else default } - private def register = { + protected def register = { if (transaction.get.isEmpty) throw new NoTransactionInScopeException transaction.get.get.register(uuid, this) } } - private[akka] object PersistentQueue { - //Operations for PersistentQueue - sealed trait QueueOp - case object ENQ extends QueueOp - case object DEQ extends QueueOp - } +private[akka] object PersistentQueue { + //Operations for PersistentQu eue + sealed trait QueueOp + case object ENQ extends QueueOp + case object DEQ extends QueueOp +} /** * Implementation of PersistentQueue for every concrete @@ -618,7 +618,7 @@ trait PersistentQueue[A] extends scala.collection.mutable.Queue[A] storage.peek(uuid, i, 1)(0) } else { // check we have transient candidates in localQ for DQ - if (localQ.get.isEmpty == false) { + if (!localQ.get.isEmpty) { val (a, q) = localQ.get.dequeue localQ.swap(q) a @@ -656,7 +656,7 @@ trait PersistentQueue[A] extends scala.collection.mutable.Queue[A] override def dequeueAll(p: A => Boolean): scala.collection.mutable.Seq[A] = throw new UnsupportedOperationException("dequeueAll not supported") - private def register = { + protected def register = { if (transaction.get.isEmpty) throw new NoTransactionInScopeException transaction.get.get.register(uuid, this) } @@ -762,7 +762,6 @@ trait PersistentSortedSet[A] extends Transactional with Committable with Abortab def compare(x: (A, Float),y : (A,Float)) = x._2 compare y._2 } - def zrange(start: Int, end: Int): List[(A, Float)] = { // need to operate on the whole range // get all from the underlying storage @@ -780,7 +779,7 @@ trait PersistentSortedSet[A] extends Transactional with Committable with Abortab ts.iterator.slice(s, e + 1).toList } - private def register = { + protected def register = { if (transaction.get.isEmpty) throw new NoTransactionInScopeException transaction.get.get.register(uuid, this) }