"mohitanchlia" wrote :
| 1. Take a scenario where there are 4 nodes A,B,C,D but only 2 nodes have come up so
far. What happens to HASingletonController_3 if only first 2 nodes are running. If I
understand correctly it will do a mod of (3 % 2). Which means that HASingletonController_3
will be started on node B. Now what happens if Node 3 comes up and eventually Node 4.
Would the master change everytime a Node joins a cluster?
Yes. This is clearly a disadvantage to using a negative number for the position.
With your A, B, C, D example, if you had a value of 3, the master would change 4 times as
well, but then would stabilize if you added more nodes.
Basically, any value other than 0 would be more prone to having the master change than 0
is. 0 only changes if the first node running stops.
anonymous wrote : 2. In scenario where all nodes are running, is it correct to say that
HASingletonController will be in "start" state in only one of the nodes and all
other nodes it will be either created/stopped.
No, the HASingletonController comes into start state on all nodes during normal startup.
It's a special service that manages a target mbean, e.g. HASingletonMBeanExample_1. It
itself is not meant to be a singleton.
anonymous wrote : 3. Why does HASingletonController depends on HASingletonMBeanExample_1,
shouldn't it be other way round? I thought HASingletonController is responsible for
starting/stopping the MBean.
HASingletonMBeanExample_1 is brought to the start state when it's deployed, just like
any other mbean. What a service that's controlled by an HASingletonController does is
conceptually add a couple new lifecycle stagess that come between "started" and
"stopped". Call them "singletonStarted" and
"singletonStopped". The service exposes 2 no-arg or single-arg methods that the
HASingletonController can call to bring the service to the "singletonStarted"
and "singletonStopped" states. Those methods can be named whatever you like; you
tell the HASingletonController their names (and optionally a single param):
| <attribute
name="TargetStartMethod">startSingleton</attribute>
| <attribute
name="TargetStopMethod">stopSingleton</attribute>
| <attribute
name="TargetStopMethodArgument">true</attribute>
|
See
http://www.jboss.org/file-access/default/members/jbossas/freezone[/url]/d...
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4188283#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...