Class CachedPolicyFactory<B extends BehaviourBinding,​P extends Policy>

  • Type Parameters:
    B - the type of Binding
    P - the type of Policy

    @AlfrescoPublicApi
    public class CachedPolicyFactory<B extends BehaviourBinding,​P extends Policy>
    extends java.lang.Object
    Policy Factory with caching support.
    Author:
    David Caruana
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected static void convertMTArgs​(java.lang.Object[] args)
      Convert each of the arguments to the spoofed (no tenant prefix) reference.
      P create​(B binding)
      Construct a Policy implementation for the specified binding
      java.util.Collection<P> createList​(B binding)
      Construct a collection of Policy implementations for the specified binding
      protected java.lang.Class<P> getPolicyClass()
      Gets the Policy class created by this factory
      protected static void setTenantService​(org.alfresco.repo.tenant.TenantService service)
      Sets the Tenant Service
      protected static void setTransactionInvocationHandlerFactory​(TransactionInvocationHandlerFactory factory)
      Sets the Transaction Invocation Handler
      void setTryLockTimeout​(long tryLockTimeout)  
      P toPolicy​(java.util.Collection<P> policyList)
      Construct a single aggregate policy implementation for the specified collection of policy implementations.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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