com.atlassian.confluence.importexport.xmlimport
Class RestorePluginStateStoreTransactionCallbackDecorator

java.lang.Object
  extended by com.atlassian.confluence.importexport.xmlimport.RestorePluginStateStoreTransactionCallbackDecorator
All Implemented Interfaces:
org.springframework.transaction.support.TransactionCallback

public class RestorePluginStateStoreTransactionCallbackDecorator
extends Object
implements org.springframework.transaction.support.TransactionCallback

Decorates a TransactionCallback with logic to take a snapshot of the PluginPersistentStateStore before execution and restore it after execution.

The assumption here is that the given callback is performing a site import which leads to BackupImporter.deleteAllDatabaseContent() thus deleting the persisted state of the implementation. The restoration has to be performed before any #doImportInternal upgrades are performed, as any state changes in the plugin system would cause the MemoryPluginPersistentStateStore from the ConfluencePluginManager to be synchronised. Thus an implementation like this is necessary instead of implementing the PostImportTask or reacting on ImportFinishedEvent as they happen after the upgrades have been performed.

Since:
5.0

Constructor Summary
RestorePluginStateStoreTransactionCallbackDecorator(com.atlassian.plugin.manager.PluginPersistentStateStore pluginStateStore, org.springframework.transaction.support.TransactionCallback delegate)
           
 
Method Summary
 Object doInTransaction(org.springframework.transaction.TransactionStatus status)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestorePluginStateStoreTransactionCallbackDecorator

public RestorePluginStateStoreTransactionCallbackDecorator(com.atlassian.plugin.manager.PluginPersistentStateStore pluginStateStore,
                                                           org.springframework.transaction.support.TransactionCallback delegate)
Method Detail

doInTransaction

public Object doInTransaction(org.springframework.transaction.TransactionStatus status)
Specified by:
doInTransaction in interface org.springframework.transaction.support.TransactionCallback


Copyright © 2003–2015 Atlassian. All rights reserved.