3 Replies Latest reply on Apr 20, 2007 12:02 PM by manik

    Rigid design of state transfer manager, factories, integrato

    supi

      In one of our projects, we need to keep remote systems in sync with cache content. When a cluster node that already has some transient state connects or reconnects the cluster, incremental state update notifications must be provided, the default notifyAllNodesCreated() approach just doesn't cut it.

      It seems that in order to do this in 2.0.0, I have to subclass DefaltStateTransferIntegrater and actually write what I need. Then, I have to subclass StateTransferFactory and/or at least StateTransferManager and override the getStateTransferIntegrator() method and return my own. Then replace the transfer manager in cache impl. Is this correct?

      Shouldn't there be an easier way to do this, e.g. the ability to register a custom integrator with the state transfer factory? Or being able to pass my own factory to the default state manager? It seems that the code contains some generic design ideas but they are implemented in a static way that prevent them from actually being used. What do you think?

      Basil

        • 1. Re: Rigid design of state transfer manager, factories, integ
          manik

          There isn't any mechanism to inject a custom state transfer integrator/generator at the moment - and won't be for the foreseeable future.

          Why do you feel the default notification when state is integrated is insuffcient?

          • 2. Re: Rigid design of state transfer manager, factories, integ
            supi

            Because it is not possible to keep external resources in sync with the cache.

            If a cache contains node A before the transfer, and node A is recreated by the integrator (e.g. network interrupt), no create notification should take place. Likewise, when data is modified (application hook necessary to decide this), node modified events should be fired. Finally, it must be possible to detect removed nodes.

            Also, even though delete-all and create-all may work for the cache (although arguably a poor solution), the same cannot be expected from listeners/business semantics.

            Basil

            • 3. Re: Rigid design of state transfer manager, factories, integ
              manik

              Fair comment, I see your point. Perhaps what you need to do then is to contrib a patch that does integrate state in such a manner that it records creations, deletions and modifications, and fires off notifications accordingly? :)

              Have you created a JIRA feature request for this?