|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jpos.config.simple.AbstractRegPopulator | +--jpos.config.simple.SimpleRegPopulator
Simple implementation of the JposRegPopulator loading and saving from a serialized set of entries NOTE: this class must define a public no-argument ctor so that it may be created via reflection when its defined in the jpos.properties as the jpos.config.regPopulatorClass
JposPropertiesConst.JPOS_REG_POPULATOR_CLASS_PROP_NAME
Field Summary | |
static java.lang.String |
DEFAULT_JPOS_SER_FILE_NAME
The default serialized JposEntry file name |
static java.lang.String |
SIMPLE_REG_POPULATOR_NAME_STRING
The default name for the SimpleRegPopulator |
static java.lang.String |
TEMP_SER_FILE_NAME
A tempory file name used for temporary storage |
Fields inherited from class jpos.config.simple.AbstractRegPopulator |
lastLoadException |
Constructor Summary | |
SimpleRegPopulator()
Default ctor |
|
SimpleRegPopulator(java.lang.String s)
1-arg ctor that takes the unique ID string |
Method Summary | |
protected java.io.ObjectInputStream |
findSerOIS()
|
protected java.io.ObjectInputStream |
findSerOISInClasspath(java.util.Vector jarZipFilesVector)
Finds the first serialized JposEntry file in directory of each classpath NOTE:Decorated the FileInputStream with a BufferedInputStream to improve load time... |
protected java.io.ObjectInputStream |
findSerOISInJar(java.util.Vector jarFilesVector)
Finds the first serialized JposEntry file in the JAR files |
java.lang.String |
getClassName()
|
java.net.URL |
getEntriesURL()
|
java.lang.String |
getName()
|
void |
load()
Tell the populator to load the entries |
void |
load(java.lang.String fileName)
Loads the entries specified in the fileName |
protected java.util.Enumeration |
readJposEntries()
|
protected java.util.Enumeration |
readJposEntries(java.io.InputStream is)
Searches the current class path for the serialized file and un-serializes the JposEntry objects |
void |
save(java.util.Enumeration entries)
Tell the populator to save the current entries |
void |
save(java.util.Enumeration entries,
java.lang.String fileName)
Tell the populator to save the current entries in the file specified |
protected void |
saveJposEntries(java.util.Enumeration entries)
|
protected void |
saveJposEntries(java.util.Enumeration entries,
java.io.OutputStream os)
Save the JposEntry object to the OutputStream as serialized objects |
protected void |
saveSerFile(java.util.Enumeration entries)
Tries to save the entries in the file where they were loaded |
protected void |
saveSerInZipFile(java.util.Enumeration entries)
Tries to save the entries as a ZipEntry in the ZipFile |
Methods inherited from class jpos.config.simple.AbstractRegPopulator |
createURLFromFile, createURLFromFile, findFileInClasspath, findFileInJarZipFiles, getEntries, getJposEntries, getLastLoadException, getPopulatorFileIS, getPopulatorFileName, getPopulatorFileOS, getPopulatorFileURL, getUniqueId, isComposite, isPopulatorFileDefined, setUniqueId, toString |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final java.lang.String DEFAULT_JPOS_SER_FILE_NAME
public static final java.lang.String TEMP_SER_FILE_NAME
public static final java.lang.String SIMPLE_REG_POPULATOR_NAME_STRING
Constructor Detail |
public SimpleRegPopulator()
public SimpleRegPopulator(java.lang.String s)
s
- the unique ID stringMethod Detail |
public java.lang.String getClassName()
public void save(java.util.Enumeration entries) throws java.lang.Exception
save
in class AbstractRegPopulator
entries
- an enumeration of JposEntry objectsjava.lang.Exception
- if any error occurs while savingpublic void save(java.util.Enumeration entries, java.lang.String fileName) throws java.lang.Exception
save
in class AbstractRegPopulator
entries
- an enumeration of JposEntry objectsfileName
- the file name to save entriesjava.lang.Exception
- if any error occurs while savingpublic void load()
load
in class AbstractRegPopulator
public void load(java.lang.String fileName)
load
in class AbstractRegPopulator
fileName
- the entries file namepublic java.net.URL getEntriesURL()
getEntriesURL
in class AbstractRegPopulator
public java.lang.String getName()
getName
in class AbstractRegPopulator
protected void saveSerInZipFile(java.util.Enumeration entries) throws java.lang.Exception
entries
- an Enumeration of JposEntry objects
NOTE: if the the serialized entries is in a Sip/JAR file then if must be an
entry in the "root" of the Sip/JAR file...
Also when saving in a Zip/JAR file could get an error because the Zip/JAR file
is being used by a process in Win32 environmentjava.lang.Exception
- if any problems occurs while savingprotected void saveSerFile(java.util.Enumeration entries) throws java.lang.Exception
entries
- an Enumeration of JposEntry objectsjava.lang.Exception
- if any problems occurs while savingprotected void saveJposEntries(java.util.Enumeration entries, java.io.OutputStream os) throws java.lang.Exception
entries
- an enumeration of JposEntry objectsos
- the OuputStream to save tojava.lang.Exception
- if any error occurs while savingprotected java.io.ObjectInputStream findSerOIS()
protected java.io.ObjectInputStream findSerOISInClasspath(java.util.Vector jarZipFilesVector)
jarZipFilesVector
- a vector of JAR/Zip file namesprotected java.io.ObjectInputStream findSerOISInJar(java.util.Vector jarFilesVector)
jarFilesVector
- a vector of JAR/Zip file namesprotected java.util.Enumeration readJposEntries(java.io.InputStream is)
is
- the InputStream from which to read the serialized entries fromprotected java.util.Enumeration readJposEntries()
protected void saveJposEntries(java.util.Enumeration entries) throws java.lang.Exception
entries
- an enumeration of JposEntry objectsjava.lang.Exception
- if any error occurs while saving
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |