psdi.util

Class CachedObjectPointer

  • java.lang.Object
    • psdi.util.CachedObjectPointer
    • Field Detail

      • coRef

        protected transient java.lang.ref.WeakReference coRef
    • Constructor Detail

      • CachedObjectPointer

        public CachedObjectPointer(long id)
        Create the cached object pointer. It will not attempt to locate the cached object in the repository.
        Parameters:
        id -
    • Method Detail

      • isSameTenantAsReference

        public boolean isSameTenantAsReference(java.lang.String repositoryName)
        Check whether the cached object it refers to is it's own copy
      • setID

        public void setID(long id)
      • getID

        public long getID()
      • getCacheName

        public java.lang.String getCacheName()
      • getReference

        public CachedObject getReference(java.lang.String repositoryName)
        Get the cached object from repository. Establish the weak reference if found.
        Parameters:
        repositoryName -
        Returns:
      • getReferenceForSet

        public CachedObject getReferenceForSet(java.lang.String repositoryName)
        Get the cached object from repository for updating purpose. If the cached object found has a different tenant id as the tenant context, this cached object will be cloned and returned. You must use this method instead of getReference(String) for obtaining a reference to update.
        Returns:
      • setReference

        public void setReference(java.lang.String repositoryName)
        Establish the weak reference to the cached object in the repository.
        Parameters:
        repositoryName -
      • setTenantReference

        public void setTenantReference(java.lang.String repositoryName)