|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.m2mp.M2MPProperties
public class M2MPProperties
Class M2MPProperties provides access to properties that are used to configure
the M2MP Layer. In addition to the M2MP properties below, the device
properties must also be specified. See class DeviceProperties
for further
information. The M2MP Layer properties are as follows:
Daemon
) must be running, and the
edu.rit.m2mp.daemon.port property is set to the local port number on
which the M2MP Daemon process is listening for connections. In this case the
M2MP Layer in the client process communicates with the M2MP Daemon process,
and the M2MP Daemon process communicates in turn with the external network
using the channel defined by the edu.rit.m2mp.channel.class
property.
Channel
. The M2MP Layer creates an instance of
this class using the no-argument constructor. The constructor gets any
necessary parameter values from other properties in the M2MP properties file.
To get the value of a given property, the M2MP Layer first searches for the
property name in the Java system properties by calling System.getProperty()
. If not found
there, the M2MP Layer searches for the property name in the M2MP properties
file (see below). If not found there, the M2MP Layer throws an exception to
indicate the property cannot be found. Thus, property values specified with
the -D option on the java command line override property
values in the M2MP properties file.
To find the M2MP properties file, the M2MP Layer searches for the following files, in order, stopping as soon as it finds one:
If the M2MP properties file cannot be found, the M2MP Layer thows an exception.
The M2MP properties file obeys the format specified in class java.util.Properties
.
To run the M2MP Layer, all the properties listed above (other than
edu.rit.m2mp.properties) must be defined, either as system
properties, or in the M2MP properties file. There are no default values.
Also, all the device properties must be defined, either as system properties,
or in the device properties file; see class DeviceProperties
for further
information.
Here is an example of an M2MP properties file. A copy of this file is included in the M2MP Library (m2mp.properties).
# M2MP Properties File # Message timeout, milliseconds (decimal integer > 0) edu.rit.m2mp.messagetimeout = 5000 # Flow control timeout, milliseconds (decimal integer > 0) edu.rit.m2mp.flowtimeout = 100 # Packet redundancy (decimal integer > 0) edu.rit.m2mp.redundancy = 2 # ReceiverThread debug level (integer) # 0 = Don't print # 1 = Print exception stack traces # 2 = Print exception stack traces and debug messages edu.rit.m2mp.debug.ReceiverThread = 0 # Packet debug level (integer) # 0 = Don't print # 1 = Print packet arrivals and departures # 2 = Print packet arrivals and departures, including packet contents edu.rit.m2mp.debug.packets = 0 # Message filter debug level (integer) # 0 = Don't print # 1 = Print message filter additions and removals # 2 = Print message filter additions and removals including message prefixes edu.rit.m2mp.debug.messagefilters = 0 # M2MP Layer control panel (integer) # 0 = Don't display control panel # 1 = Display control panel edu.rit.m2mp.debug.controlpanel = 0 # M2MP Daemon process's port number (0 if no M2MP Daemon process) edu.rit.m2mp.daemon.port = 5678 # M2MP channel implementation class name edu.rit.m2mp.channel.class = edu.rit.m2mp.udp.UDPMulticastChannel |
Method Summary | |
---|---|
static String |
getChannelClass()
Returns the M2MP channel implementation class name, property edu.rit.m2mp.channel.class. |
static int |
getDaemonPort()
Returns the M2MP Daemon process's port number, property edu.rit.m2mp.daemon.port. |
static int |
getDebugControlPanel()
Returns the debug level telling whether to display the M2MP Layer control panel, property edu.rit.m2mp.debug.controlpanel. |
static int |
getDebugMessageFilters()
Returns the debug level telling which, if any, debugging messages the M2MP Layer should print for each message filter that is added or removed, property edu.rit.m2mp.debug.messagefilters. |
static int |
getDebugPackets()
Returns the debug level telling which, if any, debugging messages the M2MP Layer should print for each M2MP packet that arrives at or departs from the M2MP Layer, property edu.rit.m2mp.debug.packets. |
static int |
getDebugReceiverThread()
Returns the debug level for the ReceiverThread, property edu.rit.m2mp.debug.ReceiverThread. |
static int |
getFlowTimeout()
Returns the flow control timeout interval in milliseconds, property edu.rit.m2mp.flowtimeout. |
static int |
getIntProperty(String name,
int base,
int lb,
int ub,
String valueErrMsg,
String formatErrMsg)
Get the int-valued M2MP property with the given name. |
static int |
getMessageTimeout()
Returns the message timeout interval in milliseconds, property edu.rit.m2mp.messagetimeout. |
static String |
getPropertyValue(String name)
Get the value of the M2MP property with the given name. |
static int |
getRedundancy()
Returns the M2MP packet redundancy, property edu.rit.m2mp.redundancy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int getMessageTimeout()
M2MPPropertyFileException
- (unchecked exception) Thrown if the M2MP properties file cannot be
found or cannot be read.
M2MPPropertyMissingException
- (unchecked exception) Thrown if the property value cannot be found.
M2MPPropertyValueException
- (unchecked exception) Thrown if the property value is not a decimal
integer greater than zero.public static int getFlowTimeout()
M2MPPropertyFileException
- (unchecked exception) Thrown if the M2MP properties file cannot be
found or cannot be read.
M2MPPropertyMissingException
- (unchecked exception) Thrown if the property value cannot be found.
M2MPPropertyValueException
- (unchecked exception) Thrown if the property value is not a decimal
integer greater than zero.public static int getRedundancy()
M2MPPropertyFileException
- (unchecked exception) Thrown if the M2MP properties file cannot be
found or cannot be read.
M2MPPropertyMissingException
- (unchecked exception) Thrown if the property value cannot be found.
M2MPPropertyValueException
- (unchecked exception) Thrown if the property value is not a decimal
integer greater than zero.public static int getDebugReceiverThread()
M2MPPropertyFileException
- (unchecked exception) Thrown if the M2MP properties file cannot be
found or cannot be read.
M2MPPropertyMissingException
- (unchecked exception) Thrown if the property value cannot be found.
M2MPPropertyValueException
- (unchecked exception) Thrown if the property value is not a
decimal integer in the range 0 through 2.public static int getDebugPackets()
M2MPPropertyFileException
- (unchecked exception) Thrown if the M2MP properties file cannot be
found or cannot be read.
M2MPPropertyMissingException
- (unchecked exception) Thrown if the property value cannot be found.
M2MPPropertyValueException
- (unchecked exception) Thrown if the property value is not a
decimal integer in the range 0 through 2.public static int getDebugMessageFilters()
M2MPPropertyFileException
- (unchecked exception) Thrown if the M2MP properties file cannot be
found or cannot be read.
M2MPPropertyMissingException
- (unchecked exception) Thrown if the property value cannot be found.
M2MPPropertyValueException
- (unchecked exception) Thrown if the property value is not a
decimal integer in the range 0 through 2.public static int getDebugControlPanel()
M2MPPropertyFileException
- (unchecked exception) Thrown if the M2MP properties file cannot be
found or cannot be read.
M2MPPropertyMissingException
- (unchecked exception) Thrown if the property value cannot be found.
M2MPPropertyValueException
- (unchecked exception) Thrown if the property value is not a
decimal integer in the range 0 through 1.public static int getDaemonPort()
M2MPPropertyFileException
- (unchecked exception) Thrown if the M2MP properties file cannot be
found or cannot be read.
M2MPPropertyMissingException
- (unchecked exception) Thrown if the property value cannot be found.
M2MPPropertyValueException
- (unchecked exception) Thrown if the property value is not a
decimal integer in the range 0 through 65535.public static String getChannelClass()
M2MPPropertyFileException
- (unchecked exception) Thrown if the M2MP properties file cannot be
found or cannot be read.
M2MPPropertyMissingException
- (unchecked exception) Thrown if the property value cannot be found.public static int getIntProperty(String name, int base, int lb, int ub, String valueErrMsg, String formatErrMsg)
name
- Property name.base
- Number base (10 = decimal, 16 = hexadecimal).lb
- Lower bound value.ub
- Upper bound value.valueErrMsg
- Message for a value error.formatErrMsg
- Message for a format error.
M2MPPropertyFileException
- (unchecked exception) Thrown if the M2MP properties file cannot be
found or cannot be read.
M2MPPropertyMissingException
- (unchecked exception) Thrown if the property value cannot be found.
M2MPPropertyValueException
- (unchecked exception) Thrown if the property value is illegal.public static String getPropertyValue(String name)
name
- Property name.
M2MPPropertyFileException
- (unchecked exception) Thrown if the M2MP properties file cannot be
found or cannot be read.
M2MPPropertyMissingException
- (unchecked exception) Thrown if the property value cannot be found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |