Class DefaultCloneComponentContextProvider

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void finalizeItem()
      Finalizes the latest instance for this transaction.
      java.lang.Object findItemForKey​(java.lang.String key)
      Read value from Map.Entry without removing it from the stack
      java.util.Map.Entry<java.lang.String,​java.lang.Object> getCurrentItem()
      Provides the current instance for this transaction.
      protected SessionService getSessionService()  
      protected java.lang.Object getValueFromSession​(boolean shouldThrowException)
      Get the value stored in the session associated to the key SESSION_CLONE_COMPONENT_CONTEXT
      protected java.util.Deque<java.util.Map.Entry<java.lang.String,​java.lang.Object>> getWrappedStack​(java.lang.Object rawValue)
      Values stored in the session service must be wrapped in AtomicReference objects to protect them from being altered during serialization.
      void initializeItem​(java.util.Map.Entry<java.lang.String,​java.lang.Object> entry)
      Initializes and stores a new instance for this transaction.
      boolean isInitialized()
      Verify that the clone component operation is being executed by checking if some clone component information has been saved in the session.
      void setSessionService​(SessionService sessionService)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultCloneComponentContextProvider

        public DefaultCloneComponentContextProvider()
    • Method Detail

      • initializeItem

        public void initializeItem​(java.util.Map.Entry<java.lang.String,​java.lang.Object> entry)
        Description copied from interface: CMSItemContextProvider
        Initializes and stores a new instance for this transaction.
        Specified by:
        initializeItem in interface CMSItemContextProvider<java.util.Map.Entry<java.lang.String,​java.lang.Object>>
        Parameters:
        entry - the value to store
      • isInitialized

        public boolean isInitialized()
        Description copied from interface: CloneComponentContextProvider
        Verify that the clone component operation is being executed by checking if some clone component information has been saved in the session.
        Specified by:
        isInitialized in interface CloneComponentContextProvider
        Returns:
        TRUE when clone component information was stored in session; FALSE otherwise
      • getCurrentItem

        public java.util.Map.Entry<java.lang.String,​java.lang.Object> getCurrentItem()
        Description copied from interface: CMSItemContextProvider
        Provides the current instance for this transaction.
        Specified by:
        getCurrentItem in interface CMSItemContextProvider<java.util.Map.Entry<java.lang.String,​java.lang.Object>>
        Returns:
        the current item
      • findItemForKey

        public java.lang.Object findItemForKey​(java.lang.String key)
        Description copied from interface: CloneComponentContextProvider
        Read value from Map.Entry without removing it from the stack
        Specified by:
        findItemForKey in interface CloneComponentContextProvider
        Parameters:
        key - the key of the Map.Entry
        Returns:
        the value associated to the given key in the Map.Entry; can be null when the key is not found
      • getValueFromSession

        protected java.lang.Object getValueFromSession​(boolean shouldThrowException)
        Get the value stored in the session associated to the key SESSION_CLONE_COMPONENT_CONTEXT
        Parameters:
        shouldThrowException - when set to TRUE, an IllegalStateException is thrown if no value is found in the session
        Returns:
        the value stored in the session
      • getWrappedStack

        protected java.util.Deque<java.util.Map.Entry<java.lang.String,​java.lang.Object>> getWrappedStack​(java.lang.Object rawValue)
        Values stored in the session service must be wrapped in AtomicReference objects to protect them from being altered during serialization. When values are read from the session service, they must be unwrapped. Thus, this method is used to retrieve the original value (stack) stored in the AtomicReference wrapper.
        Parameters:
        rawValue - Object retrieved from the session service. The object must be an AtomicReference. Otherwise, an IllegalStateException is thrown.
        Returns:
        stack stored within the AtomicReference.
      • setSessionService

        public void setSessionService​(SessionService sessionService)