I'm using Fulcrum's security component to use Hibernate with Turbine 2.3.
Using the dynamic security model, I'm running into an issue. I'm subclassing
the security objects from Fulcrum such as
org.apache.fulcrum.security.model.dynamic.entity.DynamicGroup. I have code
that looks like this:

      Set roles = a_Group.getRolesAsSet();
      Role role = (Role)m_RolesByName.get(k_RoleUser);
      roles.add(role);

I get this exception:

java.lang.RuntimeException: not implemented
        at
org.apache.fulcrum.security.util.SecuritySet.add(SecuritySet.java:257)
        at net.sf.hibernate.collection.Set.add(Set.java:156)
        at com.tagaudit.humpback.Humpback.attachRoles(Humpback.java:424)
        at com.tagaudit.humpback.Humpback.translateUser(Humpback.java:366)
        at com.tagaudit.humpback.Humpback.walkUsers(Humpback.java:316)
        at com.tagaudit.humpback.Humpback.run(Humpback.java:111)
        at com.tagaudit.humpback.Humpback.main(Humpback.java:87)

This appears to be caused be an odd combination of things:

1) The SecuritySet.add(Object) method throws an unimplemented exception,
apparently because it's subclasses have typed add() method that the author
wants to be called instead of the generic add(Object) method.

2) In the code, my roles object is a net.sf.hibernate.collection.Set object.
This object is evidently a proxy wrapped around another Set, in this case an
org.apache.fulcrum.security.util.RoleSet.

3) The RoleSet object has an add(Role) method and is a subclass of
SecuritySet.

4) Hibernate's Set.add method looks like this:

        public boolean add(Object value)
        {
                write();
                return set.add(value);
        }

5) Since the Hibernate add takes an object, when it calls set.add(), it ends
up invoking the add(Object) call of the RoleSet object. Since this object
doesn't have one of those, it invokes the add(Object) method of its
superclass, which throws the unimplemented exception (see item 1 above).

Now, as near as I can tell, this means I'm pretty much hosed. I have to
alter either Fulcrum's set objects, Hibernate's set objects or both to fix
this problem.

Anyone have any advice for solving this?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to