Fixed ALF-4682: ActionTrackingService uses cluster- and transactionally-unsafe cache

- Added missing cluster config for 'executingActionsCache' but also 'routingContentStoreCache'
 - ActionTrackingServiceImpl uses injected SimpleCache; configured to be a wrapping TransactionalCache
 - Fixed line endings on ActionTrackingServiceImpl.java


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22315 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2010-09-07 20:30:30 +00:00
parent 01b5a926d7
commit 8c10779861
5 changed files with 585 additions and 516 deletions

View File

@@ -124,7 +124,7 @@
<ref bean="actionService" /> <ref bean="actionService" />
</property> </property>
<property name="executingActionsCache"> <property name="executingActionsCache">
<ref bean="executingActionsSharedCache" /> <ref bean="executingActionsCache" />
</property> </property>
</bean> </bean>

View File

@@ -50,7 +50,7 @@
</bean> </bean>
<!-- ===================================== --> <!-- ===================================== -->
<!-- ID lookup for Encoding entities --> <!-- ID lookup for ContentData entities -->
<!-- ===================================== --> <!-- ===================================== -->
<!-- The cross-transaction shared cache for ContentData --> <!-- The cross-transaction shared cache for ContentData -->
@@ -401,6 +401,10 @@
</property> </property>
</bean> </bean>
<!-- ===================================== -->
<!-- ACL Readers cache -->
<!-- ===================================== -->
<!-- The cross-transaction shared cache for ACL readers --> <!-- The cross-transaction shared cache for ACL readers -->
<bean name="readersSharedCache" class="org.alfresco.repo.cache.EhCacheAdapter"> <bean name="readersSharedCache" class="org.alfresco.repo.cache.EhCacheAdapter">
@@ -1044,7 +1048,7 @@
<ref bean="internalEHCacheManager" /> <ref bean="internalEHCacheManager" />
</property> </property>
<property name="cacheName"> <property name="cacheName">
<value>org.alfresco.cache.routingContentStoreSharedCache</value> <value>org.alfresco.cache.routingContentStoreCache</value>
</property> </property>
</bean> </bean>
</property> </property>
@@ -1068,7 +1072,7 @@
<!-- Executing Actions caches --> <!-- Executing Actions caches -->
<!-- ===================================== --> <!-- ===================================== -->
<!-- The cross-transaction shared cache for AbstractRoutingContentStore --> <!-- The cross-transaction shared cache for Executing Actions -->
<bean name="executingActionsSharedCache" class="org.alfresco.repo.cache.EhCacheAdapter"> <bean name="executingActionsSharedCache" class="org.alfresco.repo.cache.EhCacheAdapter">
<property name="cache"> <property name="cache">
@@ -1077,10 +1081,24 @@
<ref bean="internalEHCacheManager" /> <ref bean="internalEHCacheManager" />
</property> </property>
<property name="cacheName"> <property name="cacheName">
<value>org.alfresco.cache.executingActionsSharedCache</value> <value>org.alfresco.cache.executingActionsCache</value>
</property> </property>
</bean> </bean>
</property> </property>
</bean> </bean>
<!-- The transactional cache for Executing Actions -->
<bean name="executingActionsCache" class="org.alfresco.repo.cache.TransactionalCache">
<property name="sharedCache">
<ref bean="executingActionsSharedCache" />
</property>
<property name="name">
<value>org.alfresco.cache.executingActionsTransactionalCache</value>
</property>
<property name="maxCacheSize">
<value>1000</value>
</property>
</bean>
</beans> </beans>

View File

@@ -370,4 +370,14 @@
statistics="false" statistics="false"
/> />
<!-- Executing Actions -->
<cache
name="org.alfresco.cache.executingActionsCache"
maxElementsInMemory="1000"
eternal="true"
overflowToDisk="false"
statistics="false"
/>
</ehcache> </ehcache>

View File

@@ -806,4 +806,44 @@
</cache> </cache>
<!-- Routing Content Store -->
<cache
name="org.alfresco.cache.routingContentStoreCache"
maxElementsInMemory="10000"
eternal="true"
overflowToDisk="false"
statistics="false"
>
<cacheEventListenerFactory
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicatePuts = false,
replicateUpdates = true,
replicateRemovals = true,
replicateUpdatesViaCopy = false,
replicateAsynchronously = false"/>
</cache>
<!-- Executing Actions -->
<cache
name="org.alfresco.cache.executingActionsCache"
maxElementsInMemory="1000"
eternal="true"
overflowToDisk="false"
statistics="false"
>
<cacheEventListenerFactory
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicatePuts = false,
replicateUpdates = true,
replicateRemovals = true,
replicateUpdatesViaCopy = false,
replicateAsynchronously = false"/>
</cache>
</ehcache> </ehcache>

View File

@@ -27,6 +27,7 @@ import java.util.List;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import org.alfresco.repo.cache.EhCacheAdapter; import org.alfresco.repo.cache.EhCacheAdapter;
import org.alfresco.repo.cache.SimpleCache;
import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport; import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
@@ -55,7 +56,7 @@ public class ActionTrackingServiceImpl implements ActionTrackingService
*/ */
private static Log logger = LogFactory.getLog(ActionTrackingServiceImpl.class); private static Log logger = LogFactory.getLog(ActionTrackingServiceImpl.class);
private EhCacheAdapter<String, ExecutionDetails> executingActionsCache; private SimpleCache<String, ExecutionDetails> executingActionsCache;
private TransactionService transactionService; private TransactionService transactionService;
private RuntimeActionService runtimeActionService; private RuntimeActionService runtimeActionService;
@@ -95,7 +96,7 @@ public class ActionTrackingServiceImpl implements ActionTrackingService
* Sets the cache used to store details of * Sets the cache used to store details of
* currently executing actions, cluster wide. * currently executing actions, cluster wide.
*/ */
public void setExecutingActionsCache(EhCacheAdapter<String, ExecutionDetails> executingActionsCache) public void setExecutingActionsCache(SimpleCache<String, ExecutionDetails> executingActionsCache)
{ {
this.executingActionsCache = executingActionsCache; this.executingActionsCache = executingActionsCache;
} }