Constructor of Group class is protected

Is there any special reason why the constructor of the Group class is protected? I am working on a group provider class and I need to create Groups from outside of the Group package. Thanks for your help.

Greg

Hi Greg,

You can use the GroupManager to create Groups from outside the Group package:

Group myGroup = GroupManager.getInstance().createGroup(“myGroup”);

/code

Hope that helps,

Ryan

Thanks for the response. It seems like the GroupManager class instantiates a group provider in its constructor. And the createGroup() method uses the provider to actually create the group. So I still need to instantiate a group from within the provider. So I think I still need to access the Group class from my provider class.

Greg

Hi Greg,

Ok, I think I see what you’'re trying to do. Well, since Messenger is open-source you are of course ableto change the visibility of the Group constructor, but a better solution would probably just be to put your custom group provider in the org.jivesoftware.messenger.group package (and of course implement the GroupProvider interface).

Hope that helps,

Ryan

I already changed my version of the Group class.

I’'m trying to implement an ldap group provider, so a logical place for the class to reside is in the ldap package.

The default group provider class which does reside in the Group package should really reside in the database package because it is the database implementation of the group provider interface.

Greg,

Thanks for the bug report. I’'ve filed this as JM-315 and fixed the issue in CVS.

Regards,

Matt