java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.client.MessageReceivedJob
- All Implemented Interfaces:
Job
Async job to notify the client that a new message is available for them, or just send it directly if specified.
Field Summary
Constructor Summary
ConstructorsConstructorDescriptionMessageReceivedJob(RouterContext ctx, ClientConnectionRunner runner, Destination toDest, Destination fromDest, Payload payload, boolean sendDirect) Create a job that delivers one received message to a client.Method Summary
All MethodsMethods inherited from class JobImpl
dropped, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringModifier and TypeMethodDescriptionvoiddropped()Default implementation does nothing.final RouterContextThe router context that this job belongs to.longgetJobId()The unique job ID for this job.longThe timestamp when this job was last made ready for execution.The timing object for this job.voidmadeReady(long now) For JobQueue only, not for external use.protected voidrequeue(long delayMs) Requeue this job to run after the specified delay.toString()
Constructor Details
MessageReceivedJob
public MessageReceivedJob(RouterContext ctx, ClientConnectionRunner runner, Destination toDest, Destination fromDest, Payload payload, boolean sendDirect) Create a job that delivers one received message to a client.- Parameters:
ctx- the router contextrunner- the client connection runnertoDest- non-null, required to pick sessionfromDest- sending destination, generally nullpayload- the message payloadsendDirect- if true send directly
Method Details
getName
runJob
public void runJob()Description copied from interface:JobActually perform the task. This call blocks until the Job is complete.receiveMessage
public boolean receiveMessage()Same as runJob() but with a return value.- Returns:
- true if the payload was handed over, false if the runner is dead or the send threw