org.jgroups.conf
Class MagicNumberReader

java.lang.Object
  extended by org.jgroups.conf.MagicNumberReader

public class MagicNumberReader
extends java.lang.Object


Field Summary
protected static Log log
           
static java.lang.String MAGIC_NUMBER_FILE
           
 java.lang.String mMagicNumberFile
           
 
Constructor Summary
MagicNumberReader()
           
 
Method Summary
protected static ClassMap[] parse(java.io.InputStream stream)
           
protected static ClassMap parseClassData(org.w3c.dom.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(java.lang.String file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAGIC_NUMBER_FILE

public static final java.lang.String MAGIC_NUMBER_FILE
See Also:
Constant Field Values

mMagicNumberFile

public java.lang.String mMagicNumberFile

log

protected static final Log log
Constructor Detail

MagicNumberReader

public MagicNumberReader()
Method Detail

setFilename

public void setFilename(java.lang.String file)

readMagicNumberMapping

public ClassMap[] readMagicNumberMapping()
                                  throws java.lang.Exception
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
Throws:
java.lang.Exception

parse

protected static ClassMap[] parse(java.io.InputStream stream)
                           throws java.lang.Exception
Throws:
java.lang.Exception

parseClassData

protected static ClassMap parseClassData(org.w3c.dom.Node protocol)
                                  throws java.io.IOException
Throws:
java.io.IOException


Copyright © 1998-2009 Bela Ban / Red Hat. All Rights Reserved.