Renamed ActiveObject factory object to TypedActor. Improved network protocol for TypedActor. Remote TypedActors now identified by UUID.
161 lines
3.6 KiB
Protocol Buffer
161 lines
3.6 KiB
Protocol Buffer
/**
|
|
* Copyright (C) 2009-2010 Scalable Solutions AB <http://scalablesolutions.se>
|
|
*/
|
|
|
|
option java_package = "se.scalablesolutions.akka.remote.protocol";
|
|
option optimize_for = SPEED;
|
|
|
|
/******************************************
|
|
Compile with:
|
|
cd ./akka-core/src/main/protocol
|
|
protoc RemoteProtocol.proto --java_out ../java
|
|
*******************************************/
|
|
|
|
/**
|
|
* Defines a remote ActorRef that "remembers" and uses its original Actor instance
|
|
* on the original node.
|
|
*/
|
|
message RemoteActorRefProtocol {
|
|
required string uuid = 1;
|
|
required string actorClassname = 2;
|
|
required AddressProtocol homeAddress = 3;
|
|
optional uint64 timeout = 4;
|
|
}
|
|
|
|
/**
|
|
* Defines a fully serialized remote ActorRef (with serialized Actor instance)
|
|
* that is about to be instantiated on the remote node. It is fully disconnected
|
|
* from its original host.
|
|
*/
|
|
message SerializedActorRefProtocol {
|
|
required string uuid = 1;
|
|
required string id = 2;
|
|
required string actorClassname = 3;
|
|
required AddressProtocol originalAddress = 4;
|
|
optional bytes actorInstance = 5;
|
|
optional string serializerClassname = 6;
|
|
optional bool isTransactor = 7;
|
|
optional uint64 timeout = 8;
|
|
optional uint64 receiveTimeout = 9;
|
|
optional LifeCycleProtocol lifeCycle = 10;
|
|
optional RemoteActorRefProtocol supervisor = 11;
|
|
optional bytes hotswapStack = 12;
|
|
repeated RemoteRequestProtocol messages = 13;
|
|
}
|
|
|
|
/**
|
|
* Defines a message.
|
|
*/
|
|
message MessageProtocol {
|
|
required SerializationSchemeType serializationScheme = 1;
|
|
required bytes message = 2;
|
|
optional bytes messageManifest = 3;
|
|
}
|
|
|
|
/**
|
|
* Defines the actor info.
|
|
*/
|
|
message ActorInfoProtocol {
|
|
required string uuid = 1;
|
|
required string target = 2;
|
|
required uint64 timeout = 3;
|
|
required ActorType actorType = 4;
|
|
optional TypedActorInfoProtocol typedActorInfo = 5;
|
|
}
|
|
|
|
/**
|
|
* Defines the typed actor extra info.
|
|
*/
|
|
message TypedActorInfoProtocol {
|
|
required string interface = 1;
|
|
required string method = 2;
|
|
}
|
|
|
|
/**
|
|
* Defines a remote message request.
|
|
*/
|
|
message RemoteRequestProtocol {
|
|
required uint64 id = 1;
|
|
required MessageProtocol message = 2;
|
|
required ActorInfoProtocol actorInfo = 3;
|
|
required bool isOneWay = 4;
|
|
optional string supervisorUuid = 5;
|
|
optional RemoteActorRefProtocol sender = 6;
|
|
}
|
|
|
|
/**
|
|
* Defines a remote message reply.
|
|
*/
|
|
message RemoteReplyProtocol {
|
|
required uint64 id = 1;
|
|
optional MessageProtocol message = 2;
|
|
optional ExceptionProtocol exception = 3;
|
|
optional string supervisorUuid = 4;
|
|
required bool isActor = 5;
|
|
required bool isSuccessful = 6;
|
|
}
|
|
|
|
/**
|
|
* Defines the actor type.
|
|
*/
|
|
enum ActorType {
|
|
SCALA_ACTOR = 1;
|
|
JAVA_ACTOR = 2;
|
|
TYPED_ACTOR = 3;
|
|
}
|
|
|
|
/**
|
|
* Defines the serialization scheme used to serialize the message and/or Actor instance.
|
|
*/
|
|
enum SerializationSchemeType {
|
|
JAVA = 1;
|
|
SBINARY = 2;
|
|
SCALA_JSON = 3;
|
|
JAVA_JSON = 4;
|
|
PROTOBUF = 5;
|
|
}
|
|
|
|
/**
|
|
* Defines the type of the life-cycle of a supervised Actor.
|
|
*/
|
|
enum LifeCycleType {
|
|
PERMANENT = 1;
|
|
TEMPORARY = 2;
|
|
}
|
|
|
|
/*
|
|
enum DispatcherType {
|
|
GLOBAL_EVENT_EXECUTOR_BASED = 1;
|
|
GLOBAL_REACTOR_SINGLE_THREAD_BASED = 2;
|
|
GLOBAL_REACTOR_THREAD_POOL_BASED = 3;
|
|
EVENT_EXECUTOR_BASED = 4;
|
|
THREAD_BASED = 5;
|
|
}
|
|
*/
|
|
|
|
/**
|
|
* Defines the life-cycle of a supervised Actor.
|
|
*/
|
|
message LifeCycleProtocol {
|
|
required LifeCycleType lifeCycle = 1;
|
|
optional string preRestart = 2;
|
|
optional string postRestart = 3;
|
|
optional string init = 4;
|
|
optional string shutdown = 5;
|
|
}
|
|
|
|
/**
|
|
* Defines a remote address.
|
|
*/
|
|
message AddressProtocol {
|
|
required string hostname = 1;
|
|
required uint32 port = 2;
|
|
}
|
|
|
|
/**
|
|
* Defines an exception.
|
|
*/
|
|
message ExceptionProtocol {
|
|
required string classname = 1;
|
|
required string message = 2;
|
|
}
|