Class SynchronizedAttributeAccessor
java.lang.Object
org.springframework.batch.repeat.context.SynchronizedAttributeAccessor
- All Implemented Interfaces:
org.springframework.core.AttributeAccessor
- Direct Known Subclasses:
JobContext
,RepeatContextSupport
,StepContext
public class SynchronizedAttributeAccessor
extends Object
implements org.springframework.core.AttributeAccessor
An
AttributeAccessor
that synchronizes on a mutex (not this) before modifying
or accessing the underlying attributes.- Author:
- Dave Syer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionString[]
boolean
getAttribute
(String name) boolean
hasAttribute
(String name) int
hashCode()
removeAttribute
(String name) void
setAttribute
(String name, Object value) setAttributeIfAbsent
(String name, Object value) Additional support for atomic put if absent.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.AttributeAccessor
computeAttribute
-
Constructor Details
-
SynchronizedAttributeAccessor
public SynchronizedAttributeAccessor()
-
-
Method Details
-
attributeNames
- Specified by:
attributeNames
in interfaceorg.springframework.core.AttributeAccessor
-
equals
-
getAttribute
- Specified by:
getAttribute
in interfaceorg.springframework.core.AttributeAccessor
-
hasAttribute
- Specified by:
hasAttribute
in interfaceorg.springframework.core.AttributeAccessor
-
hashCode
public int hashCode() -
removeAttribute
- Specified by:
removeAttribute
in interfaceorg.springframework.core.AttributeAccessor
-
setAttribute
- Specified by:
setAttribute
in interfaceorg.springframework.core.AttributeAccessor
-
setAttributeIfAbsent
Additional support for atomic put if absent.- Parameters:
name
- the key for the attribute namevalue
- the value of the attribute- Returns:
- null if the attribute was not already set, the existing value otherwise.
-
toString
-