Hi Leehui
It appears there was a problem with the Java.net email system as this
email never reached the user mailing list. I don't see it in the
archives either.
The following is certainly a bug. Could you file one in the issue
tracker <
https://shoal.dev.java.net/issues/>?
The behavior of the method should check for whether discovery of group
leader is still in progress and report the leader.
Thanks for helping point this out.
Would you be interested in contributing to Shoal as a unit test
contributor or in any other form? Please do consider doing so by
registering for a developer role and signing the Sun Contributor
Agreement (which basically assigns joint copyright between Sun and the
contributor for their contributions).
https://shoal.dev.java.net/servlets/ProjectMembershipRequest
Thank you
Shreedhar
leehui wrote:
> Hi,
>
> Thank you for reading this letter.
>
> I have a question about shoal. I have posted it to shoal users mail group. But several days past, there was no reply. So I ask you for help.
>
> I wrote a simple class like this:
>
> import com.sun.enterprise.ee.cms.core.GMSException;
> import com.sun.enterprise.ee.cms.core.GMSFactory;
> import com.sun.enterprise.ee.cms.core.GroupManagementService;
>
> public class SimpleTest{
>
> public GroupManagementService gms;
>
> public static void main(String[] args) {
>
> try {
> GroupManagementService gms = (GroupManagementService) GMSFactory.startGMSModule("instance1","DemoGroup", GroupManagementService.MemberType.CORE, null);
> gms.join();
> System.out.println(gms.getGroupHandle().getGroupLeader());
> } catch (GMSException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
> }
>
> The console print:
>
> Exception in thread "main" java.lang.NullPointerException
> at com.sun.enterprise.ee.cms.impl.jxta.GroupCommunicationProviderImpl.getGroupLeader(GroupCommunicationProviderImpl.java:281)
> at com.sun.enterprise.ee.cms.impl.jxta.GroupHandleImpl.getGroupLeader(GroupHandleImpl.java:398)
> at SimpleTest.main(SimpleTest.java:15)
> 2008-4-22 15:14:40 com.sun.enterprise.ee.cms.impl.jxta.ViewWindow getMemberTokens
> 信息: GMS View Change Received for group DemoGroup : Members in view for (before change analysis) are :
> 1: MemberId: instance1, MemberType: CORE, Address: urn:jxta:uuid-289CBAB1836A4A009242B36E1509E49A7987FC1134E54090AB24B0C9E01AD7DF03
>
> 2008-4-22 15:14:40 com.sun.enterprise.ee.cms.impl.jxta.ViewWindow newViewObserved
> 信息: Analyzing new membership snapshot received as part of event : MASTER_CHANGE_EVENT
>
>
> It seems that I can't invoke gms.getGroupHandle().getGroupLeader() at once after gms.join(). But you said,
>
> "The join() call is a blocking call in that it returns only after group join has occurred. So you should be able to call GroupHandle's apis
> without any waiting." (a mail reply from you)
>
> How to handle it? When could I invoke gms.getGroupHandle().getGroupLeader()? If there are some callbacks ?
>
>
> --------------
> leehui
> 2008-04-25
>