Class CPSubsystemStubImpl
- All Implemented Interfaces:
CPSubsystem
,Consumer<com.hazelcast.client.impl.spi.ClientContext>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Message to inform that CP subsystem is not available in Hazelcast OSFields inherited from interface com.hazelcast.cp.CPSubsystem
ATOMIC_LONG, ATOMIC_REFERENCE, COUNT_DOWN_LATCH, CP_MAP, LOCK, SEMAPHORE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(com.hazelcast.client.impl.spi.ClientContext clientContext) Registers a new CPGroupAvailabilityListener to listen CP group availability changes.addMembershipListener
(CPMembershipListener listener) Registers a new CPMembershipListener to listen CP membership changes.getAtomicLong
(String name) Returns a proxy for anIAtomicLong
instance created on CP Subsystem.<E> IAtomicReference<E>
getAtomicReference
(String name) Returns a proxy for anIAtomicReference
instance created on CP Subsystem.getCountDownLatch
(String name) Returns a proxy for anICountDownLatch
instance created on CP Subsystem.Returns all active CP group ids.Returns theCPSessionManagementService
of this Hazelcast instance.Returns theCPSubsystemManagementService
of this Hazelcast instance.Returns the local CP member if this Hazelcast member is part of CP Subsystem, returns null otherwise.Returns a proxy for anFencedLock
instance created on CP Subsystem.<K,
V> CPMap<K, V> Returns a proxy for aCPMap
.getObjectInfos
(CPGroupId groupId, String serviceName) Returns info about all objects of given type within the given groupgetSemaphore
(String name) Returns a proxy for anISemaphore
instance created on CP Subsystem.getTombstoneInfos
(CPGroupId groupId, String serviceName) Returns info about all tombstones of given type within the given groupboolean
Removes CPGroupAvailabilityListener registration.boolean
Removes membership listener registration.
-
Field Details
-
CP_SUBSYSTEM_IS_NOT_AVAILABLE_IN_OS
Message to inform that CP subsystem is not available in Hazelcast OS- See Also:
-
-
Constructor Details
-
CPSubsystemStubImpl
public CPSubsystemStubImpl()
-
-
Method Details
-
getAtomicLong
Description copied from interface:CPSubsystem
Returns a proxy for anIAtomicLong
instance created on CP Subsystem. Hazelcast'sIAtomicLong
is a distributed version of java.util.concurrent.atomic.AtomicLong. If no group name is given within the "name" parameter, then theIAtomicLong
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 theIAtomicLong
instance will be created on this group. ReturnedIAtomicLong
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.
- Specified by:
getAtomicLong
in interfaceCPSubsystem
- Parameters:
name
- name of theIAtomicLong
proxy- Returns:
IAtomicLong
proxy for the given name
-
getAtomicReference
Description copied from interface:CPSubsystem
Returns a proxy for anIAtomicReference
instance created on CP Subsystem. Hazelcast'sIAtomicReference
is a distributed version of java.util.concurrent.atomic.AtomicReference. If no group name is given within the "name" parameter, then theIAtomicReference
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 theIAtomicReference
instance will be created on this group. ReturnedIAtomicReference
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.
- Specified by:
getAtomicReference
in interfaceCPSubsystem
- Type Parameters:
E
- the type of object referred to by the reference- Parameters:
name
- name of theIAtomicReference
proxy- Returns:
IAtomicReference
proxy for the given name
-
getCountDownLatch
Description copied from interface:CPSubsystem
Returns a proxy for anICountDownLatch
instance created on CP Subsystem. Hazelcast'sICountDownLatch
is a distributed version of java.util.concurrent.CountDownLatch. If no group name is given within the "name" parameter, then theICountDownLatch
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 theICountDownLatch
instance will be created on this group. ReturnedICountDownLatch
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.
- Specified by:
getCountDownLatch
in interfaceCPSubsystem
- Parameters:
name
- name of theICountDownLatch
proxy- Returns:
ICountDownLatch
proxy for the given name
-
getLock
Description copied from interface:CPSubsystem
Returns a proxy for anFencedLock
instance created on CP Subsystem. Hazelcast'sFencedLock
is a distributed version of java.util.concurrent.locks.Lock. If no group name is given within the "name" parameter, then theFencedLock
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 theFencedLock
instance will be created on this group. ReturnedFencedLock
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.
- Specified by:
getLock
in interfaceCPSubsystem
- Parameters:
name
- name of theFencedLock
proxy- Returns:
FencedLock
proxy for the given name- See Also:
-
getSemaphore
Description copied from interface:CPSubsystem
Returns a proxy for anISemaphore
instance created on CP Subsystem. Hazelcast'sISemaphore
is a distributed version of java.util.concurrent.Semaphore. If no group name is given within the "name" parameter, then theISemaphore
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 theISemaphore
instance will be created on this group. ReturnedISemaphore
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.
- Specified by:
getSemaphore
in interfaceCPSubsystem
- Parameters:
name
- name of theISemaphore
proxy- Returns:
ISemaphore
proxy for the given name- See Also:
-
getLocalCPMember
Description copied from interface:CPSubsystem
Returns the local CP member if this Hazelcast member is part of CP Subsystem, returns null otherwise.This method is a shortcut for
CPSubsystemManagementService.getLocalCPMember()
method. Calling this method is equivalent to callinggetCPSubsystemManagementService().getLocalCPMember()
.- Specified by:
getLocalCPMember
in interfaceCPSubsystem
- Returns:
- local CP member if available, null otherwise
- See Also:
-
getCPSubsystemManagementService
Description copied from interface:CPSubsystem
Returns theCPSubsystemManagementService
of this Hazelcast instance.CPSubsystemManagementService
offers APIs for managing CP members and CP groups.- Specified by:
getCPSubsystemManagementService
in interfaceCPSubsystem
- Returns:
- the
CPSubsystemManagementService
of this Hazelcast instance
-
getCPSessionManagementService
Description copied from interface:CPSubsystem
Returns theCPSessionManagementService
of this Hazelcast instance.CPSessionManagementService
offers APIs for managing CP sessions.- Specified by:
getCPSessionManagementService
in interfaceCPSubsystem
- Returns:
- the
CPSessionManagementService
of this Hazelcast instance
-
addMembershipListener
Description copied from interface:CPSubsystem
Registers a new CPMembershipListener to listen CP membership changes.- Specified by:
addMembershipListener
in interfaceCPSubsystem
- Parameters:
listener
- membership listener- Returns:
- id of the listener registration
-
removeMembershipListener
Description copied from interface:CPSubsystem
Removes membership listener registration. Previously registered listener will not receive further events.- Specified by:
removeMembershipListener
in interfaceCPSubsystem
- Parameters:
id
- of the registration- Returns:
- true if listener registration is removed, false otherwise
-
addGroupAvailabilityListener
Description copied from interface:CPSubsystem
Registers a new CPGroupAvailabilityListener to listen CP group availability changes.- Specified by:
addGroupAvailabilityListener
in interfaceCPSubsystem
- Parameters:
listener
- group availability listener- Returns:
- id of the listener registration
-
removeGroupAvailabilityListener
Description copied from interface:CPSubsystem
Removes CPGroupAvailabilityListener registration.- Specified by:
removeGroupAvailabilityListener
in interfaceCPSubsystem
- Parameters:
id
- of the registration- Returns:
- true if listener registration is removed, false otherwise
-
getMap
Description copied from interface:CPSubsystem
Returns a proxy for aCPMap
. Enterprise Only.If no group name is given within the
name
parameter, then theCPMap
instance will be created on the DEFAULT CP group. If a group name is given, like.getMap("myMap@group1")
, the given group will be initialized first, if not initialized already, and then theCPMap
instance will be created on this group. The returnedCPMap
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.
- Specified by:
getMap
in interfaceCPSubsystem
- Type Parameters:
K
- Key type of the mapV
- Value type of the map- Parameters:
name
- Name of the map- Returns:
- Proxy for
CPMap
-
getCPGroupIds
Description copied from interface:CPSubsystem
Returns all active CP group ids.- Specified by:
getCPGroupIds
in interfaceCPSubsystem
-
getObjectInfos
@Nonnull public Iterable<CPObjectInfo> getObjectInfos(@Nonnull CPGroupId groupId, @Nonnull String serviceName) Description copied from interface:CPSubsystem
Returns info about all objects of given type within the given group- Specified by:
getObjectInfos
in interfaceCPSubsystem
- Parameters:
groupId
- groupId for which to return the object infosserviceName
- service name for which the objects are returned
-
getTombstoneInfos
@Nonnull public Iterable<CPObjectInfo> getTombstoneInfos(@Nonnull CPGroupId groupId, @Nonnull String serviceName) Description copied from interface:CPSubsystem
Returns info about all tombstones of given type within the given group- Specified by:
getTombstoneInfos
in interfaceCPSubsystem
- Parameters:
groupId
- groupId for which to return the tombstone infosserviceName
- service name for which the tombstones are returned
-
accept
public void accept(com.hazelcast.client.impl.spi.ClientContext clientContext)
-