Annotation Type Clustered


  • @Documented
    @Inherited
    @Retention(RUNTIME)
    @Target(TYPE)
    public @interface Clustered
    This annotation can be added to @Singleton EJB beans and @ApplicationScoped CDI beans to specify that they are cluster-wide singletons, not just a singleton per server instance
    Author:
    lprimak
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean callPostConstructOnAttach
      Specifies whether to call @PostConstruct when the singleton is attached to a cluster and this singleton already exists on the other node.
      boolean callPreDestoyOnDetach
      Specifies whether to call @PreDestroy when the singleton is detached from a cluster and this singleton also exists on the other node.
      String keyName
      key in the distributed map to bind this clustered object to.
      DistributedLockType lock
      specifies the type of distributed locking to be performed For EJB beans, only INHERIT and LOCK_NONE are valid for CDI beans, INHERIT is equivalent to NONE, and the other valid value for CDI beans is LOCK
    • Element Detail

      • keyName

        String keyName
        key in the distributed map to bind this clustered object to. Default is the name of the bean
        Default:
        ""
      • lock

        DistributedLockType lock
        specifies the type of distributed locking to be performed For EJB beans, only INHERIT and LOCK_NONE are valid for CDI beans, INHERIT is equivalent to NONE, and the other valid value for CDI beans is LOCK
        Default:
        fish.payara.cluster.DistributedLockType.INHERIT
      • callPostConstructOnAttach

        boolean callPostConstructOnAttach
        Specifies whether to call @PostConstruct when the singleton is attached to a cluster and this singleton already exists on the other node. (not truly created) Default is true
        Default:
        true
      • callPreDestoyOnDetach

        boolean callPreDestoyOnDetach
        Specifies whether to call @PreDestroy when the singleton is detached from a cluster and this singleton also exists on the other node. (not truly destroyed) Default is true
        Default:
        true