|
org.eclipse.emf.transaction.util
Class BasicTransactionOptionMetadataRegistry
java.lang.Object
java.util.AbstractMap<K,V>
java.util.concurrent.ConcurrentHashMap<
Object,
Transaction.OptionMetadata>
org.eclipse.emf.transaction.util.BasicTransactionOptionMetadataRegistry
-
All Implemented Interfaces:
-
Serializable,
ConcurrentMap<
Object,
Transaction.OptionMetadata>,
Map<
Object,
Transaction.OptionMetadata>,
Transaction.OptionMetadata.Registry
-
public class BasicTransactionOptionMetadataRegistry
- extends
ConcurrentHashMap<
Object,
Transaction.OptionMetadata>
- implements
Transaction.OptionMetadata.Registry
A simple implementation of the transaction option metadata registry API.
-
Since:
- 1.3
-
See Also:
-
Serialized Form
Nested classes/interfaces inherited from interface java.util.
Map
|
Map.Entry<
K,
V>
|
Methods inherited from class java.util.concurrent.
ConcurrentHashMap
|
clear,
contains,
containsKey,
containsValue,
elements,
entrySet,
get,
isEmpty,
keys,
keySet,
put,
putAll,
putIfAbsent,
remove,
remove,
replace,
replace,
size,
values
|
BasicTransactionOptionMetadataRegistry
public BasicTransactionOptionMetadataRegistry()
- Initializes me with the shared registry instance as my delegate.
BasicTransactionOptionMetadataRegistry
protected BasicTransactionOptionMetadataRegistry(
Transaction.OptionMetadata.Registry delegate)
- Initializes me with a registry to which I delegate options that I do not
provide for.
-
Parameters:
-
delegate - my delegate
getOptionMetadata
public
Transaction.OptionMetadata getOptionMetadata(
Object option)
-
Obtains a metadata object describing the specified transaction
option. For unrecognized options, a default meta-data is provided
that gives reasonable answers.
This implementation caches, locally, the lazily created metadata for
options that are unrecognized.
-
-
Specified by:
-
getOptionMetadata
in interface
Transaction.OptionMetadata.Registry
-
-
Parameters:
-
option - an option key
-
Returns:
- the option meta-data (never
null )
basicGetOptionMetadata
protected
Transaction.OptionMetadata basicGetOptionMetadata(
Object option)
- Gets the specified option's metadata, possibly from a delegate, without
lazily creating and caching a result for unrecognized options.
-
-
-
Parameters:
-
option - the option
-
Returns:
- its metadata, or
null if none is found in either the
local or the delegate registry
delegatedGetOptionMetadata
protected
Transaction.OptionMetadata delegatedGetOptionMetadata(
Object option)
-
-
register
public
Transaction.OptionMetadata register(
Transaction.OptionMetadata metadata)
- Registers an option metadata descriptor.
-
-
-
Parameters:
-
metadata - the option metadata to register
-
Returns:
- the metadata displaced by the new object, if previously we had a
descriptor for the same option, otherwise
null
|
|