Interface PageCacheKey

    • Method Detail

      • setAttribute

        void setAttribute​(String subKey,
                          Serializable keyFragment)
                   throws IllegalStateException

        All the combined attributes will make up the final PageCacheKey. Note that the ORDER in which the attributes are set DO influence the final created cachekey. Make sure that your added keyFragment object have a decentObject.hashCode() and Object.equals(Object) implementation that is also efficient as it will be used when storing objects in a cache with key PageCacheKey.

        The subKey can best be prefixed by namespacing (FQN of class calling the setAttribute) to avoid collisions. For example

             
                  PageCacheKey#setAttribute(MyValve.class.getName() + ".ip", ip-address);
             
             

        Parameters:
        subKey - the key to which the fragment belongs, not allowed to be null
        keyFragment - the fragment for the subKey, not allowed to be null
        Throws:
        IllegalStateException - is this PageCacheKey has been sealed via seal()