com.hazelcast.client
Class HazelcastClient

java.lang.Object
  extended by com.hazelcast.client.HazelcastClient
All Implemented Interfaces:
HazelcastInstance

public final class HazelcastClient
extends Object
implements HazelcastInstance

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)
           
<T> T
executeTransaction(TransactionalTask<T> task)
           
<T> T
executeTransaction(TransactionOptions options, TransactionalTask<T> task)
           
static Collection<HazelcastInstance> getAllHazelcastClients()
           
 IAtomicLong getAtomicLong(String name)
           
<E> IAtomicReference<E>
getAtomicReference(String name)
           
 ClientClusterService getClientClusterService()
           
 ClientConfig getClientConfig()
           
 ClientExecutionService getClientExecutionService()
           
 ClientPartitionService getClientPartitionService()
           
 ClientService getClientService()
           
 Cluster getCluster()
           
 Config getConfig()
           
 com.hazelcast.client.connection.ClientConnectionManager getConnectionManager()
           
 ICountDownLatch getCountDownLatch(String name)
           
<T extends DistributedObject>
T
getDistributedObject(String serviceName, Object id)
          Deprecated. 
<T extends DistributedObject>
T
getDistributedObject(String serviceName, String name)
           
 Collection<DistributedObject> getDistributedObjects()
           
 IExecutorService getExecutorService(String name)
           
 IdGenerator getIdGenerator(String name)
           
 ClientInvocationService getInvocationService()
           
 JobTracker getJobTracker(String name)
           
 LifecycleService getLifecycleService()
           
<E> IList<E>
getList(String name)
           
 Client getLocalEndpoint()
           
 ILock getLock(Object key)
          Deprecated. 
 ILock getLock(String key)
           
 com.hazelcast.logging.LoggingService getLoggingService()
           
<K,V> IMap<K,V>
getMap(String name)
           
<K,V> MultiMap<K,V>
getMultiMap(String name)
           
 String getName()
           
 PartitionService getPartitionService()
           
<E> IQueue<E>
getQueue(String name)
           
 ISemaphore getSemaphore(String name)
           
 SerializationService getSerializationService()
           
<E> ISet<E>
getSet(String name)
           
 ThreadGroup getThreadGroup()
           
<E> ITopic<E>
getTopic(String name)
           
 ConcurrentMap<String,Object> getUserContext()
           
static HazelcastInstance newHazelcastClient()
           
static HazelcastInstance newHazelcastClient(ClientConfig config)
           
 TransactionContext newTransactionContext()
           
 TransactionContext newTransactionContext(TransactionOptions options)
           
 boolean removeDistributedObjectListener(String registrationId)
           
 void shutdown()
           
static void shutdownAll()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newHazelcastClient

public static HazelcastInstance newHazelcastClient()

newHazelcastClient

public static HazelcastInstance newHazelcastClient(ClientConfig config)

getAllHazelcastClients

public static Collection<HazelcastInstance> getAllHazelcastClients()

shutdownAll

public static void shutdownAll()

getConfig

public Config getConfig()
Specified by:
getConfig in interface HazelcastInstance

getName

public String getName()
Specified by:
getName in interface HazelcastInstance

getQueue

public <E> IQueue<E> getQueue(String name)
Specified by:
getQueue in interface HazelcastInstance

getTopic

public <E> ITopic<E> getTopic(String name)
Specified by:
getTopic in interface HazelcastInstance

getSet

public <E> ISet<E> getSet(String name)
Specified by:
getSet in interface HazelcastInstance

getList

public <E> IList<E> getList(String name)
Specified by:
getList in interface HazelcastInstance

getMap

public <K,V> IMap<K,V> getMap(String name)
Specified by:
getMap in interface HazelcastInstance

getMultiMap

public <K,V> MultiMap<K,V> getMultiMap(String name)
Specified by:
getMultiMap in interface HazelcastInstance

getJobTracker

public JobTracker getJobTracker(String name)
Specified by:
getJobTracker in interface HazelcastInstance

getLock

