|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.infoasset.platform.documentation.RunTriciaDoc
public class RunTriciaDoc
ProductionMode.
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).
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.
ProductionMode.
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.
Main, which has a
public static main method.
In each plugin (see PluginsDoc), 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.
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.
configuration.xml.
Depending on the run mode, the configuration files are stored at different locations, as shown in this table:
| Test Mode | Production Mode | Staging Mode | |
|---|---|---|---|
Where is the main configuration.xml file loaded
from? |
%TRICIA_WORKSPACE%/toro/config/configuration.xml (*) | %TRICIA_WORKSPACE%/../../properties/configuration.xml (*) | %TRICIA_WORKSPACE%/properties/configuration-%PLUGIN_NAME%.xml |
| Which plugins are available? | all plugins on which the executed plugins depends, according to the Eclipse project dependency |
as specified in configuration.xml |
as specified in configuration-%PLUGIN_NAME%.xml |
| Where are the plugins configured? | %PLUGIN_FOLDER%/config/plugin-config.xml (*) |
in configuration.xml |
in configuration-%PLUGIN_NAME%.xml |
As shown in the table above, in test mode the main configuration and the configuration of the plugins are separately stored, and will be combined together dynamically at runtime. The objective behind this solution is to have working plugin configurations checked in to our code repository.
/plugins/toro/build.xml . There are the following Ant targets
for different configurations:
| Target Name | Run Mode | Configuration File | Classes Lookup |
|---|---|---|---|
configure test core |
test | %TRICIA_WORKSPACE%/plugins/toro/config/configuration.xml | toro |
configure test core - local |
test | %TRICIA_WORKSPACE%/plugins/toro/config/configuration-local.xm | toro |
configure test plugin |
test | %TRICIA_WORKSPACE%/plugins/%PLUGIN_NAME%/config/plugin-config.xm | specific plugin |
configure test plugin - local |
test | %TRICIA_WORKSPACE%/plugins/%PLUGIN_NAME%/config/plugin-config-local.xm | specific plugin |
configure staging |
staging | %TRICIA_WORKSPACE%/properties/configuration.xm | all plugins |
Each Ant target starts a web server on port 8088, and tries to start a browser on this port. If the browser cannot be started automatically, please go manually to the address printed on the console output, e.g.,
[java] browsing URL http://localhost:8088?password=vfo036nqocww
The configurator shows a tree structure which corresponds to classes in the Java code, their properties, and their relationships:
The image shows a configuration with three configured plugins: toro, file, and wiki. The style property has the value jakob,jakobMenu.
If the root node Main is marked green (as in the example image), the configuration is
valid. Otherwise some configuration data is missing and has to be provided to
run Tricia.
After changing properties you can save your change by pressing the
Save button. If you have started the configurator with an Ant
target from inside your Eclipse IDE, you should terminate your configuration
session by pressing the "Stop the Configurator" button in the browser window.
This is necessary, since killing the process in the Eclipse console doesnt
work property due to an Eclipse bug (see http://jira.codehaus.org/browse/JETTY-208).
| Constructor Summary | |
|---|---|
RunTriciaDoc()
|
|
| Method Summary |
|---|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RunTriciaDoc()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||