|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hazelcast.client.HazelcastClient
public final class HazelcastClient
Hazelcast Client enables you to do all Hazelcast operations without being a member of the cluster. It connects to one of the cluster members and delegates all cluster wide operations to it. When the connected cluster member dies, client will automatically switch to another live member.
Method Summary | ||
---|---|---|
String |
addDistributedObjectListener(DistributedObjectListener distributedObjectListener)
Adds a Distributed Object listener which will be notified when a new DistributedObject will be created or destroyed. |
|
|
executeTransaction(TransactionalTask<T> task)
Executes given transactional task in current thread using default options and returns the result of the task. |
|
|
executeTransaction(TransactionOptions options,
TransactionalTask<T> task)
Executes given transactional task in current thread using given options and returns the result of the task. |
|
static Collection<HazelcastInstance> |
getAllHazelcastClients()
|
|
IAtomicLong |
getAtomicLong(String name)
Creates cluster-wide atomic long. |
|
|
getAtomicReference(String name)
Creates cluster-wide atomic reference. |
|
ClientClusterService |
getClientClusterService()
|
|
ClientConfig |
getClientConfig()
|
|
ClientExecutionService |
getClientExecutionService()
|
|
ClientPartitionService |
getClientPartitionService()
|
|
ClientService |
getClientService()
Returns the client service of this Hazelcast instance. |
|
Cluster |
getCluster()
Returns the Cluster that this Hazelcast instance is part of. |
|
Config |
getConfig()
Returns the configuration of this Hazelcast instance. |
|
com.hazelcast.client.connection.ClientConnectionManager |
getConnectionManager()
|
|
ICountDownLatch |
getCountDownLatch(String name)
Creates cluster-wide CountDownLatch. |
|
|
getDistributedObject(String serviceName,
Object id)
Deprecated. |
|
|
getDistributedObject(String serviceName,
String name)
|
|
Collection<DistributedObject> |
getDistributedObjects()
Returns all DistributedObject 's such as; queue, map, set, list, topic, lock, multimap. |
|
IExecutorService |
getExecutorService(String name)
Returns the distributed executor service for the given name. |
|
IdGenerator |
getIdGenerator(String name)
Creates cluster-wide unique IDs. |
|
ClientInvocationService |
getInvocationService()
|
|
JobTracker |
getJobTracker(String name)
Returns the job tracker instance with the specified name. |
|
LifecycleService |
getLifecycleService()
Returns the lifecycle service for this instance. |
|
|
getList(String name)
Returns the distributed list instance with the specified name. |
|
Client |
getLocalEndpoint()
Returns the local Endpoint which this HazelcastInstance is belongs to. |
|
ILock |
getLock(Object key)
Deprecated. |
|
ILock |
getLock(String key)
Returns the distributed lock instance for the specified key object. |
|
com.hazelcast.logging.LoggingService |
getLoggingService()
Returns the logging service of this Hazelcast instance. |
|
|
getMap(String name)
Returns the distributed map instance with the specified name. |
|
|
getMultiMap(String name)
Returns the distributed multimap instance with the specified name. |
|
String |
getName()
Returns the name of this Hazelcast instance |
|
PartitionService |
getPartitionService()
Returns the partition service of this Hazelcast instance. |
|
|
getQueue(String name)
Returns the distributed queue instance with the specified name. |
|
ISemaphore |
getSemaphore(String name)
Creates cluster-wide semaphore. |
|
SerializationService |
getSerializationService()
|
|
|
getSet(String name)
Returns the distributed set instance with the specified name. |
|
ThreadGroup |
getThreadGroup()
|
|
|
getTopic(String name)
Returns the distributed topic instance with the specified name. |
|
ConcurrentMap<String,Object> |
getUserContext()
Returns a ConcurrentMap that can be used to add user-context to the HazelcastInstance. |
|
static HazelcastInstance |
newHazelcastClient()
|
|
static HazelcastInstance |
newHazelcastClient(ClientConfig config)
|
|
TransactionContext |
newTransactionContext()
Creates a new TransactionContext associated with the current thread using default options. |
|
TransactionContext |
newTransactionContext(TransactionOptions options)
Creates a new TransactionContext associated with the current thread with given options. |
|
boolean |
removeDistributedObjectListener(String registrationId)
Removes the specified Distributed Object listener. |
|
void |
shutdown()
Shuts down this HazelcastInstance. |
|
static void |
shutdownAll()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static HazelcastInstance newHazelcastClient()
public static HazelcastInstance newHazelcastClient(ClientConfig config)
public static Collection<HazelcastInstance> getAllHazelcastClients()
public static void shutdownAll()
public Config getConfig()
HazelcastInstance
getConfig
in interface HazelcastInstance
public String getName()
HazelcastInstance
getName
in interface HazelcastInstance
public <E> IQueue<E> getQueue(String name)
HazelcastInstance
getQueue
in interface HazelcastInstance
name
- name of the distributed queue
public <E> ITopic<E> getTopic(String name)
HazelcastInstance
getTopic
in interface HazelcastInstance
name
- name of the distributed topic
public <E> ISet<E> getSet(String name)
HazelcastInstance
getSet
in interface HazelcastInstance
name
- name of the distributed set
public <E> IList<E> getList(String name)
HazelcastInstance
getList
in interface HazelcastInstance
name
- name of the distributed list
public <K,V> IMap<K,V> getMap(String name)
HazelcastInstance
getMap
in interface HazelcastInstance
name
- name of the distributed map
public <K,V> MultiMap<K,V> getMultiMap(String name)
HazelcastInstance
getMultiMap
in interface HazelcastInstance
name
- name of the distributed multimap
public JobTracker getJobTracker(String name)
HazelcastInstance
getJobTracker
in interface HazelcastInstance
name
- name of the job tracker
public ILock getLock(String key)
HazelcastInstance
Lock lock = hazelcastInstance.getLock("PROCESS_LOCK"); lock.lock(); try { // process } finally { lock.unlock(); }
getLock
in interface HazelcastInstance
key
- key of the lock instance
@Deprecated public ILock getLock(Object key)
getLock
in interface HazelcastInstance
public Cluster getCluster()
HazelcastInstance
getCluster
in interface HazelcastInstance
public Client getLocalEndpoint()
HazelcastInstance
Member
instance for cluster nodes
and a Client
instance for clients.
getLocalEndpoint
in interface HazelcastInstance
Member
,
Client
public IExecutorService getExecutorService(String name)
HazelcastInstance
Note: Note that it don't support invokeAll/Any and don't have standard shutdown behavior
getExecutorService
in interface HazelcastInstance
name
- name of the executor service
public <T> T executeTransaction(TransactionalTask<T> task) throws TransactionException
HazelcastInstance
executeTransaction
in interface HazelcastInstance
T
- return type of tasktask
- task to be executed
TransactionException
- if an error occurs during transaction.public <T> T executeTransaction(TransactionOptions options, TransactionalTask<T> task) throws TransactionException
HazelcastInstance
executeTransaction
in interface HazelcastInstance
T
- return type of taskoptions
- options for this transactional tasktask
- task to be executed
TransactionException
- if an error occurs during transaction.public TransactionContext newTransactionContext()
HazelcastInstance
newTransactionContext
in interface HazelcastInstance
public TransactionContext newTransactionContext(TransactionOptions options)
HazelcastInstance
newTransactionContext
in interface HazelcastInstance
options
- options for this transaction
public IdGenerator getIdGenerator(String name)
HazelcastInstance
getIdGenerator
in interface HazelcastInstance
name
- name of the IdGenerator
public IAtomicLong getAtomicLong(String name)
HazelcastInstance
getAtomicLong
in interface HazelcastInstance
name
- name of the IAtomicLong proxy
public <E> IAtomicReference<E> getAtomicReference(String name)
HazelcastInstance
getAtomicReference
in interface HazelcastInstance
name
- name of the IAtomicReference proxy
public ICountDownLatch getCountDownLatch(String name)
HazelcastInstance
getCountDownLatch
in interface HazelcastInstance
name
- name of the ICountDownLatch proxy
public ISemaphore getSemaphore(String name)
HazelcastInstance
getSemaphore
in interface HazelcastInstance
name
- name of the ISemaphore proxy
public Collection<DistributedObject> getDistributedObjects()
HazelcastInstance
DistributedObject
's such as; queue, map, set, list, topic, lock, multimap.
getDistributedObjects
in interface HazelcastInstance
public String addDistributedObjectListener(DistributedObjectListener distributedObjectListener)
HazelcastInstance
DistributedObject
will be created or destroyed.
addDistributedObjectListener
in interface HazelcastInstance
distributedObjectListener
- instance listener
public boolean removeDistributedObjectListener(String registrationId)
HazelcastInstance
removeDistributedObjectListener
in interface HazelcastInstance
registrationId
- Id of listener registration.
public PartitionService getPartitionService()
HazelcastInstance
getPartitionService
in interface HazelcastInstance
public ClientService getClientService()
HazelcastInstance
getClientService
in interface HazelcastInstance
public com.hazelcast.logging.LoggingService getLoggingService()
HazelcastInstance
getLoggingService
in interface HazelcastInstance
public LifecycleService getLifecycleService()
HazelcastInstance
getLifecycleService
in interface HazelcastInstance
@Deprecated public <T extends DistributedObject> T getDistributedObject(String serviceName, Object id)
getDistributedObject
in interface HazelcastInstance
T
- type of the DistributedObjectserviceName
- name of the serviceid
- identifier of the object
public <T extends DistributedObject> T getDistributedObject(String serviceName, String name)
getDistributedObject
in interface HazelcastInstance
T
- type of the DistributedObjectserviceName
- name of the servicename
- name of the object
public ConcurrentMap<String,Object> getUserContext()
HazelcastInstance
getUserContext
in interface HazelcastInstance
public ClientConfig getClientConfig()
public SerializationService getSerializationService()
public com.hazelcast.client.connection.ClientConnectionManager getConnectionManager()
public ClientClusterService getClientClusterService()
public ClientExecutionService getClientExecutionService()
public ClientPartitionService getClientPartitionService()
public ClientInvocationService getInvocationService()
public ThreadGroup getThreadGroup()
public void shutdown()
HazelcastInstance
LifecycleService.shutdown()
.
shutdown
in interface HazelcastInstance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |