Chapter 1. Architecture

Table of Contents

Startup

Essential Objects

Jamama Object/Instance (aka a Configurable)

Objects that are directly configurable through JMX are Configurable. This includes Directors (normally only one), Routers, Repositories and ThirdPartyConfiguroros. These are instantiated by virtue of having a block under <instances> in the Jamama configuration file. (When we implement it, you will be able to create new instances with JMX also).

Repository

A generic data getter/fetcher/remover interface to a storage receptacle backend like a DB or a FS branch. A Repository must be able to handle the type of object that you need to persist, and there may be multiple repositories that can persist a particular object type. Each Repository may implement the ability to manage multiple storage objects, so that one Repository could store the same object to different files or to different mailboxes.

item Mit = Message-In-Transit.

Corresponds to elements in a Sendmail "mailq". Message in mail system which has not reached its final destination (i.e., not delivered to a local mailbox or a remote system or dropped).

Director (Initiates all routing)

This is the only object that "initiates" non-ping routing for a Mit. (A Router may reroute a Mit, but that is nonetheless a Mit in-process; to route ANOTHER Mit, a Router must persist a new Mit (and Server will thereafter pick it up). Periodically runs routingRun(null, Mit.STATE_RUNNOW, false) and routingRun(null, Mit.STATE_DEFERRED, false). This attempts to route all Mits that are ready to go.

Pipeline

Sequenced list of Routers. If every configured Router in were to return STATUS_CONTINUE, they Routers would each be accessed in this order and finally the default routing method in Director, which will abort the Mit.

Jamama

The main Jamama process, Jamama is a JMX Agent. The Director thread (above) is the main thread, and may have subthreads. Jamama also starts up other Servers, each in its own thread, (and they may also have subthreads).

Router

Filtering AND Mit consumption abilities. A Mit is "routed" through a chain of Routers.

Server

Servers must expose the "run" attribute, i.e., setRun(bool) and getRun(). This will typically be accomplished by implenting Runnable and by invoking (thread.start(this)) for setRun(true). These threads typically generate mits like

    Director.createMit().persist(false)

It may have sub-threads, of course.

A Server may also be a Router. (E.g., SMTPServer is primarily a Mit Generator that listens on smtp port in order to create Mits, but it's route() method is also called by Mits running in the same thread-- and only succeeds if the current thread is connected to that host in ETRN mode).

Startup

All of the instances in the main configuration XML file are instantiated.

  • The Director and its pipeline.

  • Repositories

  • Routers

  • Servers

  • Utility objects used or shared by any of the objects above

These objects can thereafter be remotely managed with JMX. For any config change, routers are re-validated and the XML config file is re-written.