org.jgroups.conf

Class ClassConfigurator

public class ClassConfigurator extends Object

This class will be replaced with the class that read info from the magic number configurator that reads info from the xml file. The name and the relative path of the magic number map file can be specified as value of the property org.jgroups.conf.magicNumberFile. It must be relative to one of the classpath elements, to allow the classloader to locate the file. If a value is not specified, MagicNumberReader.MAGIC_NUMBER_FILE is used, which defaults to "jg-magic-map.xml".

Author: Filip Hanik Bela Ban

See Also: MagicNumberReader

Field Summary
protected Loglog
Method Summary
Classget(int magic)
Returns a class for a magic number.
Classget(String clazzname)
Loads and returns the class from the class name
static ClassConfiguratorgetInstance(boolean init)
intgetMagicNumber(Class clazz)
Returns the magic number for the class.
intgetMagicNumberFromObjectStreamClass(ObjectStreamClass objStream)
ObjectStreamClassgetObjectStreamClassFromMagicNumber(int magic_number)
voidinit()
static voidmain(String[] args)
StringprintClassMap()
StringprintMagicMap()
StringtoString()

Field Detail

log

protected final Log log

Method Detail

get

public Class get(int magic)
Returns a class for a magic number. Returns null if no class is found

Parameters: magic the magic number that maps to the class

Returns: a Class object that represents a class that implements java.io.Externalizable

get

public Class get(String clazzname)
Loads and returns the class from the class name

Parameters: clazzname a fully classified class name to be loaded

Returns: a Class object that represents a class that implements java.io.Externalizable

getInstance

public static ClassConfigurator getInstance(boolean init)

getMagicNumber

public int getMagicNumber(Class clazz)
Returns the magic number for the class.

Parameters: clazz a class object that we want the magic number for

Returns: the magic number for a class, -1 if no mapping is available

getMagicNumberFromObjectStreamClass

public int getMagicNumberFromObjectStreamClass(ObjectStreamClass objStream)

getObjectStreamClassFromMagicNumber

public ObjectStreamClass getObjectStreamClassFromMagicNumber(int magic_number)

init

public void init()

main

public static void main(String[] args)

printClassMap

public String printClassMap()

printMagicMap

public String printMagicMap()

toString

public String toString()
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.