Oracle Coherence for C++ API
Release 3.6.1.0

E18813-01

ConverterCollections::ConverterConcurrentMap Class Reference

#include <coherence/util/ConverterCollections.hpp>

Inherits ConverterCollections::ConverterMap, and ConcurrentMap.

List of all members.


Detailed Description

A Converter ConverterConcurrentMap views an underlying ConcurrentMap through a set of key and value Converters.

Public Types

typedef spec::Handle  Handle
  ConverterConcurrentMap Handle definition.
typedef spec::View  View
  ConverterConcurrentMap View definition.
typedef spec::Holder  Holder
  ConverterConcurrentMap Holder definition.

Public Member Functions

virtual bool  lock (Object::View vKey, int64_t cWait) const
  Attempt to lock the specified item within the specified period of time.

The item doesn't have to exist to be locked. While the item is locked there is known to be a lock holder which has an exclusive right to modify (calling put and remove methods) that item.

Lock holder is an abstract concept that depends on the ConcurrentMap implementation. For example, holder could be a process or a thread (or both).

Locking strategy may vary for concrete implementations as well. Lock could have an expiration time (this lock is sometimes called a "lease") or be held indefinitely (until the lock holder terminates).

Some implementations may allow the entire map to be locked. If the map is locked in such a way, then only a lock holder is allowed to perform any of the "put" or "remove" operations. Pass the special constant getLockAll() as the vKey parameter to indicate the map lock.

Parameters:
vKey  key being locked
cWait  the number of milliseconds to continue trying to obtain a lock; pass zero to return immediately; pass -1 to block the calling thread until the lock could be obtained
Returns:
true if the item was successfully locked within the specified time; false otherwise

virtual bool  lock (Object::View vKey) const
  Attempt to lock the specified item and return immediately.

This method behaves exactly as if it simply performs the call lock(vKey, 0).

Parameters:
vKey  key being locked
Returns:
true if the item was successfully locked; false otherwise

virtual bool  unlock (Object::View vKey) const
  Unlock the specified item.

The item doesn't have to exist to be unlocked. If the item is currently locked, only the holder of the lock could successfully unlock it.

Parameters:
vKey  key being unlocked
Returns:
true if the item was successfully unlocked; false otherwise

virtual
ConcurrentMap::View 
getConcurrentMap () const
  Return the underlying ConcurrentMap.
virtual
ConcurrentMap::Handle 
getConcurrentMap ()
  Return the underlying ConcurrentMap.

Protected Member Functions

  ConverterConcurrentMap (ConcurrentMap::Handle hMapDelegate, EntryConverter::View vConvUp, EntryConverter::View vConvDown)
  Create a ConverterConcurrentMap which delegates to the specified ConcurrentMap.
  ConverterConcurrentMap (ConcurrentMap::View vMapDelegate, EntryConverter::View vConvUp, EntryConverter::View vConvDown)
  Create a ConverterConcurrentMap which delegates to the specified ConcurrentMap.

Constructor & Destructor Documentation

ConverterConcurrentMap ( ConcurrentMap::Handle  hMapDelegate,
EntryConverter::View  vConvUp,
EntryConverter::View  vConvDown  
) [protected]

Create a ConverterConcurrentMap which delegates to the specified ConcurrentMap.

Parameters:
hMap  the specified ConcurrentMap
vConvUp  the EntryConverter from the underlying Map
vConvDown  the EntryConverter to the underlying Map

ConverterConcurrentMap ( ConcurrentMap::View  vMapDelegate,
EntryConverter::View  vConvUp,
EntryConverter::View  vConvDown  
) [protected]

Create a ConverterConcurrentMap which delegates to the specified ConcurrentMap.

Parameters:
vMap  the specified ConcurrentMap
vConvUp  the EntryConverter from the underlying Map
vConvDown  the EntryConverter to the underlying Map

Member Function Documentation

virtual ConcurrentMap::View getConcurrentMap (  )  const [virtual]

Return the underlying ConcurrentMap.

Returns:
the underlying ConcurrentMap

virtual ConcurrentMap::Handle getConcurrentMap (  )  [virtual]

Return the underlying ConcurrentMap.

Returns:
the underlying ConcurrentMap

The documentation for this class was generated from the following file:
Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.