"galder.zamarreno(a)jboss.com" wrote :
| I'm not sure about the convenience of keeping the boolean version. By defining the
boolean version in the interface as well, you are forcing people to implement it when you
already know what the implementation will be. IOW, someone implementing this could provide
a valid pickSingleton() implementation and an invalid implementation for
isElectedMaster(). Sounds like a potential source for inconsistencies in implementations
and double work vs avoiding an equals() call in HASingletonSupport.
OK, makes sense to me.
anonymous wrote : I see. So, maybe we're creating more problems for ourselves by
having those setHAPartition/getHAPartition and setManagedSingleton/getManagedSingleton?
Getting the List might be all we need to actually decide the singleton to run in, unless
there's information that is available through DRM and not through ClusterNode that
could potentially be used to make such decision at some point.
|
Those are needed. A design goal here is to make it possible for a custom policy impl to
base its decision on factors beyond the simple topology info:
1) Can even call into cluster, for example to have some sort of vote. Need HAPartition.
2) Can use some arbitrary info from the singleton service itself.
My expectation here is any custom impl will be based off the base class, so we're
handling the trivial stuff of storing the partition and singleton service refs. And if
someone makes there own impl not using the base class and can't get that part right,
well ....
Another thing to be aware of: the arg passed to
HASingletonSupport.partitionTopologyChanged is really List newReplicants, where the list
elements are *not* instances of ClusterNode. They are whatever "replicant" was
registered for the service (i.e. an invoker stub, or in this case probably a String).
There needs to be a translation into List. Looks like the way to do this is via
DRM.lookupReplicantsNodeNames(String).
BTW, I downgraded this back to Major as the standard deploy-hasingleton in 4.2 is not
using HASingletonElectionPolicy.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120157#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...