mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Added helper to get transactionally-bound List, Map and Set resources
- Generics allow the following, for instance: Map<NodeRef,List<QName>> filters = TransactionalResourceHelper.getMap(KEY_NODEREF_FILTER); git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13794 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -202,8 +202,11 @@ public abstract class AlfrescoTransactionSupport
|
||||
*
|
||||
* @param key the thread resource map key
|
||||
* @return Returns a thread resource of null if not present
|
||||
*
|
||||
* @see TransactionalResourceHelper for helper methods to create and bind common collection types
|
||||
*/
|
||||
public static Object getResource(Object key)
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <R extends Object> R getResource(Object key)
|
||||
{
|
||||
// get the synchronization
|
||||
TransactionSynchronizationImpl txnSynch = getSynchronization();
|
||||
@@ -216,7 +219,7 @@ public abstract class AlfrescoTransactionSupport
|
||||
" key: " + key + "\n" +
|
||||
" resource: " + resource);
|
||||
}
|
||||
return resource;
|
||||
return (R) resource;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user