|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IMap
Notice: since 7.0 this API is internal and might be subject to changes in future versions.
Use GigaMap
instead.
This interface extends Map
interface and provides Map interface to GigaSpaces.
The IMap interface can be used in remote , embedded and Master-Local Topology.
The Map interface provides three collection views, which allow a map's contents to be viewed
as a set of keys, collection of values, or set of key-value mappings.
You can associate attributes to a key and values (e.g. security tags, special user profiles, etc.), and set time for entries to exist in the cache until eviction.
GigaMap
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Method Summary | |
---|---|
void |
clear(boolean clearMaster)
The clear method will remove all objects from the cache including the key and the associated value. |
Object |
get(Object key,
long waitForResponse)
Returns the object that is associated with key in this cache. |
Object |
get(Object key,
net.jini.core.transaction.Transaction txn,
long waitForResponse,
int readModifiers)
Returns the object that is associated with key in this cache. |
IJSpace |
getLocalSpace()
Returns the Local Space proxy if exists. |
IJSpace |
getMasterSpace()
Returns the Master Space proxy. |
long |
getTimeToLive()
Returns how long cached objects will live in the cache. |
net.jini.core.transaction.Transaction |
getTransaction()
Deprecated. use explicit transaction instead |
long |
getWaitForResponse()
Returns how long wait for response for the put(java.lang.Object, java.lang.Object, long) , get(java.lang.Object, long) and remove(java.lang.Object, long) calls. |
boolean |
isVersioned()
Check if using optimistic locking. |
Object |
put(Object key,
Object value,
long timeToLive)
Puts value to the cache with specified key for
timeToLive milliseconds to live in the cache. |
Object |
put(Object key,
Object value,
long timeToLive,
long timeout)
Puts value to the cache with specified key for
timeToLive milliseconds to live in the cache. |
Object |
put(Object key,
Object value,
net.jini.core.transaction.Transaction txn,
long timeToLive)
Puts value to the cache with specified key for
timeToLive milliseconds to live in the cache. |
Object |
put(Object key,
Object value,
net.jini.core.transaction.Transaction txn,
long timeToLive,
long timeout)
Puts value to the cache with specified key for
timeToLive milliseconds to live in the cache. |
void |
putAll(Map map,
net.jini.core.transaction.Transaction txn,
long timeToLive)
Copies all of the mappings from the specified map to the cache. |
Object |
remove(Object key,
long waitForResponse)
Removes the mapping for this key from this cache. |
Object |
remove(Object key,
net.jini.core.transaction.Transaction txn,
long waitForResponse)
Removes the mapping for this key from this cache. |
void |
setTimeToLive(long millisecond)
Sets the duration that entries will stay in the cache. |
void |
setTransaction(net.jini.core.transaction.Transaction transaction)
Deprecated. use explicit transaction instead |
void |
setVersioned(boolean versioned)
Sets optimistic locking mode. |
void |
setWaitForResponse(long timeout)
Sets the timeout for the put(java.lang.Object, java.lang.Object, long) , get(java.lang.Object, long) and remove(java.lang.Object, long) calls to wait for response. |
Methods inherited from interface com.j_spaces.javax.cache.Cache |
---|
addListener, clear, containsKey, containsValue, entrySet, equals, evict, get, getAll, getCacheEntry, hashCode, isEmpty, keySet, load, loadAll, peek, put, putAll, remove, removeListener, size, values |
Method Detail |
---|
void setTimeToLive(long millisecond)
millisecond
- how long entries will live in the cache, in millisecondslong getTimeToLive()
void setWaitForResponse(long timeout)
put(java.lang.Object, java.lang.Object, long)
, get(java.lang.Object, long)
and remove(java.lang.Object, long)
calls to wait for response.
timeout
- time to wait for responselong getWaitForResponse()
put(java.lang.Object, java.lang.Object, long)
, get(java.lang.Object, long)
and remove(java.lang.Object, long)
calls.
Object put(Object key, Object value, long timeToLive)
value
to the cache with specified key
for
timeToLive
milliseconds to live in the cache.
key
- key for the value
value
- object(~ entry)timeToLive
- time to keep object in this cache, in milliseconds
Object put(Object key, Object value, long timeToLive, long timeout)
value
to the cache with specified key
for
timeToLive
milliseconds to live in the cache.
key
- key for the value
value
- object(~ entry)timeToLive
- time to keep object in this cache, in milliseconds
Object put(Object key, Object value, net.jini.core.transaction.Transaction txn, long timeToLive)
value
to the cache with specified key
for
timeToLive
milliseconds to live in the cache.
key
- key for the value
value
- object(~ entry)txn
- the transaction object, if any, under which to
perform the puttimeToLive
- time to keep object in this cache, in milliseconds
Object put(Object key, Object value, net.jini.core.transaction.Transaction txn, long timeToLive, long timeout)
value
to the cache with specified key
for
timeToLive
milliseconds to live in the cache.
key
- key for the value
value
- object(~ entry)txn
- the transaction object, if any, under which to
perform the puttimeToLive
- time to keep object in this cache, in milliseconds
void putAll(Map map, net.jini.core.transaction.Transaction txn, long timeToLive)
map
- A map of key and values to be copy into the cachetxn
- the transaction object, if any, under which to
perform the puttimeToLive
- time to keep object in this cache, in millisecondsObject get(Object key, long waitForResponse)
key
in this cache.
Client will wait at most waitForResponse
milliseconds for
get call to return.
key
- key whose associated value is to be returned.waitForResponse
- time to wait for response
Object get(Object key, net.jini.core.transaction.Transaction txn, long waitForResponse, int readModifiers)
key
in this cache.
Client will wait at most waitForResponse
milliseconds for
get call to return.
key
- key whose associated value is to be returned.txn
- the transaction object, if any, under which to
perform the getwaitForResponse
- time to wait for responsereadModifiers
- one or a union of ReadModifiers
.
Object remove(Object key, long waitForResponse)
key
from this cache.
Client will wait at most waitForResponse
milliseconds for
get call to return.
key
- key whose associated value is to be returned.waitForResponse
- time to wait for response
Object remove(Object key, net.jini.core.transaction.Transaction txn, long waitForResponse)
key
from this cache.
Client will wait at most waitForResponse
milliseconds for
get call to return.
key
- key whose associated value is to be returned.txn
- the transaction object, if any, under which to
perform the removewaitForResponse
- time to wait for response
void clear(boolean clearMaster)
clearMaster
- if true
clear also master, when false
equals to clear()@Deprecated void setTransaction(net.jini.core.transaction.Transaction transaction)
null
will turn all the following map calls to
be with transaction.
In order to
IMap map = ... ;
TransactionManager tm = ... ;
Transaction.Created created = TransactionFactory#create(tm, 10000);
map.setTransaction(Created.transaction)
map.put( "key1", "value1"); // under transaction
map.put( "key2", "value2"); // under transaction
Created.transaction.commit();
map.setTransaction( null);
map.remove( "key2"); // not under transaction
transaction
- active transaction or null
@Deprecated net.jini.core.transaction.Transaction getTransaction()
null
if no transaction defined.
IJSpace getMasterSpace()
IJSpace getLocalSpace()
void setVersioned(boolean versioned)
versioned
- true
if optimistic locking is neededboolean isVersioned()
true
if using optimistic locking
|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |