|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arjuna.ats.arjuna.utils.Utility
public class Utility
Various useful functions that we wrap in a single class. Some of these functions are needed simply for backwards compatibility with older versions of Java.
Field Summary | |
---|---|
static int |
BACKLOG
The maximum queue length for incoming connection indications (a request to connect) |
static int |
MAX_PORT
Maximum value for a socket port |
Constructor Summary | |
---|---|
Utility()
|
Method Summary | |
---|---|
static Process |
getDefaultProcess()
|
static int |
getpid()
|
static Uid |
getProcessUid()
|
static int |
hexStringToInt(java.lang.String s)
Convert a hex String to an integer. |
static long |
hexStringToLong(java.lang.String s)
Convert a hex String to a long. |
static int |
hostInetAddr()
|
static java.net.InetAddress |
hostNameToInetAddress(java.lang.String host,
java.lang.String messageKey)
Convert a host name into an InetAddress object |
static java.lang.String |
intToHexString(int number)
Convert integer to hex String. |
static boolean |
isWindows()
|
static java.lang.String |
longToHexString(long number)
Convert a long to a hex String. |
static java.lang.Integer |
lookupBoundedIntegerProperty(com.arjuna.common.util.propertyservice.PropertyManager pm,
java.lang.String intProperty,
java.lang.Integer defValue,
java.lang.String warnMsgKey,
int minValue,
int maxValue)
Lookup and valid a port number. |
static void |
setProcess(Process p)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BACKLOG
public static final int MAX_PORT
Constructor Detail |
---|
public Utility()
Method Detail |
---|
public static java.lang.String intToHexString(int number) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static int hexStringToInt(java.lang.String s) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static java.lang.String longToHexString(long number) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static long hexStringToLong(java.lang.String s) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static int hostInetAddr() throws java.net.UnknownHostException
java.net.UnknownHostException
public static java.net.InetAddress hostNameToInetAddress(java.lang.String host, java.lang.String messageKey) throws java.net.UnknownHostException
host
- if empty or null then the loopback address is usedmessageKey
- message key to a report warning if host is unknown
java.net.UnknownHostException
- if the hostname cannot be foundpublic static java.lang.Integer lookupBoundedIntegerProperty(com.arjuna.common.util.propertyservice.PropertyManager pm, java.lang.String intProperty, java.lang.Integer defValue, java.lang.String warnMsgKey, int minValue, int maxValue)
intProperty
- property name of an integer valued propertydefValue
- a value to return if intProperty is invalid. If a null value is used and intProperty is invalid then @com.arjuna.ats.arjuna.exceptions.FatalError
is thrownwarnMsgKey
- message key to report a warning if property values is invalidminValue
- minimum value for the integer propertrymaxValue
- maximum value for the integer propertry
public static final int getpid()
public static final Uid getProcessUid()
public static final boolean isWindows()
public static final void setProcess(Process p)
public static final Process getDefaultProcess()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |