Logo Search packages:      
Sourcecode: libjgroups-java version File versions

org::jgroups::util::Util Class Reference

List of all members.


Detailed Description

Collection of various utility routines that can not be assigned to other classes.
Author:
Bela Ban
Version:
Id
Util.java,v 1.137.2.4 2008/05/21 09:52:34 belaban Exp

Definition at line 33 of file Util.java.


Static Public Member Functions

static String activeThreads ()
static boolean all (Collection c, Object obj)
static String array2String (Object[] array)
static String array2String (boolean[] array)
static String array2String (int[] array)
static String array2String (short[] array)
static String array2String (long[] array)
static Message byteBufferToMessage (byte[] buffer, int offset, int length) throws Exception
static List< MessagebyteBufferToMessageList (byte[] buffer, int offset, int length) throws Exception
static void checkBufferSize (String buf_name, long val)
static boolean checkForLinux ()
static boolean checkForSolaris ()
static boolean checkForWindows ()
static void close (Channel...channels)
static void close (Channel ch)
static void close (DatagramSocket my_sock)
static void close (Socket s)
static void close (OutputStream out)
static void close (InputStream inp)
static byte[] collectionToByteBuffer (Collection c) throws Exception
static java.util.List computeFragOffsets (byte[] buf, int frag_size)
static java.util.List computeFragOffsets (int offset, int length, int frag_size)
static void crash ()
static DatagramSocket createDatagramSocket (InetAddress addr, int port) throws Exception
static ServerSocket createServerSocket (InetAddress bind_addr, int start_port)
static ServerSocket createServerSocket (int start_port)
static byte[] defragmentBuffer (byte[] fragments[])
static Vector< AddressdetermineLeftMembers (Vector< Address > old_mbrs, Vector< Address > new_mbrs)
static void doubleWrite (byte[] buf, int offset, int length, OutputStream out) throws Exception
static void doubleWrite (byte[] buf, OutputStream out) throws Exception
static String dumpQueue (Queue q)
static void dumpStack (boolean exit)
static String dumpThreads ()
static boolean fileExists (String fname)
static byte[][] fragmentBuffer (byte[] buf, int frag_size)
static byte[][] fragmentBuffer (byte[] buf, int frag_size, final int length)
static String generateList (Collection c, String separator)
static List< NetworkInterface > getAllAvailableInterfaces () throws SocketException
static InetAddress getBindAddress (Properties props) throws UnknownHostException, SocketException
static InetAddress getFirstNonLoopbackAddress () throws SocketException
static InetAddress getFirstNonLoopbackIPv6Address () throws SocketException
static ThreadGroup getGlobalThreadGroup ()
static String getHostname ()
static int getJavaVersion ()
static MBeanServer getMBeanServer ()
static String getProperty (Protocol prot, String prop_name)
static String getProperty (String[] system_props, Properties props, String prop_name, boolean ignore_sysprops, String default_value)
static InputStream getResourceAsStream (String name, Class clazz)
static String getStackTrace (Throwable t)
static boolean interruptAndWaitToDie (Thread t, long timeout)
static boolean interruptAndWaitToDie (Thread t)
static boolean isBindAddressPropertyIgnored ()
static int keyPress (String msg)
static Class loadClass (String classname, Class clazz) throws ClassNotFoundException
static void main (String args[]) throws Exception
static boolean match (long[] a1, long[] a2)
static boolean match (Object obj1, Object obj2)
static String md5 (String source)
static String memStats (boolean gc)
static Buffer messageToByteBuffer (Message msg) throws IOException
static Buffer msgListToByteBuffer (List< Message > xmit_list) throws IOException
static Object objectFromByteBuffer (byte[] buffer, int offset, int length) throws Exception
static Object objectFromByteBuffer (byte[] buffer) throws Exception
static byte[] objectToByteBuffer (Object obj) throws Exception
static Object oldObjectFromByteBuffer (byte[] buffer, int offset, int length) throws Exception
static Object oldObjectFromByteBuffer (byte[] buffer) throws Exception
static byte[] oldObjectToByteBuffer (Object obj) throws Exception
static InetAddress parseBindAddress (Properties props, String property) throws UnknownHostException
static boolean parseBoolean (Properties props, String property, boolean defaultValue)
static long[] parseCommaDelimitedLongs (String s)
static List< String > parseCommaDelimitedStrings (String l)
static int parseInt (Properties props, String property, int defaultValue)
static List< NetworkInterface > parseInterfaceList (String s) throws Exception
static long parseLong (Properties props, String property, long defaultValue)
static List< String > parseStringList (String l, String separator)
static Object pickRandomElement (Object[] array)
static Object pickRandomElement (List list)
static Vector pickSubset (Vector members, double subset_percentage)
static String print (List< NetworkInterface > interfaces)
static String print (Throwable t)
static String printBytes (double bytes)
static String printBytes (long bytes)
static String printEvent (Event evt)
static void printFragments (byte[] frags[])
static< T > String printListWithDelimiter (Collection< T > list, String delimiter)
static String printMembers (Vector v)
static String printMessage (Message msg)
static String printMethodCall (Message msg)
static String printStackTrace (Throwable t)
static void printThreads ()
static void prompt (String s)
static long random (long range)
static Address readAddress (DataInputStream in) throws IOException, IllegalAccessException, InstantiationException
static Collection< AddressreadAddresses (DataInputStream in, Class cl) throws IOException, IllegalAccessException, InstantiationException
static AuthToken readAuthToken (DataInputStream in) throws IOException, IllegalAccessException, InstantiationException
static byte[] readByteBuffer (DataInputStream in) throws IOException
static Streamable readGenericStreamable (DataInputStream in) throws IOException
static Object readObject (DataInputStream in) throws Exception
static Streamable readStreamable (Class clazz, DataInputStream in) throws IOException, IllegalAccessException, InstantiationException
static String readString (DataInputStream in) throws IOException
static boolean sameHost (Address one, Address two)
static String sha (String source)
static String shortName (InetAddress hostname)
static String shortName (String hostname)
static long size (Collection addrs)
static int size (Address addr)
static int sizeOf (Streamable inst)
static long sizeOf (Object inst)
static long sizeOf (String classname)
static void sleep (long msecs, boolean busy_sleep)
static void sleep (long timeout, int nanos)
static void sleep (long timeout)
static void sleepRandom (long timeout)
static Streamable streamableFromByteBuffer (Class cl, byte[] buffer, int offset, int length) throws Exception
static Streamable streamableFromByteBuffer (Class cl, byte[] buffer) throws Exception
static byte[] streamableToByteBuffer (Streamable obj) throws Exception
static String substituteVariable (String val)
static boolean tossWeightedCoin (double probability)
static< T > Vector< T > unmodifiableVector (Vector<?extends T > v)
static void writeAddress (Address addr, DataOutputStream out) throws IOException
static void writeAddresses (Collection v, DataOutputStream out) throws IOException
static void writeAuthToken (AuthToken token, DataOutputStream out) throws IOException
static void writeByteBuffer (byte[] buf, DataOutputStream out) throws IOException
static void writeFully (ByteBuffer buf, WritableByteChannel out) throws IOException
static void writeGenericStreamable (Streamable obj, DataOutputStream out) throws IOException
static void writeObject (Object obj, DataOutputStream out) throws Exception
static void writeStreamable (Streamable obj, DataOutputStream out) throws IOException
static void writeString (String s, DataOutputStream out) throws IOException

Static Public Attributes

static final int MAX_PORT = 65535

Static Package Functions

 [static initializer]

Static Package Attributes

static boolean JGROUPS_COMPAT = false
static boolean resolve_dns = false

Static Private Member Functions

static String _substituteVar (String val)
static String getProperty (String s)
static String getString (byte[] bytes)
static Address readOtherAddress (DataInputStream in) throws IOException, IllegalAccessException, InstantiationException
static void writeOtherAddress (Address addr, DataOutputStream out) throws IOException

Static Private Attributes

static NumberFormat f
static ThreadGroup GLOBAL_GROUP
static Map PRIMITIVE_TYPES = new HashMap(10)
static final byte TYPE_BOOLEAN = 10
static final byte TYPE_BYTE = 11
static final byte TYPE_CHAR = 12
static final byte TYPE_DOUBLE = 13
static final byte TYPE_FLOAT = 14
static final byte TYPE_INT = 15
static final byte TYPE_LONG = 16
static final byte TYPE_NULL = 0
static final byte TYPE_SERIALIZABLE = 2
static final byte TYPE_SHORT = 17
static final byte TYPE_STREAMABLE = 1
static final byte TYPE_STRING = 18

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index