public class DefaultQueueHandler extends Object implements NotifdQueueHandler
PAUSE_PENDING, PAUSED, RESUME_PENDING
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED
Constructor and Description |
---|
DefaultQueueHandler()
Constructor for DefaultQueueHandler.
|
Modifier and Type | Method and Description |
---|---|
String |
getName()
Returns the name of this fiber.
|
int |
getStatus()
Returns the current status of the pausable fiber.
|
void |
pause()
Pauses a currently running fiber.
|
void |
processQueue()
processQueue
|
void |
resume()
Resumes the fiber if it is paused.
|
void |
run()
The main worker of the fiber.
|
void |
setInterval(String interval)
setInterval
|
void |
setNoticeQueue(NoticeQueue noticeQueue)
setNoticeQueue
|
void |
setQueueID(String queueID)
setQueueID
|
void |
start()
Starts the fiber.
|
void |
stop()
Stops a currently running fiber.
|
public DefaultQueueHandler()
Constructor for DefaultQueueHandler.
public void setQueueID(String queueID)
setQueueID
setQueueID
in interface NotifdQueueHandler
queueID
- a String
object.public void setNoticeQueue(NoticeQueue noticeQueue)
setNoticeQueue
setNoticeQueue
in interface NotifdQueueHandler
noticeQueue
- a NoticeQueue
object.public void setInterval(String interval)
setInterval
setInterval
in interface NotifdQueueHandler
interval
- a String
object.public void run()
STOP_PENDING
then the method will return as quickly as
possible.public void processQueue()
processQueue
processQueue
in interface NotifdQueueHandler
public void start()
STARTING
and will transition to
RUNNING
when the fiber finishes initializing and begins processing the
encapsulated queue.start
in interface Fiber
IllegalStateException
- Thrown if the fiber is stopped or has never run.public void stop()
stop
in interface Fiber
IllegalStateException
- Thrown if the fiber was never started.public void pause()
pause
in interface PausableFiber
IllegalStateException
- Thrown if the fiber is stopped or has never run.public void resume()
resume
in interface PausableFiber
IllegalStateException
- Thrown if the fiber is stopped or has never run.public String getName()
public int getStatus()
getStatus
in interface Fiber
PausableFiber
,
Fiber
Copyright © 2021. All rights reserved.