Package org.openas2.processor.receiver
Class PollingModule
- java.lang.Object
-
- All Implemented Interfaces:
Component
,ActiveModule
,ProcessorModule
,ReceiverModule
- Direct Known Subclasses:
DirectoryPollingModule
public abstract class PollingModule extends MessageBuilderModule
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
PollingModule.PollTask
-
Field Summary
Fields Modifier and Type Field Description private boolean
busy
private static java.lang.String
PARAM_POLLING_INTERVAL
private java.util.Timer
timer
-
Fields inherited from class org.openas2.processor.receiver.MessageBuilderModule
PARAM_DEFAULTS, PARAM_DELIMITERS, PARAM_ERROR_DIRECTORY, PARAM_ERROR_FILENAME, PARAM_FORMAT, PARAM_MERGE_EXTRA, PARAM_MIMETYPE, PARAM_RESEND_MAX_RETRIES, PARAM_SENT_DIRECTORY, PARAM_SENT_FILENAME
-
-
Constructor Summary
Constructors Constructor Description PollingModule()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
doStart()
void
doStop()
private int
getInterval()
void
init(Session session, java.util.Map<java.lang.String,java.lang.String> options)
Component lifecycle hook.private boolean
isBusy()
abstract void
poll()
private void
setBusy(boolean b)
-
Methods inherited from class org.openas2.processor.receiver.MessageBuilderModule
buildMessageData, buildMessageMetadata, createMessage, createParser, processDocument
-
Methods inherited from class org.openas2.processor.BaseActiveModule
canHandle, forceStop, handle, healthcheck, isRunning, start, stop, toString
-
Methods inherited from class org.openas2.BaseComponent
destroy, getName, getParameter, getParameter, getParameterInt, getParameters, getSession, setParameter, setParameter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openas2.processor.ActiveModule
healthcheck, isRunning, start, stop
-
Methods inherited from interface org.openas2.Component
destroy, getName, getParameters, getSession
-
Methods inherited from interface org.openas2.processor.ProcessorModule
canHandle, handle
-
-
-
-
Field Detail
-
PARAM_POLLING_INTERVAL
private static final java.lang.String PARAM_POLLING_INTERVAL
- See Also:
- Constant Field Values
-
timer
private java.util.Timer timer
-
busy
private boolean busy
-
-
Method Detail
-
init
public void init(Session session, java.util.Map<java.lang.String,java.lang.String> options) throws OpenAS2Exception
Description copied from interface:Component
Component lifecycle hook. After creating a Component object, this method should be called to set any parameters used by the component. Component implementations typically have required parameter checking and code to start timers and threads within this method.- Specified by:
init
in interfaceComponent
- Overrides:
init
in classMessageBuilderModule
- Parameters:
session
- the component uses this object to access other componentsoptions
- configuration values for the component- Throws:
OpenAS2Exception
- If an error occurs while initializing the component- See Also:
Session
-
getInterval
private int getInterval() throws InvalidParameterException
- Throws:
InvalidParameterException
-
poll
public abstract void poll()
-
doStart
public void doStart() throws OpenAS2Exception
- Specified by:
doStart
in classBaseActiveModule
- Throws:
OpenAS2Exception
-
doStop
public void doStop() throws OpenAS2Exception
- Specified by:
doStop
in classBaseActiveModule
- Throws:
OpenAS2Exception
-
isBusy
private boolean isBusy()
-
setBusy
private void setBusy(boolean b)
-
-