Configuration for Standalone version
This guide describes how to run primrose inside your standalone java application.
Install jar file
Copy primrose.jar into your applications lib directory (or add it to your CLASSPATH)
Incorporate primrose into your code
- To start one or more pools from a config file :
ListloadedPoolNames = PrimroseLoader.load(args[0], true);
- Or to start a pool from a java.util.Properties object:
Properties props = ... // load Properties object with your pool config data
ListloadedPoolNames = PrimroseLoader.load(props, true);
- Note the boolean flag (createNewPools) on both of those load() methods :
If createNewPools is true, then an existing pool is located, altered accordingly and restarted.
If createNewPools is false, then existing pools for the poolName(s) passed are stopped, and replaced.
-
You may also optionally load a "web console" to monitor your pools via a web browser:
PrimroseWebConsoleLoader.load(8090, "/tmp/webconsole.log", "info,warn,error,crisis");
The arguments are : <port> <log file name> <log level>
Here is a full example of loading primrose : TestPrimroseStandalone.java
Your application should now be running primrose.


