Class CPSubsystemStubImpl

java.lang.Object
com.hazelcast.cp.CPSubsystemStubImpl
All Implemented Interfaces:
CPSubsystem, Consumer<com.hazelcast.client.impl.spi.ClientContext>

public class CPSubsystemStubImpl extends Object implements CPSubsystem, Consumer<com.hazelcast.client.impl.spi.ClientContext>
  • Field Details

    • CP_SUBSYSTEM_IS_NOT_AVAILABLE_IN_OS

      public static final String 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

      @Nonnull public IAtomicLong getAtomicLong(@Nonnull String name)
      Description copied from interface: CPSubsystem
      Returns a proxy for an IAtomicLong instance created on 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.

      Specified by:
      getAtomicLong in interface CPSubsystem
      Parameters:
      name - name of the IAtomicLong proxy
      Returns:
      IAtomicLong proxy for the given name
    • getAtomicReference

      @Nonnull public <E> IAtomicReference<E> getAtomicReference(@Nonnull String name)
      Description copied from interface: CPSubsystem
      Returns a proxy for an IAtomicReference instance created on CP Subsystem. Hazelcast's IAtomicReference is a distributed version of java.util.concurrent.atomic.AtomicReference. 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.

      Specified by:
      getAtomicReference in interface CPSubsystem
      Type Parameters:
      E - the type of object referred to by the reference
      Parameters:
      name - name of the IAtomicReference proxy
      Returns:
      IAtomicReference proxy for the given name
    • getCountDownLatch

      @Nonnull public ICountDownLatch getCountDownLatch(@Nonnull String name)
      Description copied from interface: CPSubsystem
      Returns a proxy for an ICountDownLatch instance created on 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.

      Specified by:
      getCountDownLatch in interface CPSubsystem
      Parameters:
      name - name of the ICountDownLatch proxy
      Returns:
      ICountDownLatch proxy for the given name
    • getLock

      @Nonnull public FencedLock getLock(@Nonnull String name)
      Description copied from interface: CPSubsystem
      Returns a proxy for an FencedLock instance created on 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.

      Specified by:
      getLock in interface CPSubsystem
      Parameters:
      name - name of the FencedLock proxy
      Returns:
      FencedLock proxy for the given name
    • getSemaphore

      @Nonnull public ISemaphore getSemaphore(@Nonnull String name)
      Description copied from interface: CPSubsystem
      Returns a proxy for an ISemaphore instance created on 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.

      Specified by:
      getSemaphore in interface CPSubsystem
      Parameters:
      name - name of the ISemaphore proxy
      Returns:
      ISemaphore proxy for the given name
    • addMembershipListener

      public UUID addMembershipListener(CPMembershipListener listener)
      Description copied from interface: CPSubsystem
      Registers a new CPMembershipListener to listen CP membership changes.
      Specified by:
      addMembershipListener in interface CPSubsystem
      Parameters:
      listener - membership listener
      Returns:
      id of the listener registration
    • removeMembershipListener

      public boolean removeMembershipListener(UUID id)
      Description copied from interface: CPSubsystem
      Removes membership listener registration. Previously registered listener will not receive further events.
      Specified by:
      removeMembershipListener in interface CPSubsystem
      Parameters:
      id - of the registration
      Returns:
      true if listener registration is removed, false otherwise
    • addGroupAvailabilityListener

      public UUID addGroupAvailabilityListener(CPGroupAvailabilityListener listener)
      Description copied from interface: CPSubsystem
      Registers a new CPGroupAvailabilityListener to listen CP group availability changes.
      Specified by:
      addGroupAvailabilityListener in interface CPSubsystem
      Parameters:
      listener - group availability listener
      Returns:
      id of the listener registration
    • removeGroupAvailabilityListener

      public boolean removeGroupAvailabilityListener(UUID id)
      Description copied from interface: CPSubsystem
      Removes CPGroupAvailabilityListener registration.
      Specified by:
      removeGroupAvailabilityListener in interface CPSubsystem
      Parameters:
      id - of the registration
      Returns:
      true if listener registration is removed, false otherwise
    • getMap

      @Nonnull public <K, V> CPMap<K,V> getMap(@Nonnull String name)
      Description copied from interface: CPSubsystem
      Returns a proxy for a CPMap. Enterprise Only.

      If no group name is given within the name parameter, then the CPMap 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 the CPMap instance will be created on this group. The returned CPMap 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 interface CPSubsystem
      Type Parameters:
      K - Key type of the map
      V - Value type of the map
      Parameters:
      name - Name of the map
      Returns:
      Proxy for CPMap
    • getCPGroupIds

      @Nonnull public Collection<CPGroupId> getCPGroupIds()
      Description copied from interface: CPSubsystem
      Returns all active CP group ids.
      Specified by:
      getCPGroupIds in interface CPSubsystem
    • 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 interface CPSubsystem
      Parameters:
      groupId - groupId for which to return the object infos
      serviceName - 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 interface CPSubsystem
      Parameters:
      groupId - groupId for which to return the tombstone infos
      serviceName - service name for which the tombstones are returned
    • accept

      public void accept(com.hazelcast.client.impl.spi.ClientContext clientContext)
      Specified by:
      accept in interface Consumer<com.hazelcast.client.impl.spi.ClientContext>