// Schedule the cancel to actually occur at the specified time. Need to synchronize to
// prevent timeout being removed before it is added.
synchronized (scheduledDeliveries)
{
Timeout timeout =
MessagingTimeoutFactory.instance.getFactory().
schedule(ref.getScheduledDeliveryTime(), new DeliverRefTimeoutTarget(ref));
scheduledDeliveries.add(timeout);
}