Class RunTriciaDoc
in package de.infoasset.platform.documentation
- Declaration
- public class RunTriciaDoc
- extends Object
- Hierarchy
java.lang.Object
de.infoasset.platform.documentation.RunTriciaDoc
How to Run a Tricia Application?
Tricia can run in two quite different environments:- standalone in a production or staging environment, and
- in the Eclipse IDE as part of the development process.
In the second case, we provide Eclipse run configurations as part of our repository (see http://agile.csc.ncsu.edu/SEMaterials/tutorials/eclipse/eclipse_tutorial_3.5 .html#section11_0).
Run Modes - Overview
Besides the basic classpath setup, there are some other differences in how Tricia behaves in these different modes. These differences are handled by the RunMode singleton, which can be accessed by the RunMode.INSTANCE() method.There are three different subclasses of the abstract RunMode class, which are shown in this class diagram:
These run modes have the following characteristics.
Production Mode
As the name suggest, this run mode is used for productive Tricia instances. For details see ProductionMode.Test Mode
Developers mostly run Tricia in this run mode. The main objective of the test mode is to make testing and debugging Tricia as easy as possible. In order to make it easy to reproduce certain system states exactly, in test mode the database is cleaned completely on startup and if a test case starts running.Running in test mode is possible without an externally installed relational database, since Tricia comes with the lightweight in-memory database HSQLDB. The test mode can be started out-of-the-box without any local configuration necessary. See TestMode for more details.
Staging Mode
This mode is derived from the production mode, but is intended to be used by developers. Sometimes it is necesarry to reproduce the state of a productive Tricia instance for testing purposes. Therefore, in staging mode Tricia does not clean the database on startup, but runs still in the Eclipse IDE.Starting Tricia
The entry point for starting Tricia is the class Main, which has a public static main method.In each plugin (see Plugin), there is a file called %PROJECT-NAME%-test.launch. This launch configuration can be started inside of Eclipse by right-clicking on it and then choosing Run As -> %PROJECT-NAME%-run. For developers this is the prefered way of running a Tricia instance. The same way Tricia can be started in debug mode (Debug As -> %PROJECT-NAME%-run). Doing so is a good idea since it runs nearly as fast and makes debugging and hot code swapping possible.
When Tricia is started in test or staging mode it is available at port 8083 unless specified differently in the configuration.
The run mode to be used is specified by the system property runMode. Starting Tricia in test mode is therefore specified by the VM argument -DrunMode=test. If no run mode is specified, Tricia starts in production mode.
Furter reading
ConfigurationDocConstructor Summary
Constructor Detail
RunTriciaDoc
public RunTriciaDoc()
|
Referenced by
(12)
|
0 Comments