Well, I just figured out without initializing the TribesClusteringAgent,
Agent can be obtained it as follows, and it is working as expected.

      TribesClusteringAgent agent  = (TribesClusteringAgent)
configCtx.getAxisConfiguration().getClusteringAgent();

But then, I had to set the agent's configuration context explicitly..

     agent.setConfigurationContext(configCtx);

But I have a doubt, whether is it a best practice to set the same configCtx
which was used to get the Agent ?


On Thu, Aug 2, 2012 at 2:34 PM, Sajith Kariyawasam <[email protected]> wrote:

> Hi all,
>
> I'm writing a sample program to get two or more members in a cluster join
> each other, using "wka" scheme.
>
> I tried following,
>
> First I created a ConfigurationContext ,
>
>       ConfigurationContext configCtx =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem("/home/wso2/Downloads/axis2-1.6.1/repository",
> "/home/wso2/Downloads/axis2-1.6.1/conf/axis2.xml");
>
> Then Initialized a TribesClusteringAgent and set the configuration defined
> above,
>
>        TribesClusteringAgent tribesClusterAgent = new
> TribesClusteringAgent();
>         tribesClusterAgent.setConfigurationContext(configCtx);
>
> Further, set NodeManager and StateManager as follows,
>
>         DefaultNodeManager configurationManager = new DefaultNodeManager();
>         tribesClusterAgent.setNodeManager(configurationManager);
>
>         DefaultStateManager contextManager = new DefaultStateManager();
>         tribesClusterAgent.setStateManager(contextManager);
>
> Then,
>         tribesClusterAgent.init();
>
> In the axis2.xml file I have passed into the configuration above,
> membershipScheme is set as "wka".
> But when the tribesClusterAgent is started up it logs ,
>  "org.apache.axis2.clustering.tribes.TribesClusteringAgent  - Using
> multicast based membership management scheme" , so it seems that the
> membership scheme is not properly set.
>
> After going through the code I found that when the configuration context
> of tribesClusterAgent is set, the parameters map of the tribesClusterAgent
> are not properly getting populated.
> Are those parameters map is expected to be populated separately?
>
> --
> Regards,
> *
> *
> *Sajith Kariyawasam*
> *Senior Software Engineer; WSO2, Inc.; http://wso2.com*
>
>


-- 
Regards,
*
*
*Sajith Kariyawasam*
*Senior Software Engineer; WSO2, Inc.; http://wso2.com*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to