public class CPSubsystemImpl extends Object implements CPSubsystem
Constructor and Description |
---|
CPSubsystemImpl(HazelcastInstanceImpl instance) |
Modifier and Type | Method and Description |
---|---|
IAtomicLong |
getAtomicLong(String name)
Returns a proxy for an
IAtomicLong instance created on the CP
subsystem. |
<E> IAtomicReference<E> |
getAtomicReference(String name)
Returns a proxy for an
IAtomicReference instance created on
the CP subsystem. |
ICountDownLatch |
getCountDownLatch(String name)
Returns a proxy for an
ICountDownLatch instance created on
the CP subsystem. |
CPSessionManagementService |
getCPSessionManagementService()
Returns the
CPSessionManagementService of this Hazelcast
instance. |
CPSubsystemManagementService |
getCPSubsystemManagementService()
Returns the
CPSubsystemManagementService of this Hazelcast
instance. |
CPMember |
getLocalCPMember()
Returns the local CP member if this Hazelcast member is part of
the CP subsystem, returns null otherwise.
|
FencedLock |
getLock(String name)
Returns a proxy for an
FencedLock instance created on the CP
subsystem. |
ISemaphore |
getSemaphore(String name)
Returns a proxy for an
ISemaphore instance created on the CP
subsystem. |
public CPSubsystemImpl(HazelcastInstanceImpl instance)
public IAtomicLong getAtomicLong(String name)
CPSubsystem
IAtomicLong
instance created on the CP
subsystem. Hazelcast's IAtomicLong
is a distributed version of
java.util.concurrent.atomic.AtomicLong. If no group name is
given within the "name" parameter, then the IAtomicLong
instance
will be created on the DEFAULT CP group. If a group name is given, like
.getAtomicLong("myLong@group1")
, the given group will be
initialized first, if not initialized already, and then the
IAtomicLong
instance will be created on this group. Returned
IAtomicLong
instance offers linearizability and behaves as a CP
register. When a network partition occurs, proxies that exist on the
minority side of its CP group lose availability.
Each call of this method performs a commit to the Metadata CP group. Hence, callers should cache the returned proxy.
getAtomicLong
in interface CPSubsystem
name
- name of the IAtomicLong
proxyIAtomicLong
proxy for the given namepublic <E> IAtomicReference<E> getAtomicReference(String name)
CPSubsystem
IAtomicReference
instance created on
the CP subsystem. Hazelcast's IAtomicReference
is a distributed
version of java.util.concurrent.atomic.AtomicLong. If no group
name is given within the "name" parameter, then
the IAtomicReference
instance will be created on the DEFAULT CP
group. If a group name is given, like
.getAtomicReference("myRef@group1")
, the given group will be
initialized first, if not initialized already, and then the
IAtomicReference
instance will be created on this group.
Returned IAtomicReference
instance offers linearizability and
behaves as a CP register. When a network partition occurs, proxies that
exist on the minority side of its CP group lose availability.
Each call of this method performs a commit to the Metadata CP group. Hence, callers should cache the returned proxy.
getAtomicReference
in interface CPSubsystem
name
- name of the IAtomicReference
proxyIAtomicReference
proxy for the given namepublic ICountDownLatch getCountDownLatch(String name)
CPSubsystem
ICountDownLatch
instance created on
the CP subsystem. Hazelcast's ICountDownLatch
is a distributed
version of java.util.concurrent.CountDownLatch. If no group
name is given within the "name" parameter, then
the ICountDownLatch
instance will be created on the DEFAULT CP
group. If a group name is given, like
.getCountDownLatch("myLatch@group1")
, the given group will be
initialized first, if not initialized already, and then the
ICountDownLatch
instance will be created on this group. Returned
ICountDownLatch
instance offers linearizability. When a network
partition occurs, proxies that exist on the minority side of its CP
group lose availability.
Each call of this method performs a commit to the Metadata CP group. Hence, callers should cache the returned proxy.
getCountDownLatch
in interface CPSubsystem
name
- name of the ICountDownLatch
proxyICountDownLatch
proxy for the given namepublic FencedLock getLock(String name)
CPSubsystem
FencedLock
instance created on the CP
subsystem. Hazelcast's FencedLock
is a distributed version of
java.util.concurrent.locks.Lock. If no group name is given
within the "name" parameter, then the FencedLock
instance will
be created on the DEFAULT CP group. If a group name is given, like
.getLock("myLock@group1")
, the given group will be initialized
first, if not initialized already, and then the FencedLock
instance will be created on this group. Returned FencedLock
instance offers linearizability. When a network partition occurs,
proxies that exist on the minority side of its CP group lose
availability.
Each call of this method performs a commit to the Metadata CP group. Hence, callers should cache the returned proxy.
getLock
in interface CPSubsystem
name
- name of the FencedLock
proxyFencedLock
proxy for the given nameFencedLockConfig
public ISemaphore getSemaphore(String name)
CPSubsystem
ISemaphore
instance created on the CP
subsystem. Hazelcast's ISemaphore
is a distributed version of
java.util.concurrent.Semaphore. If no group name is given
within the "name" parameter, then the ISemaphore
instance will
be created on the DEFAULT CP group. If a group name is given, like
.getSemaphore("mySemaphore@group1")
, the given group will be
initialized first, if not initialized already, and then the
ISemaphore
instance will be created on this group. Returned
ISemaphore
instance offers linearizability. When a network
partition occurs, proxies that exist on the minority side of its CP
group lose availability.
Each call of this method performs a commit to the Metadata CP group. Hence, callers should cache the returned proxy.
getSemaphore
in interface CPSubsystem
name
- name of the ISemaphore
proxyISemaphore
proxy for the given nameCPSemaphoreConfig
public CPMember getLocalCPMember()
CPSubsystem
This method is a shortcut for CPSubsystemManagementService.getLocalCPMember()
method. Calling this method is equivalent to calling
getCPSubsystemManagementService().getLocalCPMember()
.
getLocalCPMember
in interface CPSubsystem
CPSubsystemManagementService.getLocalCPMember()
public CPSubsystemManagementService getCPSubsystemManagementService()
CPSubsystem
CPSubsystemManagementService
of this Hazelcast
instance. CPSubsystemManagementService
offers APIs for managing
CP members and CP groups.getCPSubsystemManagementService
in interface CPSubsystem
CPSubsystemManagementService
of this Hazelcast instancepublic CPSessionManagementService getCPSessionManagementService()
CPSubsystem
CPSessionManagementService
of this Hazelcast
instance. CPSessionManagementService
offers APIs for managing CP
sessions.getCPSessionManagementService
in interface CPSubsystem
CPSessionManagementService
of this Hazelcast instanceCopyright © 2021 Hazelcast, Inc.. All Rights Reserved.