From: <bst...@jb...> - 2006-06-03 15:14:06
|
I was thingking the policy has access to the HAPartition and DRM and knows the service name, so it can find out who the nodes are. So, reduce the coupling between the singleton and the policy by not making the singleton responsible for providing the topology. But, the singleton is going to ask the policy who's been elected because it got a notification of a topology change, so it makes sense to pass the topology. If the singleton provides the topology, then I'd say: Address pickSingleton(List nodes) List because order is important to most policies. I like getting Address back instead of boolean -- that way the singleton knows who the master is. I'd keep a boolean version as well though, as a convenience, i.e. public boolean isElectedSingleton(List node) { return pickSingleton(nodes).equals(partition.getLocalAddress()); } View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3948889#3948889 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3948889 |