Methods Summary |
---|
public void | release()
released = true;
if( trace )
log.trace("released");
|
public void | run()
if( trace )
log.trace("Begin run");
while( released == false )
{
try
{
MailActivation ma = (MailActivation) pollQueue.take();
if( ma.isReleased() )
continue;
// Wait until its time to check for new msgs
long now = System.currentTimeMillis();
long nextTime = ma.getNextNewMsgCheckTime();
long sleepMS = nextTime - now;
Thread.sleep(sleepMS);
if( released )
break;
// Now schedule excecution of the new msg check
mgr.scheduleWork(ma, WorkManager.INDEFINITE, null, this);
}
catch(InterruptedException e)
{
log.warn("Interrupted waiting for new msg check", e);
}
catch (WorkException e)
{
log.warn("Failed to schedule new msg check", e);
}
}
if( trace )
log.trace("End run");
|
public void | watch(MailActivation activation)
long now = System.currentTimeMillis();
activation.updateNextNewMsgCheckTime(now);
pollQueue.put(activation);
|
public void | workAccepted(javax.resource.spi.work.WorkEvent e)
if( trace )
log.trace("workAccepted, e="+e);
|
public void | workCompleted(javax.resource.spi.work.WorkEvent e)
if( trace )
log.trace("workCompleted, e="+e);
MailActivation activation = (MailActivation) e.getWork();
try
{
watch(activation);
}
catch(InterruptedException ex)
{
log.warn("Failed to reschedule new msg check", ex);
}
|
public void | workRejected(javax.resource.spi.work.WorkEvent e)
if( trace )
log.trace("workRejected, e="+e);
|
public void | workStarted(javax.resource.spi.work.WorkEvent e)
if( trace )
log.trace("workStarted, e="+e);
|