-
1. Re: HA Service ?
pferraro May 16, 2012 2:57 PM (in response to gajendra083)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.
-
2. Re: HA Service ?
gajendra083 May 17, 2012 5:00 AM (in response to pferraro)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 ?
pferraro May 18, 2012 10:20 AM (in response to gajendra083)1 of 1 people found this helpfulOK - 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.
{code}
@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() {noformat}&&{noformat} !event.isOriginLocal()) {
// Handle remote invalidation event
}
}
}
{code}
-