Merge branch 'master' into wip-perf001-√
This commit is contained in:
commit
7ec8bd9044
44 changed files with 172 additions and 131 deletions
|
|
@ -15,7 +15,7 @@ import akka.cluster.routing.ClusterRouterConfig
|
|||
import akka.event.EventStream
|
||||
import akka.remote.RemoteActorRefProvider
|
||||
import akka.remote.RemoteDeployer
|
||||
import akka.routing.RemoteRouterConfig
|
||||
import akka.remote.routing.RemoteRouterConfig
|
||||
import akka.cluster.routing.ClusterRouterSettings
|
||||
|
||||
class ClusterActorRefProvider(
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import akka.routing.Route
|
|||
import akka.routing.RouteeProvider
|
||||
import akka.routing.Router
|
||||
import akka.routing.RouterConfig
|
||||
import akka.routing.RemoteRouterConfig
|
||||
import akka.remote.routing.RemoteRouterConfig
|
||||
import akka.actor.RootActorPath
|
||||
import akka.actor.ActorCell
|
||||
import akka.actor.RelativeActorPath
|
||||
|
|
|
|||
|
|
@ -51,28 +51,7 @@ What do they do?
|
|||
* Callbacks can be provided for every state entry via `onOpen`, `onClose`, and `onHalfOpen`
|
||||
* These are executed in the :class:`ExecutionContext` provided.
|
||||
|
||||
.. graphviz::
|
||||
|
||||
digraph circuit_breaker {
|
||||
rankdir = "LR";
|
||||
size = "6,5";
|
||||
graph [ bgcolor = "transparent" ]
|
||||
node [ fontname = "Helvetica",
|
||||
fontsize = 14,
|
||||
shape = circle,
|
||||
color = white,
|
||||
style = filled ];
|
||||
edge [ fontname = "Helvetica", fontsize = 12 ]
|
||||
Closed [ fillcolor = green2 ];
|
||||
"Half-Open" [fillcolor = yellow2 ];
|
||||
Open [ fillcolor = red2 ];
|
||||
Closed -> Closed [ label = "Success" ];
|
||||
"Half-Open" -> Open [ label = "Trip Breaker" ];
|
||||
"Half-Open" -> Closed [ label = "Reset Breaker" ];
|
||||
Closed -> Open [ label = "Trip Breaker" ];
|
||||
Open -> Open [ label = "Calls failing fast" ];
|
||||
Open -> "Half-Open" [ label = "Attempt Reset" ];
|
||||
}
|
||||
.. image:: ../images/circuit-breaker-states.png
|
||||
|
||||
========
|
||||
Examples
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import sys, os
|
|||
# -- General configuration -----------------------------------------------------
|
||||
|
||||
sys.path.append(os.path.abspath('_sphinx/exts'))
|
||||
extensions = ['sphinx.ext.todo', 'includecode', 'sphinx.ext.graphviz']
|
||||
extensions = ['sphinx.ext.todo', 'includecode']
|
||||
|
||||
templates_path = ['_templates']
|
||||
source_suffix = '.rst'
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ Querying the Logical Actor Hierarchy
|
|||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Since the actor system forms a file-system like hierarchy, matching on paths is
|
||||
possible in the same was as supported by Unix shells: you may replace (parts
|
||||
possible in the same way as supported by Unix shells: you may replace (parts
|
||||
of) path element names with wildcards (`«*»` and `«?»`) to formulate a
|
||||
selection which may match zero or more actual actors. Because the result is not
|
||||
a single actor reference, it has a different type :class:`ActorSelection` and
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ To prevent visibility and reordering problems on actors, Akka guarantees the fol
|
|||
|
||||
.. note::
|
||||
|
||||
In layman's terms this means that changes to internal fields of the actor is visible when the next message
|
||||
is processed by that actor. So fields in your actor does not need to be volatile or equivalent.
|
||||
In layman's terms this means that changes to internal fields of the actor are visible when the next message
|
||||
is processed by that actor. So fields in your actor need not be volatile or equivalent.
|
||||
|
||||
|
||||
Both rules only apply for the same actor instance and are not valid if different actors are used.
|
||||
|
|
|
|||
19
akka-docs/images/circuit-breaker-states.dot
Normal file
19
akka-docs/images/circuit-breaker-states.dot
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
digraph circuit_breaker {
|
||||
rankdir = "LR";
|
||||
size = "6,5";
|
||||
graph [ bgcolor = "transparent" ]
|
||||
node [ fontname = "Helvetica",
|
||||
fontsize = 14,
|
||||
shape = circle,
|
||||
color = white,
|
||||
style = filled ];
|
||||
edge [ fontname = "Helvetica", fontsize = 12 ]
|
||||
Closed [ fillcolor = green2 ];
|
||||
"Half-Open" [fillcolor = yellow2 ];
|
||||
Open [ fillcolor = red2 ];
|
||||
Closed -> Closed [ label = "Success" ];
|
||||
"Half-Open" -> Open [ label = "Trip Breaker" ];
|
||||
"Half-Open" -> Closed [ label = "Reset Breaker" ];
|
||||
Closed -> Open [ label = "Trip Breaker" ];
|
||||
Open -> Open [ label = "Calls failing fast" ];
|
||||
Open -> "Half-Open" [ label = "Attempt Reset" ];
|
||||
BIN
akka-docs/images/circuit-breaker-states.png
Normal file
BIN
akka-docs/images/circuit-breaker-states.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
|
|
@ -5,7 +5,7 @@ package docs.jrouting;
|
|||
|
||||
import akka.routing.RoundRobinRouter;
|
||||
import akka.routing.DefaultResizer;
|
||||
import akka.routing.RemoteRouterConfig;
|
||||
import akka.remote.routing.RemoteRouterConfig;
|
||||
import akka.actor.ActorRef;
|
||||
import akka.actor.Props;
|
||||
import akka.actor.UntypedActor;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ object DurableMailboxDocSpec {
|
|||
val config = """
|
||||
//#dispatcher-config
|
||||
my-dispatcher {
|
||||
mailbox-type = akka.actor.mailbox.FileBasedMailboxType
|
||||
mailbox-type = akka.actor.mailbox.filebased.FileBasedMailboxType
|
||||
}
|
||||
//#dispatcher-config
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
|
||||
The 2.1 release contains several structural changes that require some
|
||||
simple, mechanical source-level changes in client code. Several things have
|
||||
been moved to Scala standard library, such as ``Future``.
|
||||
been moved to Scala standard library, such as ``Future``, and some package
|
||||
names have been changed in Remoting and Durable Mailboxes.
|
||||
|
||||
When migrating from 1.3.x to 2.1.x you should first follow the instructions for
|
||||
migrating `1.3.x to 2.0.x <http://doc.akka.io/docs/akka/2.0.3/project/migration-guide-1.3.x-2.0.x.html>`_.
|
||||
|
|
@ -383,5 +384,37 @@ v2.0::
|
|||
v2.1::
|
||||
|
||||
final FiniteDuration d = Duration.create("1 second");
|
||||
final Timeout t = new Timeout(d); // always required finite duration, now also in type
|
||||
|
||||
final Timeout t = new Timeout(d); // always required finite duration, now also in type
|
||||
|
||||
Package Name Changes in Remoting
|
||||
================================
|
||||
|
||||
The package name of all classes in the ``akka-remote.jar`` artifact now starts with ``akka.remote``.
|
||||
This has been done to enable OSGi bundles that don't have conflicting package names.
|
||||
|
||||
Change the following import statements. Please note that the serializers are often referenced from configuration.
|
||||
|
||||
================================================ =======================================================
|
||||
Search Replace with
|
||||
================================================ =======================================================
|
||||
``akka.routing.RemoteRouterConfig`` ``akka.remote.routing.RemoteRouterConfig``
|
||||
``akka.serialization.ProtobufSerializer`` ``akka.remote.serialization.ProtobufSerializer``
|
||||
``akka.serialization.DaemonMsgCreateSerializer`` ``akka.remote.serialization.DaemonMsgCreateSerializer``
|
||||
================================================ =======================================================
|
||||
|
||||
Package Name Changes in Durable Mailboxes
|
||||
=========================================
|
||||
|
||||
The package name of all classes in the ``akka-file-mailbox.jar`` artifact now starts with ``akka.actor.mailbox.filebased``.
|
||||
This has been done to enable OSGi bundles that don't have conflicting package names.
|
||||
|
||||
Change the following import statements. Please note that the ``FileBasedMailboxType`` is often referenced from configuration.
|
||||
|
||||
================================================ =========================================================
|
||||
Search Replace with
|
||||
================================================ =========================================================
|
||||
``akka.actor.mailbox.FileBasedMailboxType`` ``akka.actor.mailbox.filebased.FileBasedMailboxType``
|
||||
``akka.actor.mailbox.FileBasedMailboxSettings`` ``akka.actor.mailbox.filebased.FileBasedMailboxSettings``
|
||||
``akka.actor.mailbox.FileBasedMessageQueue`` ``akka.actor.mailbox.filebased.FileBasedMessageQueue``
|
||||
``akka.actor.mailbox.filequeue.*`` ``akka.actor.mailbox.filebased.filequeue.*``
|
||||
================================================ =========================================================
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ package docs.routing
|
|||
import akka.routing.RoundRobinRouter
|
||||
import akka.actor.{ ActorRef, Props, Actor, ActorSystem }
|
||||
import akka.routing.DefaultResizer
|
||||
import akka.routing.RemoteRouterConfig
|
||||
import akka.remote.routing.RemoteRouterConfig
|
||||
|
||||
case class Message1(nbr: Int)
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ package docs.serialization {
|
|||
actor {
|
||||
serializers {
|
||||
java = "akka.serialization.JavaSerializer"
|
||||
proto = "akka.serialization.ProtobufSerializer"
|
||||
proto = "akka.remote.serialization.ProtobufSerializer"
|
||||
myown = "docs.serialization.MyOwnSerializer"
|
||||
}
|
||||
}
|
||||
|
|
@ -122,7 +122,7 @@ package docs.serialization {
|
|||
actor {
|
||||
serializers {
|
||||
java = "akka.serialization.JavaSerializer"
|
||||
proto = "akka.serialization.ProtobufSerializer"
|
||||
proto = "akka.remote.serialization.ProtobufSerializer"
|
||||
myown = "docs.serialization.MyOwnSerializer"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package akka.actor.mailbox
|
||||
package akka.actor.mailbox.filebased
|
||||
|
||||
import akka.actor.mailbox._
|
||||
import akka.actor.{ ActorContext, ActorRef, ActorSystem, ExtendedActorSystem }
|
||||
import akka.event.Logging
|
||||
import com.typesafe.config.Config
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
package akka.actor.mailbox
|
||||
package akka.actor.mailbox.filebased
|
||||
|
||||
import akka.actor.mailbox._
|
||||
import com.typesafe.config.Config
|
||||
import scala.concurrent.util.Duration
|
||||
import java.util.concurrent.TimeUnit.MILLISECONDS
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package akka.actor.mailbox.filequeue
|
||||
package akka.actor.mailbox.filebased.filequeue
|
||||
|
||||
import java.io.IOException
|
||||
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package akka.actor.mailbox.filequeue
|
||||
package akka.actor.mailbox.filebased.filequeue
|
||||
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package akka.actor.mailbox.filequeue
|
||||
package akka.actor.mailbox.filebased.filequeue
|
||||
|
||||
import java.io._
|
||||
import java.nio.{ ByteBuffer, ByteOrder }
|
||||
|
|
@ -15,14 +15,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package akka.actor.mailbox.filequeue
|
||||
package akka.actor.mailbox.filebased.filequeue
|
||||
|
||||
import java.io._
|
||||
import scala.collection.mutable
|
||||
import akka.event.LoggingAdapter
|
||||
import scala.concurrent.util.Duration
|
||||
import java.util.concurrent.TimeUnit
|
||||
import akka.actor.mailbox.FileBasedMailboxSettings
|
||||
import akka.actor.mailbox.filebased.FileBasedMailboxSettings
|
||||
|
||||
// a config value that's backed by a global setting but may be locally overridden
|
||||
class OverlaySetting[T](base: ⇒ T) {
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package akka.actor.mailbox.filequeue
|
||||
package akka.actor.mailbox.filebased.filequeue
|
||||
|
||||
import java.nio.{ ByteBuffer, ByteOrder }
|
||||
|
||||
|
|
@ -15,13 +15,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package akka.actor.mailbox.filequeue
|
||||
package akka.actor.mailbox.filebased.filequeue
|
||||
|
||||
import java.io.File
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import scala.collection.mutable
|
||||
import akka.event.LoggingAdapter
|
||||
import akka.actor.mailbox.FileBasedMailboxSettings
|
||||
import akka.actor.mailbox.filebased.FileBasedMailboxSettings
|
||||
|
||||
class InaccessibleQueuePath extends Exception("Inaccessible queue path: Must be a directory and writable")
|
||||
|
||||
|
|
@ -15,13 +15,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package akka.actor.mailbox.filequeue.tools
|
||||
package akka.actor.mailbox.filebased.filequeue.tools
|
||||
|
||||
import language.reflectiveCalls
|
||||
|
||||
import java.io.{ FileNotFoundException, IOException }
|
||||
import scala.collection.mutable
|
||||
import akka.actor.mailbox.filequeue._
|
||||
import akka.actor.mailbox.filebased.filequeue._
|
||||
import akka.event.LoggingAdapter
|
||||
import akka.actor.ActorSystem
|
||||
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package akka.actor.mailbox.filequeue.tools
|
||||
package akka.actor.mailbox.filebased.filequeue.tools
|
||||
|
||||
object Util {
|
||||
val KILOBYTE = 1024L
|
||||
|
|
@ -1,14 +1,15 @@
|
|||
package akka.actor.mailbox
|
||||
package akka.actor.mailbox.filebased
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
import akka.actor.mailbox._
|
||||
import org.apache.commons.io.FileUtils
|
||||
import akka.dispatch.Mailbox
|
||||
|
||||
object FileBasedMailboxSpec {
|
||||
val config = """
|
||||
File-dispatcher {
|
||||
mailbox-type = akka.actor.mailbox.FileBasedMailboxType
|
||||
mailbox-type = akka.actor.mailbox.filebased.FileBasedMailboxType
|
||||
throughput = 1
|
||||
file-based.directory-path = "file-based"
|
||||
file-based.circuit-breaker.max-failures = 5
|
||||
|
|
@ -13,8 +13,8 @@ akka {
|
|||
actor {
|
||||
|
||||
serializers {
|
||||
proto = "akka.serialization.ProtobufSerializer"
|
||||
daemon-create = "akka.serialization.DaemonMsgCreateSerializer"
|
||||
proto = "akka.remote.serialization.ProtobufSerializer"
|
||||
daemon-create = "akka.remote.serialization.DaemonMsgCreateSerializer"
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ package akka.remote
|
|||
|
||||
import akka.actor._
|
||||
import akka.routing._
|
||||
import akka.remote.routing._
|
||||
import com.typesafe.config._
|
||||
import akka.ConfigurationException
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import javax.net.ssl.{ KeyManagerFactory, TrustManager, TrustManagerFactory, SSL
|
|||
import akka.remote.RemoteTransportException
|
||||
import akka.event.LoggingAdapter
|
||||
import java.io.{ IOException, FileNotFoundException, FileInputStream }
|
||||
import akka.security.provider.AkkaProvider
|
||||
import akka.remote.security.provider.AkkaProvider
|
||||
import java.security._
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
package akka.routing
|
||||
package akka.remote.routing
|
||||
|
||||
import akka.routing.{ Route, Router, RouterConfig, RouteeProvider, Resizer }
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import akka.actor.ActorContext
|
||||
import akka.actor.ActorRef
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
package akka.security.provider
|
||||
package akka.remote.security.provider
|
||||
|
||||
import org.uncommons.maths.random.{ AESCounterRNG }
|
||||
import SeedSize.Seed128
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
package akka.security.provider
|
||||
package akka.remote.security.provider
|
||||
|
||||
import org.uncommons.maths.random.{ AESCounterRNG, SecureRandomSeedGenerator }
|
||||
import SeedSize.Seed128
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
package akka.security.provider
|
||||
package akka.remote.security.provider
|
||||
|
||||
import org.uncommons.maths.random.{ AESCounterRNG }
|
||||
import SeedSize.Seed256
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
package akka.security.provider
|
||||
package akka.remote.security.provider
|
||||
|
||||
import org.uncommons.maths.random.{ AESCounterRNG, SecureRandomSeedGenerator }
|
||||
import SeedSize.Seed256
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
package akka.security.provider
|
||||
package akka.remote.security.provider
|
||||
|
||||
import java.security.{ PrivilegedAction, AccessController, Provider, Security }
|
||||
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ============================================================================
|
||||
package akka.security.provider
|
||||
package akka.remote.security.provider
|
||||
|
||||
import org.uncommons.maths.random.{ SeedGenerator, SeedException, SecureRandomSeedGenerator, RandomDotOrgSeedGenerator, DevRandomSeedGenerator }
|
||||
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package akka.security.provider
|
||||
package akka.remote.security.provider
|
||||
|
||||
/**
|
||||
* Internal API
|
||||
|
|
@ -2,8 +2,9 @@
|
|||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package akka.serialization
|
||||
package akka.remote.serialization
|
||||
|
||||
import akka.serialization.{ Serializer, SerializationExtension }
|
||||
import java.io.Serializable
|
||||
import com.google.protobuf.ByteString
|
||||
import com.typesafe.config.{ Config, ConfigFactory }
|
||||
|
|
@ -2,8 +2,9 @@
|
|||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package akka.serialization
|
||||
package akka.remote.serialization
|
||||
|
||||
import akka.serialization.{ Serializer, Serialization }
|
||||
import com.google.protobuf.Message
|
||||
import akka.actor.DynamicAccess
|
||||
import akka.remote.RemoteProtocol.ActorRefProtocol
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: ProtobufProtocol.proto
|
||||
|
||||
package akka.actor;
|
||||
package akka.remote;
|
||||
|
||||
import com.google.protobuf.AbstractMessage;
|
||||
|
||||
public final class ProtobufProtocol {
|
||||
private ProtobufProtocol() {}
|
||||
|
|
@ -43,12 +45,12 @@ public final class ProtobufProtocol {
|
|||
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return akka.actor.ProtobufProtocol.internal_static_akka_actor_MyMessage_descriptor;
|
||||
return ProtobufProtocol.internal_static_akka_actor_MyMessage_descriptor;
|
||||
}
|
||||
|
||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return akka.actor.ProtobufProtocol.internal_static_akka_actor_MyMessage_fieldAccessorTable;
|
||||
return ProtobufProtocol.internal_static_akka_actor_MyMessage_fieldAccessorTable;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
|
|
@ -175,41 +177,41 @@ public final class ProtobufProtocol {
|
|||
return super.writeReplace();
|
||||
}
|
||||
|
||||
public static akka.actor.ProtobufProtocol.MyMessage parseFrom(
|
||||
public static ProtobufProtocol.MyMessage parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return newBuilder().mergeFrom(data).buildParsed();
|
||||
}
|
||||
public static akka.actor.ProtobufProtocol.MyMessage parseFrom(
|
||||
public static ProtobufProtocol.MyMessage parseFrom(
|
||||
com.google.protobuf.ByteString data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return newBuilder().mergeFrom(data, extensionRegistry)
|
||||
.buildParsed();
|
||||
}
|
||||
public static akka.actor.ProtobufProtocol.MyMessage parseFrom(byte[] data)
|
||||
public static ProtobufProtocol.MyMessage parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return newBuilder().mergeFrom(data).buildParsed();
|
||||
}
|
||||
public static akka.actor.ProtobufProtocol.MyMessage parseFrom(
|
||||
public static ProtobufProtocol.MyMessage parseFrom(
|
||||
byte[] data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return newBuilder().mergeFrom(data, extensionRegistry)
|
||||
.buildParsed();
|
||||
}
|
||||
public static akka.actor.ProtobufProtocol.MyMessage parseFrom(java.io.InputStream input)
|
||||
public static ProtobufProtocol.MyMessage parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return newBuilder().mergeFrom(input).buildParsed();
|
||||
}
|
||||
public static akka.actor.ProtobufProtocol.MyMessage parseFrom(
|
||||
public static ProtobufProtocol.MyMessage parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return newBuilder().mergeFrom(input, extensionRegistry)
|
||||
.buildParsed();
|
||||
}
|
||||
public static akka.actor.ProtobufProtocol.MyMessage parseDelimitedFrom(java.io.InputStream input)
|
||||
public static ProtobufProtocol.MyMessage parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
Builder builder = newBuilder();
|
||||
if (builder.mergeDelimitedFrom(input)) {
|
||||
|
|
@ -218,7 +220,7 @@ public final class ProtobufProtocol {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
public static akka.actor.ProtobufProtocol.MyMessage parseDelimitedFrom(
|
||||
public static ProtobufProtocol.MyMessage parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
|
|
@ -229,12 +231,12 @@ public final class ProtobufProtocol {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
public static akka.actor.ProtobufProtocol.MyMessage parseFrom(
|
||||
public static ProtobufProtocol.MyMessage parseFrom(
|
||||
com.google.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return newBuilder().mergeFrom(input).buildParsed();
|
||||
}
|
||||
public static akka.actor.ProtobufProtocol.MyMessage parseFrom(
|
||||
public static ProtobufProtocol.MyMessage parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
|
|
@ -244,7 +246,7 @@ public final class ProtobufProtocol {
|
|||
|
||||
public static Builder newBuilder() { return Builder.create(); }
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
public static Builder newBuilder(akka.actor.ProtobufProtocol.MyMessage prototype) {
|
||||
public static Builder newBuilder(ProtobufProtocol.MyMessage prototype) {
|
||||
return newBuilder().mergeFrom(prototype);
|
||||
}
|
||||
public Builder toBuilder() { return newBuilder(this); }
|
||||
|
|
@ -257,15 +259,15 @@ public final class ProtobufProtocol {
|
|||
}
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessage.Builder<Builder>
|
||||
implements akka.actor.ProtobufProtocol.MyMessageOrBuilder {
|
||||
implements ProtobufProtocol.MyMessageOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return akka.actor.ProtobufProtocol.internal_static_akka_actor_MyMessage_descriptor;
|
||||
return ProtobufProtocol.internal_static_akka_actor_MyMessage_descriptor;
|
||||
}
|
||||
|
||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return akka.actor.ProtobufProtocol.internal_static_akka_actor_MyMessage_fieldAccessorTable;
|
||||
return ProtobufProtocol.internal_static_akka_actor_MyMessage_fieldAccessorTable;
|
||||
}
|
||||
|
||||
// Construct using akka.actor.ProtobufProtocol.MyMessage.newBuilder()
|
||||
|
|
@ -302,33 +304,33 @@ public final class ProtobufProtocol {
|
|||
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return akka.actor.ProtobufProtocol.MyMessage.getDescriptor();
|
||||
return ProtobufProtocol.MyMessage.getDescriptor();
|
||||
}
|
||||
|
||||
public akka.actor.ProtobufProtocol.MyMessage getDefaultInstanceForType() {
|
||||
return akka.actor.ProtobufProtocol.MyMessage.getDefaultInstance();
|
||||
public ProtobufProtocol.MyMessage getDefaultInstanceForType() {
|
||||
return ProtobufProtocol.MyMessage.getDefaultInstance();
|
||||
}
|
||||
|
||||
public akka.actor.ProtobufProtocol.MyMessage build() {
|
||||
akka.actor.ProtobufProtocol.MyMessage result = buildPartial();
|
||||
public ProtobufProtocol.MyMessage build() {
|
||||
ProtobufProtocol.MyMessage result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
throw AbstractMessage.Builder.newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private akka.actor.ProtobufProtocol.MyMessage buildParsed()
|
||||
private ProtobufProtocol.MyMessage buildParsed()
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
akka.actor.ProtobufProtocol.MyMessage result = buildPartial();
|
||||
ProtobufProtocol.MyMessage result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(
|
||||
result).asInvalidProtocolBufferException();
|
||||
throw AbstractMessage.Builder.newUninitializedMessageException(
|
||||
result).asInvalidProtocolBufferException();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public akka.actor.ProtobufProtocol.MyMessage buildPartial() {
|
||||
akka.actor.ProtobufProtocol.MyMessage result = new akka.actor.ProtobufProtocol.MyMessage(this);
|
||||
public ProtobufProtocol.MyMessage buildPartial() {
|
||||
ProtobufProtocol.MyMessage result = new ProtobufProtocol.MyMessage(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
int to_bitField0_ = 0;
|
||||
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
|
|
@ -349,16 +351,16 @@ public final class ProtobufProtocol {
|
|||
}
|
||||
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
if (other instanceof akka.actor.ProtobufProtocol.MyMessage) {
|
||||
return mergeFrom((akka.actor.ProtobufProtocol.MyMessage)other);
|
||||
if (other instanceof ProtobufProtocol.MyMessage) {
|
||||
return mergeFrom((ProtobufProtocol.MyMessage)other);
|
||||
} else {
|
||||
super.mergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder mergeFrom(akka.actor.ProtobufProtocol.MyMessage other) {
|
||||
if (other == akka.actor.ProtobufProtocol.MyMessage.getDefaultInstance()) return this;
|
||||
public Builder mergeFrom(ProtobufProtocol.MyMessage other) {
|
||||
if (other == ProtobufProtocol.MyMessage.getDefaultInstance()) return this;
|
||||
if (other.hasId()) {
|
||||
setId(other.getId());
|
||||
}
|
||||
|
|
@ -550,8 +552,8 @@ public final class ProtobufProtocol {
|
|||
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||
internal_static_akka_actor_MyMessage_descriptor,
|
||||
new java.lang.String[] { "Id", "Name", "Status", },
|
||||
akka.actor.ProtobufProtocol.MyMessage.class,
|
||||
akka.actor.ProtobufProtocol.MyMessage.Builder.class);
|
||||
ProtobufProtocol.MyMessage.class,
|
||||
ProtobufProtocol.MyMessage.Builder.class);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
|
@ -6,6 +6,7 @@ package akka.remote
|
|||
import akka.testkit._
|
||||
import akka.routing._
|
||||
import akka.actor._
|
||||
import akka.remote.routing._
|
||||
import com.typesafe.config._
|
||||
|
||||
object RemoteRouterSpec {
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package akka.serialization
|
||||
package akka.remote.serialization
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
import akka.serialization.SerializationExtension
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import akka.testkit.AkkaSpec
|
||||
import akka.actor.{ Actor, Address, Props, Deploy, OneForOneStrategy, SupervisorStrategy, FromClassCreator }
|
||||
|
|
@ -2,11 +2,12 @@
|
|||
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
|
||||
package akka.serialization
|
||||
package akka.remote.serialization
|
||||
|
||||
import akka.serialization.SerializationExtension
|
||||
import akka.testkit.AkkaSpec
|
||||
import akka.remote.RemoteProtocol.MessageProtocol
|
||||
import akka.actor.ProtobufProtocol.MyMessage
|
||||
import akka.remote.ProtobufProtocol.MyMessage
|
||||
|
||||
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
||||
class ProtobufSerializerSpec extends AkkaSpec {
|
||||
|
|
@ -36,7 +36,7 @@ object AkkaBuild extends Build {
|
|||
parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", "false").toBoolean,
|
||||
Publish.defaultPublishTo in ThisBuild <<= crossTarget / "repository",
|
||||
Unidoc.unidocExclude := Seq(samples.id),
|
||||
Dist.distExclude := Seq(actorTests.id, akkaSbtPlugin.id, docs.id),
|
||||
Dist.distExclude := Seq(actorTests.id, akkaSbtPlugin.id, docs.id, samples.id),
|
||||
initialCommands in ThisBuild :=
|
||||
"""|import language.postfixOps
|
||||
|import akka.actor._
|
||||
|
|
@ -69,7 +69,7 @@ object AkkaBuild extends Build {
|
|||
sphinxLatex <<= sphinxLatex in LocalProject(docs.id) map identity,
|
||||
sphinxPdf <<= sphinxPdf in LocalProject(docs.id) map identity
|
||||
),
|
||||
aggregate = Seq(actor, testkit, actorTests, dataflow, remote, remoteTests, camel, cluster, slf4j, agent, transactor, mailboxes, zeroMQ, kernel, akkaSbtPlugin, samples, osgi, osgiAries, docs)
|
||||
aggregate = Seq(actor, testkit, actorTests, dataflow, remote, remoteTests, camel, cluster, slf4j, agent, transactor, mailboxes, zeroMQ, kernel, akkaSbtPlugin, osgi, osgiAries, docs)
|
||||
)
|
||||
|
||||
lazy val actor = Project(
|
||||
|
|
@ -275,12 +275,7 @@ object AkkaBuild extends Build {
|
|||
settings = defaultSettings ++ Seq(
|
||||
sbtPlugin := true,
|
||||
publishMavenStyle := false, // SBT Plugins should be published as Ivy
|
||||
publishTo <<= (version) { version: String =>
|
||||
val scalasbt = "http://scalasbt.artifactoryonline.com/scalasbt/"
|
||||
val (name, u) = if (version.contains("-SNAPSHOT")) ("sbt-plugin-snapshots", scalasbt+"sbt-plugin-snapshots")
|
||||
else ("sbt-plugin-releases", scalasbt+"sbt-plugin-releases")
|
||||
Some(Resolver.url(name, url(u))(Resolver.ivyStylePatterns))
|
||||
},
|
||||
publishTo <<= Publish.akkaPluginPublishTo,
|
||||
scalacOptions in Compile := Seq("-encoding", "UTF-8", "-deprecation", "-unchecked"),
|
||||
scalaVersion := "2.9.1",
|
||||
scalaBinaryVersion <<= scalaVersion
|
||||
|
|
@ -299,7 +294,8 @@ object AkkaBuild extends Build {
|
|||
base = file("akka-samples/akka-sample-camel"),
|
||||
dependencies = Seq(actor, camel),
|
||||
settings = defaultSettings ++ Seq(
|
||||
libraryDependencies ++= Dependencies.camelSample
|
||||
libraryDependencies ++= Dependencies.camelSample,
|
||||
publishArtifact in Compile := false
|
||||
)
|
||||
)
|
||||
|
||||
|
|
@ -307,35 +303,35 @@ object AkkaBuild extends Build {
|
|||
id = "akka-sample-fsm",
|
||||
base = file("akka-samples/akka-sample-fsm"),
|
||||
dependencies = Seq(actor),
|
||||
settings = defaultSettings
|
||||
settings = defaultSettings ++ Seq( publishArtifact in Compile := false )
|
||||
)
|
||||
|
||||
lazy val helloSample = Project(
|
||||
id = "akka-sample-hello",
|
||||
base = file("akka-samples/akka-sample-hello"),
|
||||
dependencies = Seq(actor),
|
||||
settings = defaultSettings
|
||||
settings = defaultSettings ++ Seq( publishArtifact in Compile := false )
|
||||
)
|
||||
|
||||
lazy val helloKernelSample = Project(
|
||||
id = "akka-sample-hello-kernel",
|
||||
base = file("akka-samples/akka-sample-hello-kernel"),
|
||||
dependencies = Seq(kernel),
|
||||
settings = defaultSettings
|
||||
settings = defaultSettings ++ Seq( publishArtifact in Compile := false )
|
||||
)
|
||||
|
||||
lazy val remoteSample = Project(
|
||||
id = "akka-sample-remote",
|
||||
base = file("akka-samples/akka-sample-remote"),
|
||||
dependencies = Seq(actor, remote, kernel),
|
||||
settings = defaultSettings
|
||||
settings = defaultSettings ++ Seq( publishArtifact in Compile := false )
|
||||
)
|
||||
|
||||
lazy val clusterSample = Project(
|
||||
id = "akka-sample-cluster",
|
||||
base = file("akka-samples/akka-sample-cluster"),
|
||||
dependencies = Seq(cluster),
|
||||
settings = defaultSettings
|
||||
settings = defaultSettings ++ Seq( publishArtifact in Compile := false )
|
||||
)
|
||||
|
||||
lazy val docs = Project(
|
||||
|
|
@ -514,7 +510,7 @@ object AkkaBuild extends Build {
|
|||
|
||||
val cluster = exports(Seq("akka.cluster.*"))
|
||||
|
||||
val fileMailbox = exports(Seq("akka.actor.mailbox.*"))
|
||||
val fileMailbox = exports(Seq("akka.actor.mailbox.filebased.*"))
|
||||
|
||||
val mailboxesCommon = exports(Seq("akka.actor.mailbox.*"))
|
||||
|
||||
|
|
@ -522,7 +518,7 @@ object AkkaBuild extends Build {
|
|||
|
||||
val osgiAries = exports() ++ Seq(OsgiKeys.privatePackage := Seq("akka.osgi.aries.*"))
|
||||
|
||||
val remote = exports(Seq("akka.remote.*", "akka.routing.*", "akka.serialization.*"))
|
||||
val remote = exports(Seq("akka.remote.*"))
|
||||
|
||||
val slf4j = exports(Seq("akka.event.slf4j.*"))
|
||||
|
||||
|
|
@ -534,16 +530,13 @@ object AkkaBuild extends Build {
|
|||
|
||||
def exports(packages: Seq[String] = Seq()) = osgiSettings ++ Seq(
|
||||
OsgiKeys.importPackage := defaultImports,
|
||||
OsgiKeys.exportPackage := packages,
|
||||
packagedArtifact in (Compile, packageBin) <<= (artifact in (Compile, packageBin), OsgiKeys.bundle).identityMap,
|
||||
artifact in (Compile, packageBin) ~= (_.copy(`type` = "bundle"))
|
||||
OsgiKeys.exportPackage := packages
|
||||
)
|
||||
|
||||
def defaultImports = Seq("!sun.misc", akkaImport(), configImport(), scalaImport(), "*")
|
||||
def akkaImport(packageName: String = "akka.*") = "%s;version=\"[2.1,2.2)\"".format(packageName)
|
||||
def configImport(packageName: String = "com.typesafe.config.*") = "%s;version=\"[0.4.1,0.5)\"".format(packageName)
|
||||
def scalaImport(packageName: String = "scala.*") = "%s;version=\"[2.10,2.11)\"".format(packageName)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,15 @@ object Publish {
|
|||
}
|
||||
}
|
||||
|
||||
def akkaPluginPublishTo: Initialize[Option[Resolver]] = {
|
||||
(version) { version: String =>
|
||||
akkaPublishRepository orElse {
|
||||
val name = if (version.contains("-SNAPSHOT")) "sbt-plugin-snapshots" else "sbt-plugin-releases"
|
||||
Some(Resolver.url(name, url("http://scalasbt.artifactoryonline.com/scalasbt/" + name))(Resolver.ivyStylePatterns))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def sonatypeRepo(version: String): Option[Resolver] = {
|
||||
Option(sys.props("publish.maven.central")) filter (_.toLowerCase == "true") map { _ =>
|
||||
val nexus = "https://oss.sonatype.org/"
|
||||
|
|
@ -83,15 +92,11 @@ object Publish {
|
|||
}
|
||||
|
||||
|
||||
def akkaPublishRepository: Option[Resolver] = {
|
||||
val property = Option(System.getProperty("akka.publish.repository"))
|
||||
property map { "Akka Publish Repository" at _ }
|
||||
}
|
||||
def akkaPublishRepository: Option[Resolver] =
|
||||
Option(System.getProperty("akka.publish.repository", null)) map { "Akka Publish Repository" at _ }
|
||||
|
||||
def akkaCredentials: Seq[Credentials] = {
|
||||
val property = Option(System.getProperty("akka.publish.credentials"))
|
||||
property map (f => Credentials(new File(f))) toSeq
|
||||
}
|
||||
def akkaCredentials: Seq[Credentials] =
|
||||
Option(System.getProperty("akka.publish.credentials", null)) map (f => Credentials(new File(f))) toSeq
|
||||
|
||||
// timestamped versions
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-multi-jvm" % "0.3.0")
|
|||
|
||||
addSbtPlugin("com.typesafe.sbtscalariform" % "sbtscalariform" % "0.4.0")
|
||||
|
||||
addSbtPlugin("com.typesafe.sbtosgi" % "sbtosgi" % "0.2.0")
|
||||
addSbtPlugin("com.typesafe.sbtosgi" % "sbtosgi" % "0.3.0")
|
||||
|
||||
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.3")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue