org.jgroups.conf

Class MagicNumberReader


public class MagicNumberReader
extends java.lang.Object

Reads and maintains mapping between magic numbers and classes

Version:
1.0

Author:
Filip Hanik (filip@filip.net)

Field Summary

static String
MAGIC_NUMBER_FILE
protected static Log
log
String
mMagicNumberFile

Method Summary

protected static ClassMap[]
parse(InputStream stream)
protected static ClassMap
parseClassData(Node protocol)
ClassMap[]
readMagicNumberMapping()
try to read the magic number configuration file as a Resource form the classpath using getResourceAsStream if this fails this method tries to read the configuration file from mMagicNumberFile using a FileInputStream (not in classpath but somewhere else in the disk)
void
setFilename(String file)

Field Details

MAGIC_NUMBER_FILE

public static final String MAGIC_NUMBER_FILE


log

protected static Log log


mMagicNumberFile

public String mMagicNumberFile

Method Details

parse

protected static ClassMap[] parse(InputStream stream)
            throws Exception


parseClassData

protected static ClassMap parseClassData(Node protocol)
            throws java.io.IOException


readMagicNumberMapping

public ClassMap[] readMagicNumberMapping()
try to read the magic number configuration file as a Resource form the classpath using getResourceAsStream if this fails this method tries to read the configuration file from mMagicNumberFile using a FileInputStream (not in classpath but somewhere else in the disk)

Returns:
an array of ClassMap objects that where parsed from the file (if found) or an empty array if file not found or had en exception


setFilename

public void setFilename(String file)


Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.