Package org.alfresco.repo.policy
Class CachedPolicyFactory<B extends BehaviourBinding,P extends Policy>
- java.lang.Object
-
- org.alfresco.repo.policy.CachedPolicyFactory<B,P>
-
- Type Parameters:
B- the type of BindingP- the type of Policy
@AlfrescoPublicApi public class CachedPolicyFactory<B extends BehaviourBinding,P extends Policy> extends java.lang.ObjectPolicy Factory with caching support.- Author:
- David Caruana
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static voidconvertMTArgs(java.lang.Object[] args)Convert each of the arguments to the spoofed (no tenant prefix) reference.Pcreate(B binding)Construct a Policy implementation for the specified bindingjava.util.Collection<P>createList(B binding)Construct a collection of Policy implementations for the specified bindingprotected java.lang.Class<P>getPolicyClass()Gets the Policy class created by this factoryprotected static voidsetTenantService(org.alfresco.repo.tenant.TenantService service)Sets the Tenant Serviceprotected static voidsetTransactionInvocationHandlerFactory(TransactionInvocationHandlerFactory factory)Sets the Transaction Invocation HandlervoidsetTryLockTimeout(long tryLockTimeout)PtoPolicy(java.util.Collection<P> policyList)Construct a single aggregate policy implementation for the specified collection of policy implementations.
-
-
-
Method Detail
-
setTryLockTimeout
public void setTryLockTimeout(long tryLockTimeout)
-
create
public P create(B binding)
Construct a Policy implementation for the specified binding- Parameters:
binding- the binding- Returns:
- the policy implementation
-
createList
public java.util.Collection<P> createList(B binding)
Construct a collection of Policy implementations for the specified binding- Parameters:
binding- the binding- Returns:
- the collection of policy implementations
-
setTransactionInvocationHandlerFactory
protected static void setTransactionInvocationHandlerFactory(TransactionInvocationHandlerFactory factory)
Sets the Transaction Invocation Handler- Parameters:
factory- TransactionInvocationHandlerFactory
-
setTenantService
protected static void setTenantService(org.alfresco.repo.tenant.TenantService service)
Sets the Tenant Service- Parameters:
service- TenantService
-
getPolicyClass
protected java.lang.Class<P> getPolicyClass()
Gets the Policy class created by this factory- Returns:
- the policy class
-
toPolicy
public P toPolicy(java.util.Collection<P> policyList)
Construct a single aggregate policy implementation for the specified collection of policy implementations.- Parameters:
policyList- the policy implementations to aggregate- Returns:
- the aggregate policy implementation
-
convertMTArgs
protected static void convertMTArgs(java.lang.Object[] args)
Convert each of the arguments to the spoofed (no tenant prefix) reference. Converts arguments of Type NodeRef to base name etc.- Parameters:
args- list of non final arguments - the arguments are updated in place
-
-