|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hazelcast.core.Hazelcast
public final class Hazelcast
Factory for all of the Hazelcast data and execution components such as maps, queues, multimaps, topics and executor service.
If not started already, Hazelcast member (HazelcastInstance) will start automatically if any of the functions is called on Hazelcast.
Method Summary | ||
---|---|---|
static void |
addInstanceListener(InstanceListener instanceListener)
Deprecated. as of version 2.2 |
|
static Set<HazelcastInstance> |
getAllHazelcastInstances()
Returns all active/running HazelcastInstances on this JVM. |
|
static AtomicNumber |
getAtomicNumber(String name)
Deprecated. as of version 2.2 |
|
static Cluster |
getCluster()
Deprecated. as of version 2.2 |
|
static Config |
getConfig()
Deprecated. as of version 2.2 |
|
static ICountDownLatch |
getCountDownLatch(String name)
Deprecated. as of version 2.2 |
|
static HazelcastInstance |
getDefaultInstance()
Deprecated. as of version 2.2 |
|
static ExecutorService |
getExecutorService()
Deprecated. as of version 2.2 |
|
static ExecutorService |
getExecutorService(String name)
Deprecated. as of version 2.2 |
|
static HazelcastInstance |
getHazelcastInstanceByName(String instanceName)
Returns an existing HazelcastInstance with instanceName. |
|
static IdGenerator |
getIdGenerator(String name)
Deprecated. as of version 2.2 |
|
static Collection<Instance> |
getInstances()
Deprecated. as of version 2.2 |
|
static LifecycleService |
getLifecycleService()
Deprecated. as of version 2.2 |
|
static
|
getList(String name)
Deprecated. as of version 2.2 |
|
static ILock |
getLock(Object key)
Deprecated. as of version 2.2 |
|
static LoggingService |
getLoggingService()
Deprecated. as of version 2.2 |
|
static
|
getMap(String name)
Deprecated. as of version 2.2 |
|
static
|
getMultiMap(String name)
Deprecated. as of version 2.2 |
|
static PartitionService |
getPartitionService()
Deprecated. as of version 2.2 |
|
static
|
getQueue(String name)
Deprecated. as of version 2.2 |
|
static ISemaphore |
getSemaphore(String name)
Deprecated. as of version 2.2 |
|
static
|
getSet(String name)
Deprecated. as of version 2.2 |
|
static
|
getTopic(String name)
Deprecated. as of version 2.2 |
|
static Transaction |
getTransaction()
Deprecated. as of version 2.2 |
|
static HazelcastInstance |
init(Config config)
Deprecated. as of version 2.2 |
|
static HazelcastInstance |
newHazelcastInstance()
Creates a new HazelcastInstance (a new node in a cluster). |
|
static HazelcastInstance |
newHazelcastInstance(Config config)
Creates a new HazelcastInstance (a new node in a cluster). |
|
static HazelcastInstance |
newLiteMemberHazelcastInstance()
Creates a new HazelcastInstance Lite Member (a new node in a cluster). |
|
static void |
removeInstanceListener(InstanceListener instanceListener)
Deprecated. as of version 2.2 |
|
static void |
restart()
Deprecated. as of version 1.9 |
|
static void |
setOutOfMemoryHandler(OutOfMemoryHandler outOfMemoryHandler)
Sets OutOfMemoryHandler to be used when an OutOfMemoryError is caught by Hazelcast threads. |
|
static void |
shutdown()
Deprecated. as of version 1.9 |
|
static void |
shutdownAll()
Shuts down all running Hazelcast Instances on this JVM, including the default one if it is running. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
@Deprecated public static HazelcastInstance init(Config config)
config
- configuration for this Hazelcast instance.
IllegalStateException
- if this instance is already initializednewHazelcastInstance(com.hazelcast.config.Config)
,
getHazelcastInstanceByName(String)
,
getAllHazelcastInstances()
@Deprecated public static HazelcastInstance getDefaultInstance()
newHazelcastInstance(com.hazelcast.config.Config)
,
getHazelcastInstanceByName(String)
,
getAllHazelcastInstances()
@Deprecated public static <E> IQueue<E> getQueue(String name)
name
- name of the distributed queue
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getQueue(String)
@Deprecated public static <E> ITopic<E> getTopic(String name)
name
- name of the distributed topic
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getTopic(String)
@Deprecated public static <E> ISet<E> getSet(String name)
name
- name of the distributed set
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getSet(String)
@Deprecated public static <E> IList<E> getList(String name)
name
- name of the distributed list
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getList(String)
@Deprecated public static <K,V> IMap<K,V> getMap(String name)
name
- name of the distributed map
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getMap(String)
@Deprecated public static <K,V> MultiMap<K,V> getMultiMap(String name)
name
- name of the distributed multimap
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getMultiMap(String)
@Deprecated public static ILock getLock(Object key)
Lock lock = Hazelcast.getLock("PROCESS_LOCK"); lock.lock(); try { // process } finally { lock.unlock(); }
key
- key of the lock instance
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getLock(Object)
@Deprecated public static Cluster getCluster()
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getCluster()
@Deprecated public static ExecutorService getExecutorService()
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getExecutorService()
@Deprecated public static ExecutorService getExecutorService(String name)
name
- name of the executor service
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getExecutorService(String)
@Deprecated public static Transaction getTransaction()
Map map = Hazelcast.getMap("mymap"); Transaction txn = Hazelcast.getTransaction(); txn.begin(); try { map.put ("key", "value"); txn.commit(); }catch (Exception e) { txn.rollback(); }Isolation is always REPEATABLE_READ . If you are in a transaction, you can read the data in your transaction and the data that is already committed and if not in a transaction, you can only read the committed data. Implementation is different for queue and map/set. For queue operations (offer,poll), offered and/or polled objects are copied to the next member in order to safely commit/rollback. For map/set, Hazelcast first acquires the locks for the write operations (put, remove) and holds the differences (what is added/removed/updated) locally for each transaction. When transaction is set to commit, Hazelcast will release the locks and apply the differences. When rolling back, Hazelcast will simply releases the locks and discard the differences. Transaction instance is attached to the current thread and each Hazelcast operation checks if the current thread holds a transaction, if so, operation will be transaction aware. When transaction is committed, rolled back or timed out, it will be detached from the thread holding it.
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getTransaction()
@Deprecated public static AtomicNumber getAtomicNumber(String name)
name
- of the AtomicNumber proxy
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getAtomicNumber(String)
@Deprecated public static ICountDownLatch getCountDownLatch(String name)
name
- of the distributed CountDownLatch
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getCountDownLatch(String)
@Deprecated public static ISemaphore getSemaphore(String name)
name
- of the distributed Semaphore
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getSemaphore(String)
@Deprecated public static IdGenerator getIdGenerator(String name)
name
-
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getIdGenerator(String)
@Deprecated public static void shutdown()
HazelcastInstance.getLifecycleService()
,
LifecycleService.shutdown()
public static void shutdownAll()
newHazelcastInstance(Config)
@Deprecated public static void restart()
HazelcastInstance##getLifecycleService()
,
LifecycleService.restart()
@Deprecated public static Collection<Instance> getInstances()
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getInstances()
@Deprecated public static void addInstanceListener(InstanceListener instanceListener)
instanceListener
- instance listenernewHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.addInstanceListener(InstanceListener)
@Deprecated public static void removeInstanceListener(InstanceListener instanceListener)
instanceListener
- instance listener to removenewHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.removeInstanceListener(InstanceListener)
public static HazelcastInstance newHazelcastInstance(Config config)
shutdownAll()
.
config
- Configuration for the new HazelcastInstance (member)
shutdownAll()
,
getHazelcastInstanceByName(String)
public static HazelcastInstance newHazelcastInstance()
shutdownAll()
.
Hazelcast will look into two places for the configuration file:
shutdownAll()
,
getHazelcastInstanceByName(String)
public static HazelcastInstance newLiteMemberHazelcastInstance()
shutdownAll()
.
Hazelcast will look into two places for the configuration file:
shutdownAll()
,
getHazelcastInstanceByName(String)
public static HazelcastInstance getHazelcastInstanceByName(String instanceName)
shutdownAll()
.
instanceName
- Name of the HazelcastInstance (member)
newHazelcastInstance(Config)
,
shutdownAll()
public static Set<HazelcastInstance> getAllHazelcastInstances()
shutdownAll()
.
newHazelcastInstance(Config)
,
getHazelcastInstanceByName(String)
,
shutdownAll()
@Deprecated public static Config getConfig()
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getConfig()
@Deprecated public static PartitionService getPartitionService()
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getPartitionService()
@Deprecated public static LoggingService getLoggingService()
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getLoggingService()
@Deprecated public static LifecycleService getLifecycleService()
newHazelcastInstance(com.hazelcast.config.Config)
,
HazelcastInstance.getLifecycleService()
public static void setOutOfMemoryHandler(OutOfMemoryHandler outOfMemoryHandler)
Warning: OutOfMemoryHandler may not be called although JVM throws OutOfMemoryError. Because error may be thrown from an external (user thread) thread and Hazelcast may not be informed about OutOfMemoryError.
outOfMemoryHandler
- OutOfMemoryError
,
OutOfMemoryHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |