// Package protected ---------------------------------------------
// This should be accessed from this package only
void deleteLargeMessageFile(final LargeServerMessage largeServerMessage) throws HornetQException
{
final SequentialFile file = largeServerMessage.getFile();
if (file == null)
{
return;
}
if (largeServerMessage.isDurable() && isReplicated())
{
readLock();
try
{
if (isReplicated() && replicator.isSynchronizing())
{
synchronized (largeMessagesToDelete)
{
largeMessagesToDelete.add(Long.valueOf(largeServerMessage.getMessageID()));
}
return;
}
}
finally
{
readUnLock();
}
}
Runnable deleteAction = new Runnable()
{
public void run()
{
try
{
readLock();
try
{
if (replicator != null)
{
replicator.largeMessageDelete(largeServerMessage.getMessageID());
}
file.delete();
}
finally
{
readUnLock();
}