1 Reply Latest reply on Jul 17, 2009 12:24 PM by Brian Stansberry

    Deprecated DistributedState in Cluster API for JBossAS 5

    Alexander Magdenko Newbie

      I have code with DistributedState to update some data (my own metrics) for all members in cluster.

      Now I see that DistributedState (seems DistributedState.DSListenerEx too) deprecated but I don't know how to replace my code.

      Take a look..

      HAPartition part = ...;

      DistributedState distState = part.getDistributedStateService();
      DistributedState.DSListenerEx listenerState = new DistributedState.DSListenerEx() {
      * {@inheritDoc}
      public void keyHasBeenRemoved(String category, Serializable key, Serializable value, boolean locally) {
      // No-op.

      * {@inheritDoc}
      public void valueHasChanged(String category, Serializable key, Serializable value, boolean locally) {
      // Some logic...


      /* Register state listener. */
      distState.registerDSListenerEx(CATEGORY, listenerState);

      Every cluster node start thread with metrics update in loop
      distState.set(CATEGORY, locNode.getJBossId(), localNodeMetrics);

      Do you have any ideas how to replicate metrics for all nodes?
      I see that CacheManager added in JBoss AS 5

      Alex Magdenko