Package net.sodacan.core
This package contains most of the Interfaces of Sodacan. It also contains a few of the concrete classes.
InterHost communication
On the other end is a Receiver. A Receiver can be implemented as an HTTP server. However, a Netty server is sufficient because it does not need to spawn a thread to handle the request. Rather, the message is immediately queued for processing within Sodacan. A Receiver is a delegate of a host and is responsible for accepting inbound messages addressed to this host. The receiver dispatches Jugs received to the inbound queue of the appropriate actor group. Implementation Note: Because the path from a received Jug to the target ActorGroup is very short and fast, the server need not bother creating threads to process requests. Details of the steps at this point are:
- Upon receiving an inbound Jug, the Jug is added to the inbound queue of the target ActorGroup. (The ActorGroup will then distribute the Jug to the appropriate Actor's inbound queue.)
- The Receiver can immediately return to listening for the next request. If an HTTP server is used then a response is returned saying, in effect, Jug received and queued.
- The Receiver must determine which ActorGroup to queue the Jug. Once this is done, the Receiver's job is done. The Receiver does not maintain any Jug state.
- The Jug is then further dispatched into the Actor's queue. The ActorGroup then returns to process more Jugs from its queue.
- An internal ActorEntry, on behalf of the Actor, processes inbound Jugs. In a thread allocated to the Actor, a Jug is removed from the queue, deserialized into a Message, and the Actor's "processMessage" method is called, thus concluding the Jug's journey.
Package Contents
This package contains all of the important interfaces used in Sodacan. Each of the packages below this package contain the implementation classes and a more detailed description of the capabilities provided by that package.
- Author:
- John Churin
-
ClassDescriptionAn actor has a unique and permanent Id. An actor is persistent.An actor exists in a single permanent actorGroup.When an actorId is created, it depends on an implementation of this class to determine which ActorGroup to assign the new ActorId to.An actorId is made up of a type, an actorGroup, and a unique id for the instance of the actor.An ActorId has no meaning in the business model.The Sodacan configuration contains settings for specifying factories, singleton objects, and static and dynamic settings.A Host sits at the top of the hierarchy of actorGroups and actors in a single Java applicationWhy the name Jug?OverviewA messageId is statistically unique and sortable by its timestamp.Implementations of this interface save and restore a serialized form of an Actor.A Receiver implementation receives an inbound serialized message and adds the message to an appropriate ActorGroup queue.A message route carries the information needed to get a message to where it is going and what it's purpose is when it gets there.A Sender is a delegate of a Host tasked with sending messages to other hosts.A Serializer is concerned with serializing and deserializing Actors and Messages.While an Actor processes a message, it populates this object with messages to be sent to other actors upon completion of processing the message.