Skip navigation links

Oracle Communications Services Gatekeeper Java API Reference
5.0

E21717-02


com.bea.wlcp.wlng.api.storage
Interface Store

All Superinterfaces:
Map

public interface Store
extends Map

Map based store interface used to put, get, remove Serializable objects. The store does not allow null values as keys or values.
Note that the Store instance retrieved should not be considered thread safe, and that users should retrieve different Store instances for each transaction.
The Store instance should be released by the user at the end of the transaction.


Nested Class Summary

 

Nested classes inherited from class java.util.Map
Map.Entry

 

Method Summary
 void addListener(StoreListener listener)
          The addListener/StoreListener is used for automatic expiry events only.
 StoreQuery getQuery(String name)
          Get a new named query.
 boolean lock(Serializable key, long timeout)
          Attempt to take a cluster wide lock.
 void release()
          Release this store instance.
 void removeListener(StoreListener listener)
          Remove previously added store listener for store.
 boolean unlock(Serializable key)
          Unlock a previously obtained lock.

 

Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values

 

Method Detail

addListener

public void addListener(StoreListener listener)
                 throws StorageException
The addListener/StoreListener is used for automatic expiry events only. When you configure a store, you can optionally specify an idle expiry setting, after which the storage provider should remove the entry from the store. For our DB backed stores, this is implemented with a timer that runs now and then and deletes entries that have a timestamp value that is less than (now - expiry). If a StoreListener is registered, it will get notified of entries that are removed from the store because of expiry. It would also get notified if the Coherence provider is used with a cache only store (without DB backing), and an entry gets removed because of eviction (size or time based), i.e. an entryDeleted event that returns true from CacheEvent.isSynthetic().
Parameters:
listener - The store listener.
Throws:
StorageException - If the listener could not be added.

getQuery

public StoreQuery getQuery(String name)
Get a new named query.
Parameters:
name - The query name.
Returns:
The query or null if no such query was known.

lock

public boolean lock(Serializable key,
                    long timeout)
Attempt to take a cluster wide lock. The key does not have to exist in the store.
Parameters:
key - The identifier of the lock.
timeout - The maximum time in milliseconds to wait for lock.
Returns:
True if the lock was obtained, false if unsuccessful.

release

public void release()
Release this store instance.

removeListener

public void removeListener(StoreListener listener)
Remove previously added store listener for store.
Parameters:
listener - The store listener.

unlock

public boolean unlock(Serializable key)
Unlock a previously obtained lock. The key does not have to exist in the store.
Parameters:
key - The identifier of the lock.
Returns:
True if the lock was released, false if unsuccessful.

Skip navigation links

Oracle Communications Services Gatekeeper Java API Reference
5.0

E21717-02


Copyright © 2008, 2011, Oracle and/or its affiliates. All rights reserved.