public ILock getLock(String key)
Specified by:
getLock in interface HazelcastInstance

getLock

@Deprecated
public ILock getLock(Object key)
Deprecated. 

Specified by:
getLock in interface HazelcastInstance

getCluster

public Cluster getCluster()
Specified by:
getCluster in interface HazelcastInstance

getLocalEndpoint

public Client getLocalEndpoint()
Specified by:
getLocalEndpoint in interface HazelcastInstance

getExecutorService

public IExecutorService getExecutorService(String name)
Specified by:
getExecutorService in interface HazelcastInstance

executeTransaction

public <T> T executeTransaction(TransactionalTask<T> task)
                     throws TransactionException
Specified by:
executeTransaction in interface HazelcastInstance
Throws:
TransactionException

executeTransaction

public <T> T executeTransaction(TransactionOptions options,
                                TransactionalTask<T> task)
                     throws TransactionException
Specified by:
executeTransaction in interface HazelcastInstance
Throws:
TransactionException

newTransactionContext

public TransactionContext newTransactionContext()
Specified by:
newTransactionContext in interface HazelcastInstance

newTransactionContext

public TransactionContext newTransactionContext(TransactionOptions options)
Specified by:
newTransactionContext in interface HazelcastInstance

getIdGenerator

public IdGenerator getIdGenerator(String name)
Specified by:
getIdGenerator in interface HazelcastInstance

getAtomicLong

public IAtomicLong getAtomicLong(String name)
Specified by:
getAtomicLong in interface HazelcastInstance

getAtomicReference

public <E> IAtomicReference<E> getAtomicReference(String name)
Specified by:
getAtomicReference in interface HazelcastInstance

getCountDownLatch

public ICountDownLatch getCountDownLatch(String name)
Specified by:
getCountDownLatch in interface HazelcastInstance

getSemaphore

public ISemaphore getSemaphore(String name)
Specified by:
getSemaphore in interface HazelcastInstance

getDistributedObjects

public Collection<DistributedObject> getDistributedObjects()
Specified by:
getDistributedObjects in interface HazelcastInstance

addDistributedObjectListener

public String addDistributedObjectListener(DistributedObjectListener distributedObjectListener)
Specified by:
addDistributedObjectListener in interface HazelcastInstance

removeDistributedObjectListener

public boolean removeDistributedObjectListener(String registrationId)
Specified by:
removeDistributedObjectListener in interface HazelcastInstance

getPartitionService

public PartitionService getPartitionService()
Specified by:
getPartitionService in interface HazelcastInstance

getClientService

public ClientService getClientService()
Specified by:
getClientService in interface HazelcastInstance

getLoggingService

public com.hazelcast.logging.LoggingService getLoggingService()
Specified by:
getLoggingService in interface HazelcastInstance

getLifecycleService

public LifecycleService getLifecycleService()
Specified by:
getLifecycleService in interface HazelcastInstance

getDistributedObject

@Deprecated
public <T extends DistributedObject> T getDistributedObject(String serviceName,
                                                                       Object id)
Deprecated. 

Specified by:
getDistributedObject in interface HazelcastInstance

getDistributedObject

public <T extends DistributedObject> T getDistributedObject(String serviceName,
                                                            String name)
Specified by:
getDistributedObject in interface HazelcastInstance

getUserContext

public ConcurrentMap<String,Object> getUserContext()
Specified by:
getUserContext in interface HazelcastInstance

getClientConfig

public ClientConfig getClientConfig()

getSerializationService

public SerializationService getSerializationService()

getConnectionManager

public com.hazelcast.client.connection.ClientConnectionManager getConnectionManager()

getClientClusterService

public ClientClusterService getClientClusterService()

getClientExecutionService

public ClientExecutionService getClientExecutionService()

getClientPartitionService

public ClientPartitionService getClientPartitionService()

getInvocationService

public ClientInvocationService getInvocationService()

getThreadGroup

public ThreadGroup getThreadGroup()

shutdown

public void shutdown()
Specified by:
shutdown in interface HazelcastInstance


Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.