public class NodeStarter
extends java.lang.Object
implements org.tanukisoftware.wrapper.WrapperListener
Modifier and Type | Class and Description |
---|---|
static class |
NodeStarter.TestNodeParameters
TODO FIXME: Someone who understands all the parameters please add sane defaults.
|
Modifier and Type | Field and Description |
---|---|
static int |
extBuildNumber |
static java.lang.String |
extRevisionNumber |
Modifier and Type | Method and Description |
---|---|
void |
controlEvent(int event)
Called whenever the native wrapper code traps a system control signal
against the Java process.
|
static Node |
createTestNode(int port,
int opennetPort,
java.lang.String testName,
boolean disableProbabilisticHTLs,
short maxHTL,
int dropProb,
RandomSource random,
Executor executor,
int threadLimit,
long storeSize,
boolean ramStore,
boolean enableSwapping,
boolean enableARKs,
boolean enableULPRs,
boolean enablePerNodeFailureTables,
boolean enableSwapQueueing,
boolean enablePacketCoalescing,
int outputBandwidthLimit,
boolean enableFOAF,
boolean connectToSeednodes,
boolean longPingTimes,
boolean useSlashdotCache,
java.lang.String ipAddressOverride)
Deprecated.
Use
createTestNode(TestNodeParameters) instead |
static Node |
createTestNode(int port,
int opennetPort,
java.lang.String testName,
boolean disableProbabilisticHTLs,
short maxHTL,
int dropProb,
RandomSource random,
Executor executor,
int threadLimit,
long storeSize,
boolean ramStore,
boolean enableSwapping,
boolean enableARKs,
boolean enableULPRs,
boolean enablePerNodeFailureTables,
boolean enableSwapQueueing,
boolean enablePacketCoalescing,
int outputBandwidthLimit,
boolean enableFOAF,
boolean connectToSeednodes,
boolean longPingTimes,
boolean useSlashdotCache,
java.lang.String ipAddressOverride,
boolean enableFCP)
Deprecated.
Use
createTestNode(TestNodeParameters) instead |
static Node |
createTestNode(NodeStarter.TestNodeParameters params)
Create a test node.
|
NodeStarter |
get() |
static java.security.SecureRandom |
getGlobalSecureRandom() |
static long |
getMemoryLimitBytes()
Get the memory limit in bytes.
|
static long |
getMemoryLimitMB()
Get the memory limit in MB.
|
static RandomSource |
globalTestInit(java.io.File baseDirectory,
boolean enablePlug,
Logger.LogLevel logThreshold,
java.lang.String details,
boolean noDNS,
RandomSource randomSource)
VM-specific init.
|
static RandomSource |
globalTestInit(java.lang.String testName,
boolean enablePlug,
Logger.LogLevel logThreshold,
java.lang.String details,
boolean noDNS)
Deprecated.
Instead use
#globalTestInit(File, boolean, LogLevel, String, boolean,
RandomSource) . |
static boolean |
isSomething32bits()
check whether the OS, JVM and wrapper are 64bits
On Windows this will be always true (the wrapper we deploy is 32bits)
|
static boolean |
isTestingVM()
If false, this is some sort of multi-node testing VM
|
static void |
main(java.lang.String[] args) |
void |
restart() |
static void |
start_osgi(java.lang.String[] args) |
java.lang.Integer |
start(java.lang.String[] args)
The start method is called when the WrapperManager is signaled by the
native wrapper code that it can start its application.
|
static void |
stop_osgi(int exitCode) |
int |
stop(int exitCode)
Called when the application is shutting down.
|
public static final int extBuildNumber
public static final java.lang.String extRevisionNumber
public static boolean isTestingVM()
public NodeStarter get()
public java.lang.Integer start(java.lang.String[] args)
start
in interface org.tanukisoftware.wrapper.WrapperListener
args
- List of arguments used to initialize the application.public int stop(int exitCode)
stop
in interface org.tanukisoftware.wrapper.WrapperListener
exitCode
- The suggested exit code that will be returned to the OS
when the JVM exits.public void restart()
public void controlEvent(int event)
controlEvent
in interface org.tanukisoftware.wrapper.WrapperListener
event
- The system control signal.public static void main(java.lang.String[] args)
@Deprecated public static RandomSource globalTestInit(java.lang.String testName, boolean enablePlug, Logger.LogLevel logThreshold, java.lang.String details, boolean noDNS) throws LoggerHook.InvalidThresholdException
#globalTestInit(File, boolean, LogLevel, String, boolean,
RandomSource)
.LoggerHook.InvalidThresholdException
#globalTestInit(File, boolean, LogLevel, String, boolean, RandomSource)
public static RandomSource globalTestInit(java.io.File baseDirectory, boolean enablePlug, Logger.LogLevel logThreshold, java.lang.String details, boolean noDNS, RandomSource randomSource) throws LoggerHook.InvalidThresholdException
baseDirectory
- The directory in which the test data will be placed. Will be created automatically
if it does not exist. You should use the same one in
NodeStarter.TestNodeParameters.baseDirectory
afterwards for each individual test node
as long as it has a distinct port. See its JavaDoc.RandomSource
- The random number generator of the Node. Null for the default of Yarrow
.
DummyRandomSource
in unit tests:RandomSource
, the same one is returned. Otherwise, a new
Yarrow
is returned.LoggerHook.InvalidThresholdException
@Deprecated public static Node createTestNode(int port, int opennetPort, java.lang.String testName, boolean disableProbabilisticHTLs, short maxHTL, int dropProb, RandomSource random, Executor executor, int threadLimit, long storeSize, boolean ramStore, boolean enableSwapping, boolean enableARKs, boolean enableULPRs, boolean enablePerNodeFailureTables, boolean enableSwapQueueing, boolean enablePacketCoalescing, int outputBandwidthLimit, boolean enableFOAF, boolean connectToSeednodes, boolean longPingTimes, boolean useSlashdotCache, java.lang.String ipAddressOverride) throws NodeInitException
createTestNode(TestNodeParameters)
insteadNodeInitException
@Deprecated public static Node createTestNode(int port, int opennetPort, java.lang.String testName, boolean disableProbabilisticHTLs, short maxHTL, int dropProb, RandomSource random, Executor executor, int threadLimit, long storeSize, boolean ramStore, boolean enableSwapping, boolean enableARKs, boolean enableULPRs, boolean enablePerNodeFailureTables, boolean enableSwapQueueing, boolean enablePacketCoalescing, int outputBandwidthLimit, boolean enableFOAF, boolean connectToSeednodes, boolean longPingTimes, boolean useSlashdotCache, java.lang.String ipAddressOverride, boolean enableFCP) throws NodeInitException
createTestNode(TestNodeParameters)
insteadport
- The node port number. Each test node must have a different port
number.testName
- The test name.NodeInitException
- If the node cannot start up for some reason, most
likely a config problem.public static Node createTestNode(NodeStarter.TestNodeParameters params) throws NodeInitException
NodeInitException
- If the node cannot start up for some reason, most
likely a config problem.public static void start_osgi(java.lang.String[] args)
public static void stop_osgi(int exitCode)
public static long getMemoryLimitMB()
public static long getMemoryLimitBytes()
public static final boolean isSomething32bits()
public static java.security.SecureRandom getGlobalSecureRandom()