4 Replies Latest reply: May 18, 2012 12:20 AM by Gajendra Rathore RSS

HA Service ?

Gajendra Rathore Newbie

Jboss as7 support HA Service, if not then by when we can get this service ?

  • 1. Re: HA Service ?
    Paul Ferraro Master

    Can you be more specific?  What specific functionality are you looking for?  Are you simply looking for a mechanism to make cluster-wide remote procedure calls?  e.g.

    https://github.com/jbossas/jboss-as/blob/master/clustering/api/src/main/java/org/jboss/as/clustering/GroupRpcDispatcher.java

  • 2. Re: HA Service ?
    Gajendra Rathore Newbie

    Hi Paul,

     

    I am migrating my project from Jboss 4 to Jboss 7.

     

    One of my class is using HAServiceMBeanSupport Management Bean for an HA-Service to provide a convenient common base for cluster symmetric MBeans.. This class is also a user transparent extension of the standard NotificationBroadcasterSupport to a clustered environment. Send notice to people listening to JBossCache that something was invalidated and using a cache name and fingerprint to ensure that:

    1) only a cache that's named the same as this one will process the event

    2) that some cache instance doesn't process its own invalidation message

     

    Let me know if you need further details.

     

    Thanks,

    Gajendra


  • 3. Re: HA Service ?
    Paul Ferraro Master

    OK - you seem to be describing 2 different use cases.

     

    1. A clustered jmx notification mechanism.  The base class of HAServiceMBeanSupport, i.e. ServiceMBeanSupport doesn't exist in AS7 - therefore nor does HAServiceMBeanSupport.  At its essence, HAServiceMBeanSupport is just a mechanism for sending RPCs, for which the GroupRpcDispatcher can be used to broadcast events received via the javax.management.NotificationListener interface to the other nodes in the cluster.

     

    2. Cache invalidation events.  AS7 uses Infinispan in place of JBoss Cache.  Handling remote cache entry invalidation events is really quite simple.

    e.g.

     

    @org.infinispan.notifications.Listener
    class MyObject<K, V> {
      @Resource(lookup="java:jboss/infinispan/cache/mycontainer/mycache")
      private org.infinispan.Cache cache;
    
      @PostConstruct
      public void init() {
        this.cache.addListener(this);
      }
    
      @PreDestroy
      public void destroy() {
        this.cache.removeListener(this);
      }
    
      @org.infinispan.notifications.cachelistener.annotation.CacheEntryInvalidated
      public void invalidated(org.infinispan.notifications.cachelistener.event.CacheEntryInvalidatedEvent<K, V> event) {
        if (!event.isPre() &amp;&amp; !event.isOriginLocal()) {
          // Handle remote invalidation event
        }
      }
    }
    

     

  • 4. Re: HA Service ?
    Gajendra Rathore Newbie

    Thanks Paul