public class DefaultCloneComponentContextProvider extends java.lang.Object implements CloneComponentContextProvider
CloneComponentContextProvider responsible for storing (in a stack-like data
structure) context information per transaction when cloning a component.| Constructor and Description |
|---|
DefaultCloneComponentContextProvider() |
| Modifier and Type | Method and 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) |
public DefaultCloneComponentContextProvider()
public void initializeItem(java.util.Map.Entry<java.lang.String,java.lang.Object> entry)
CMSItemContextProviderinitializeItem in interface CMSItemContextProvider<java.util.Map.Entry<java.lang.String,java.lang.Object>>entry - the value to storepublic boolean isInitialized()
CloneComponentContextProviderisInitialized in interface CloneComponentContextProviderpublic java.util.Map.Entry<java.lang.String,java.lang.Object> getCurrentItem()
CMSItemContextProvidergetCurrentItem in interface CMSItemContextProvider<java.util.Map.Entry<java.lang.String,java.lang.Object>>public java.lang.Object findItemForKey(java.lang.String key)
CloneComponentContextProviderMap.Entry without removing it from the stackfindItemForKey in interface CloneComponentContextProviderkey - the key of the Map.EntryMap.Entry; can be null when the key is not foundpublic void finalizeItem()
CMSItemContextProviderfinalizeItem in interface CMSItemContextProvider<java.util.Map.Entry<java.lang.String,java.lang.Object>>protected java.lang.Object getValueFromSession(boolean shouldThrowException)
SESSION_CLONE_COMPONENT_CONTEXTshouldThrowException - when set to TRUE, an IllegalStateException is thrown if no value is found in the
sessionprotected java.util.Deque<java.util.Map.Entry<java.lang.String,java.lang.Object>> getWrappedStack(java.lang.Object rawValue)
rawValue - Object retrieved from the session service. The object must be an AtomicReference. Otherwise, an
IllegalStateException is thrown.protected SessionService getSessionService()
public void setSessionService(SessionService sessionService)
Copyright © 2018 SAP SE. All Rights Reserved.