|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.isti.util.MsgViaFileProcessor
Class MsgViaFileProcessor.java defines a message-via-file processor. An input directory is polled for new files; anytime one is found it is moved to a processing directory, read, processed by a call-back object, and then moved to a storage directory or deleted.
Nested Class Summary | |
protected class |
MsgViaFileProcessor.MsgFileProcessingThread
Class MsgFileProcessingThread defines the messages-via-file processsing thread. |
static interface |
MsgViaFileProcessor.ProcMsgCallBack
Interface ProcMsgCallBack defines a method for processing a message and returning a completion/success result. |
static class |
MsgViaFileProcessor.ViaFileProperties
Class ViaFileProperties manages a set of configuration property items used with the 'MsgViaFileProcessor' class. |
Field Summary | |
protected static java.lang.String |
DEF_PROCDIR_NAME
|
protected java.io.File |
inputDirFileObj
|
protected int |
inputPollDelayMS
|
protected static int |
MAX_STORAGE_AGE_CHECK_SECS
|
protected MsgViaFileProcessor.MsgFileProcessingThread |
msgFileProcessingThreadObj
|
protected java.io.File |
processDirFileObj
|
protected MsgViaFileProcessor.ProcMsgCallBack |
procMsgCallBackObj
|
protected int |
storageAgeSecsVal
|
protected java.io.File |
storageDirFileObj
|
Constructor Summary | |
MsgViaFileProcessor(java.io.File inputDirFile,
java.io.File storageDirFile,
java.io.File processDirFile,
int pollDelayMS,
int storageAgeSecs,
MsgViaFileProcessor.ProcMsgCallBack procMsgCallBack)
Creates a message-via-file processor. |
|
MsgViaFileProcessor(MsgViaFileProcessor.ViaFileProperties viaFileProps,
MsgViaFileProcessor.ProcMsgCallBack procMsgCallBack)
Creates a message-via-file processor using to given set of configuration-property objects. |
|
MsgViaFileProcessor(java.lang.String inputDirName,
java.lang.String storageDirName,
java.lang.String processDirName,
int pollDelayMS,
int storageAgeSecs,
MsgViaFileProcessor.ProcMsgCallBack procMsgCallBack)
Creates a message-via-file processor. |
Method Summary | |
void |
startProcessing()
Starts the messages-via-file processsing thread. |
void |
stopProcessing()
Stops the messages-via-file processsing thread. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String DEF_PROCDIR_NAME
protected static final int MAX_STORAGE_AGE_CHECK_SECS
protected final java.io.File inputDirFileObj
protected final java.io.File storageDirFileObj
protected final java.io.File processDirFileObj
protected final int inputPollDelayMS
protected final int storageAgeSecsVal
protected final MsgViaFileProcessor.ProcMsgCallBack procMsgCallBackObj
protected MsgViaFileProcessor.MsgFileProcessingThread msgFileProcessingThreadObj
Constructor Detail |
public MsgViaFileProcessor(java.io.File inputDirFile, java.io.File storageDirFile, java.io.File processDirFile, int pollDelayMS, int storageAgeSecs, MsgViaFileProcessor.ProcMsgCallBack procMsgCallBack) throws java.io.IOException
inputDirFile
- the input directory to poll for message files,
or null to use the current directory.storageDirFile
- the storage directory to use, or null for none.processDirFile
- the process directory to use for message files,
or null to use the default directory "msgProcess".pollDelayMS
- the delay, in milliseconds, between polls of the
input directory to check for new files.storageAgeSecs
- the maximum time, in seconds, to keep copies
of the message files; or 0 to keep no copies.procMsgCallBack
- the call-back object to use to process the
message data read from the input files.
java.io.IOException
- if the given input, process or storage directory
is not found and cannot be created.
java.lang.IllegalArgumentException
- if the given input and storage
directories are the same.public MsgViaFileProcessor(java.lang.String inputDirName, java.lang.String storageDirName, java.lang.String processDirName, int pollDelayMS, int storageAgeSecs, MsgViaFileProcessor.ProcMsgCallBack procMsgCallBack) throws java.io.IOException
inputDirName
- the input directory to poll for message files,
or null to use the current directory.storageDirName
- the storage directory to use, or null for none.processDirName
- the process directory to use for message files,
or null to use the default directory "msgProcess".pollDelayMS
- the delay, in milliseconds, between polls of the
input directory to check for new files.storageAgeSecs
- the maximum time, in seconds, to keep copies
of the message files; or 0 to keep no copies.procMsgCallBack
- the call-back object to use to process the
message data read from the input files.
java.io.IOException
- if the given input, process or storage directory
is not found and cannot be created.
java.lang.IllegalArgumentException
- if the given input and storage
directories are the same.public MsgViaFileProcessor(MsgViaFileProcessor.ViaFileProperties viaFileProps, MsgViaFileProcessor.ProcMsgCallBack procMsgCallBack) throws java.io.IOException
viaFileProps
- the set of configuration-property objects to use.procMsgCallBack
- the call-back object to use to process the
message data read from the input files.
java.io.IOException
- if the given input, process or storage directory
is not found and cannot be created.
java.lang.IllegalArgumentException
- if the given input and storage
directories are the same.Method Detail |
public void startProcessing()
public void stopProcessing()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |