How the Root of RPM Data is built

The class ServerFactory is the root class used by RPM Data. It contains all the other class that will handle sessions, options, the servlets, the managers, etc.
Here are its member data:

    private SessionUtility session = null;
    private ManagerCaller managerCaller;
    private RpmOptions currentOptions;
    private Application applicationInterface;
    private Authenticate authenticateInterface;
    private Authentication authenticationImplementation;
    private SessionCheckoutsDAO sessionCheckoutDAO;
    private DocumentTransferServlet transferServlet;

The default ServerFactory

All the servlets in the RPM Web Services use the default server factory ( ServerFactory.getInstance() ) which is a singleton that is created when the application starts.

Multiple RPM Data Root

It is possible to have more that one RPM Data Root. This might be used to override options internally. For instance, we might want to disable security for external API users, but the Web UI would want to use RPM Data with security enabled.

To do this, all you need to do is create a new ServerFactory with a new instance of the RpmOptions class where you override the specific subset of options you need.

Usage of Singleton pattern

Except for the Server Factory. There should be no other singleton in RPM-Data. We need this to make sure that options that are configured at the factory level are propagated everywhere they might have impacts. The managers can get access to those options by using the link that each MessageContext has to the ServerFactory.