I've gotten a prototype version of deploy-hasingleton functionality to work with the
new SPI. Fundamental classes are:
http://anonsvn.jboss.org/repos/jbossas/trunk/cluster/src/main/org/jboss/h...
http://anonsvn.jboss.org/repos/jbossas/trunk/cluster/src/main/org/jboss/h...
The HASingletonProfileActivator is configured with the strings necessary to make up a
ProfileKey and a ref to the ProfileService. It then exposes methods an
HASingletonController can invoke when it becomes/stops being the master. Those methods
call ProfileService.activateProfile() and releaseProfile().
The HASingletonProfileManager is a subclass that takes a List as a configuration element
and uses that to create a Profile for the deploy-hasingleton content. I'll post
separately about why I think this is wrong.
This code is committed but not used yet because making it work requires a change to
AbstractProfileService that I want to discuss before committing. Will post separately on
that as well.
Some comments on the SPI:
1) Should "public void registerProfile(Profile profile)" instead be "public
void registerProfile(ProfileMetaData profile)"? Let the ProfileService handle
creation of the Profile from metadata. To make my HASingletonProfileManager work I needed
to inject a reference to the ProfileFactory bean, which smells wrong.
2) Similar thing with "public void unregisterProfile(Profile profile)". I think
the argument should be a ProfileKey.
3) This is just a nit. Why releaseProfile(ProfileKey key) instead of
inactivateProfile(ProfileKey key)?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4204451#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...