Class CPSubsystemStubImpl
- All Implemented Interfaces:
CPSubsystem,Consumer<com.hazelcast.client.impl.spi.ClientContext>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMessage 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(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 anIAtomicLonginstance created on CP Subsystem.<E> IAtomicReference<E>getAtomicReference(String name) Returns a proxy for anIAtomicReferenceinstance created on CP Subsystem.getCountDownLatch(String name) Returns a proxy for anICountDownLatchinstance created on CP Subsystem.Returns all active CP group ids.Returns theCPSessionManagementServiceof this Hazelcast instance.Returns theCPSubsystemManagementServiceof this Hazelcast instance.Returns the local CP member if this Hazelcast member is part of CP Subsystem, returns null otherwise.Returns a proxy for anFencedLockinstance 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 anISemaphoreinstance created on CP Subsystem.getTombstoneInfos(CPGroupId groupId, String serviceName) Returns info about all tombstones of given type within the given groupbooleanRemoves CPGroupAvailabilityListener registration.booleanRemoves 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:CPSubsystemReturns a proxy for anIAtomicLonginstance created on CP Subsystem. Hazelcast'sIAtomicLongis a distributed version of java.util.concurrent.atomic.AtomicLong. If no group name is given within the "name" parameter, then theIAtomicLonginstance 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 theIAtomicLonginstance will be created on this group. ReturnedIAtomicLonginstance 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:
getAtomicLongin interfaceCPSubsystem- Parameters:
name- name of theIAtomicLongproxy- Returns:
IAtomicLongproxy for the given name
-
getAtomicReference
Description copied from interface:CPSubsystemReturns a proxy for anIAtomicReferenceinstance created on CP Subsystem. Hazelcast'sIAtomicReferenceis a distributed version of java.util.concurrent.atomic.AtomicReference. If no group name is given within the "name" parameter, then theIAtomicReferenceinstance 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 theIAtomicReferenceinstance will be created on this group. ReturnedIAtomicReferenceinstance 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:
getAtomicReferencein interfaceCPSubsystem- Type Parameters:
E- the type of object referred to by the reference- Parameters:
name- name of theIAtomicReferenceproxy- Returns:
IAtomicReferenceproxy for the given name
-
getCountDownLatch
Description copied from interface:CPSubsystemReturns a proxy for anICountDownLatchinstance created on CP Subsystem. Hazelcast'sICountDownLatchis a distributed version of java.util.concurrent.CountDownLatch. If no group name is given within the "name" parameter, then theICountDownLatchinstance 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 theICountDownLatchinstance will be created on this group. ReturnedICountDownLatchinstance 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:
getCountDownLatchin interfaceCPSubsystem- Parameters:
name- name of theICountDownLatchproxy- Returns:
ICountDownLatchproxy for the given name
-
getLock
Description copied from interface:CPSubsystemReturns a proxy for anFencedLockinstance created on CP Subsystem. Hazelcast'sFencedLockis a distributed version of java.util.concurrent.locks.Lock. If no group name is given within the "name" parameter, then theFencedLockinstance 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 theFencedLockinstance will be created on this group. ReturnedFencedLockinstance 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:
getLockin interfaceCPSubsystem- Parameters:
name- name of theFencedLockproxy- Returns:
FencedLockproxy for the given name- See Also:
-
getSemaphore
Description copied from interface:CPSubsystemReturns a proxy for anISemaphoreinstance created on CP Subsystem. Hazelcast'sISemaphoreis a distributed version of java.util.concurrent.Semaphore. If no group name is given within the "name" parameter, then theISemaphoreinstance 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 theISemaphoreinstance will be created on this group. ReturnedISemaphoreinstance 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:
getSemaphorein interfaceCPSubsystem- Parameters:
name- name of theISemaphoreproxy- Returns:
ISemaphoreproxy for the given name- See Also:
-
getLocalCPMember
Description copied from interface:CPSubsystemReturns 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:
getLocalCPMemberin interfaceCPSubsystem- Returns:
- local CP member if available, null otherwise
- See Also:
-
getCPSubsystemManagementService
Description copied from interface:CPSubsystemReturns theCPSubsystemManagementServiceof this Hazelcast instance.CPSubsystemManagementServiceoffers APIs for managing CP members and CP groups.- Specified by:
getCPSubsystemManagementServicein interfaceCPSubsystem- Returns:
- the
CPSubsystemManagementServiceof this Hazelcast instance
-
getCPSessionManagementService
Description copied from interface:CPSubsystemReturns theCPSessionManagementServiceof this Hazelcast instance.CPSessionManagementServiceoffers APIs for managing CP sessions.- Specified by:
getCPSessionManagementServicein interfaceCPSubsystem- Returns:
- the
CPSessionManagementServiceof this Hazelcast instance
-
addMembershipListener
Description copied from interface:CPSubsystemRegisters a new CPMembershipListener to listen CP membership changes.- Specified by:
addMembershipListenerin interfaceCPSubsystem- Parameters:
listener- membership listener- Returns:
- id of the listener registration
-
removeMembershipListener
Description copied from interface:CPSubsystemRemoves membership listener registration. Previously registered listener will not receive further events.- Specified by:
removeMembershipListenerin interfaceCPSubsystem- Parameters:
id- of the registration- Returns:
- true if listener registration is removed, false otherwise
-
addGroupAvailabilityListener
Description copied from interface:CPSubsystemRegisters a new CPGroupAvailabilityListener to listen CP group availability changes.- Specified by:
addGroupAvailabilityListenerin interfaceCPSubsystem- Parameters:
listener- group availability listener- Returns:
- id of the listener registration
-
removeGroupAvailabilityListener
Description copied from interface:CPSubsystemRemoves CPGroupAvailabilityListener registration.- Specified by:
removeGroupAvailabilityListenerin interfaceCPSubsystem- Parameters:
id- of the registration- Returns:
- true if listener registration is removed, false otherwise
-
getMap
Description copied from interface:CPSubsystemReturns a proxy for aCPMap. Enterprise Only.If no group name is given within the
nameparameter, then theCPMapinstance 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 theCPMapinstance will be created on this group. The returnedCPMapinstance 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:
getMapin 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:CPSubsystemReturns all active CP group ids.- Specified by:
getCPGroupIdsin interfaceCPSubsystem
-
getObjectInfos
@Nonnull public Iterable<CPObjectInfo> getObjectInfos(@Nonnull CPGroupId groupId, @Nonnull String serviceName) Description copied from interface:CPSubsystemReturns info about all objects of given type within the given group- Specified by:
getObjectInfosin 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:CPSubsystemReturns info about all tombstones of given type within the given group- Specified by:
getTombstoneInfosin 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)
-