|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--JavaGroups.Util
Collection of various utility routines that can not be assigned to other classes.
| Constructor Summary | |
Util()
|
|
| Method Summary | |
static java.lang.String |
Array2String(boolean[] array)
|
static java.lang.String |
Array2String(int[] array)
|
static java.lang.String |
Array2String(long[] array)
|
static void |
Crash()
|
static byte[] |
DefragmentBuffer(byte[][] fragments)
Concatenates smaller fragments into entire buffers. |
static void |
DumpStack(boolean exit)
|
static byte[][] |
FragmentBuffer(byte[] buf,
int frag_size)
Fragments a byte buffer into smaller fragments of (max.) frag_size. |
static void |
main(java.lang.String[] args)
|
static java.lang.Object |
ObjectFromByteBuffer(byte[] buffer)
Creates an object from a byte buffer |
static byte[] |
ObjectToByteBuffer(java.lang.Object obj)
Serializes an object into a byte buffer. |
static View |
PeekViews(Channel channel,
int number_of_views,
long timeout)
Peeks for view on the channel until n views have been received or timeout has elapsed. |
static java.util.Vector |
PickSubset(java.util.Vector members,
double subset_percentage)
Selects a random subset of members according to subset_percentage and returns them. |
static void |
Print(java.lang.String msg)
|
static java.lang.String |
PrintEvent(Event evt)
|
static void |
PrintFragments(byte[][] frags)
|
static java.lang.String |
PrintMessage(Message msg)
Tries to read an object from the message's buffer and prints it |
static java.lang.String |
PrintMethodCall(Message msg)
Tries to read a MethodCall object from the message's buffer and prints it. |
static void |
PrintThreads()
|
static void |
Sleep(long timeout)
|
static void |
SleepRandom(long timeout)
Sleeps between 1 and timeout milliseconds, chosen randomly. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public Util()
| Method Detail |
public static java.lang.Object ObjectFromByteBuffer(byte[] buffer)
throws java.lang.Exception
public static byte[] ObjectToByteBuffer(java.lang.Object obj)
throws java.lang.Exception
public static void Sleep(long timeout)
public static void SleepRandom(long timeout)
public static void DumpStack(boolean exit)
public static void Crash()
public static java.lang.String PrintEvent(Event evt)
public static java.lang.String PrintMessage(Message msg)
public static java.lang.String PrintMethodCall(Message msg)
MethodCall object from the message's buffer and prints it.
Returns empty string if object is not a method callpublic static void Print(java.lang.String msg)
public static void PrintThreads()
public static byte[][] FragmentBuffer(byte[] buf,
int frag_size)
byte[]).public static byte[] DefragmentBuffer(byte[][] fragments)
fragments - An array of byte buffers (byte[])public static void PrintFragments(byte[][] frags)
public static View PeekViews(Channel channel,
int number_of_views,
long timeout)
channel - The channel used to peek for views. Has to be operational.number_of_views - The number of views to wait for. 2 is a good number to ensure that,
if there are other members, we start working with them included in our view.timeout - Number of milliseconds to wait until view is forced to return. A value
of <= 0 means wait forever.public static java.lang.String Array2String(long[] array)
public static java.lang.String Array2String(int[] array)
public static java.lang.String Array2String(boolean[] array)
public static java.util.Vector PickSubset(java.util.Vector members,
double subset_percentage)
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||