|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.brains2b.task.DefaultTask
org.brains2b.coffee.Ticket
public class Ticket
A Ticket is created by the TicketBroker as a result of an Event that should be handled through the queue.
The TicketHandler is supplied, so when the Ticket can be handled from the queue it can just process the Event directly
TicketBroker
,
TicketFarm
,
TicketQueue
Nested Class Summary | |
---|---|
class |
Ticket.Monitor
Implementation of ProgressMonitor to supply progress information from TicketHandler regarding the running Task to this Ticket and TaskListener(s) |
Field Summary | |
---|---|
static int |
RESULT_REMOVE
type of result indicating that this Ticket was removed before starting |
Fields inherited from interface org.brains2b.task.Task |
---|
RESULT_ERROR, RESULT_OK, RESULT_WARNING |
Constructor Summary | |
---|---|
Ticket(TicketHandler server,
CoffeeEvent event)
Constructor |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
two tickets are considered equal if they have the same sequence number |
java.lang.String |
getDescription()
|
CoffeeEvent |
getEvent()
the CoffeeEvent which lead to creating this Ticket |
NNTPMessage |
getMessage()
the NNTPMessage which was is the result of this Ticket |
int |
getSequence()
get the sequence of the Ticket |
TicketHandler |
getTicketHandler()
get the TicketHandler which will handle this Ticket |
boolean |
isWait()
check if this Ticket is paused |
void |
run()
|
void |
setResult(int result)
overridden to make public for TicketQueue |
void |
setWait(boolean wait)
set this Ticket to pause, until released |
Methods inherited from class org.brains2b.task.DefaultTask |
---|
addException, addMessage, addTaskListener, fireTaskEvent, getMax, getMessages, getMin, getPosition, getResult, isFinished, progress, progress, removeTaskListener, setFinished, setMax, setMin |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int RESULT_REMOVE
Constructor Detail |
---|
public Ticket(TicketHandler server, CoffeeEvent event)
server
- TicketHandlerevent
- CoffeeEventMethod Detail |
---|
public void run()
public NNTPMessage getMessage()
public CoffeeEvent getEvent()
public int getSequence()
public TicketHandler getTicketHandler()
TicketHandler
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean isWait()
public void setWait(boolean wait)
wait
- boolean, true to wait,false to releasepublic void setResult(int result)
TicketQueue
setResult
in class org.brains2b.task.DefaultTask
public java.lang.String getDescription()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |