Menu

#98 Xbean, Collection and PasswordManagementServiceImpl

open
nobody
5
2009-02-22
2009-02-22
No

The xbean doesn't support Collection type as list, and this cause problem if you want to use more that one process in josso-gateway-selfservices.xml.
Only the first one is added
I fixed it by using List instead of Collection as for get/set PrototypeProcesses

<def-pwdmgr:password-manager id="josso-password-manager">
<def-pwdmgr:processes>
<one_process>
............
</one_process>
<another_process>
...........
</another_process>
</def-pwdmgr:processes>
</def-pwdmgr:password-manager>

public Collection<PasswordManagementProcess> getPrototypeProcesses() {
return prototypeProcesses.values();
}

/**
* @org.apache.xbean.Property alias="processes" nestedType="org.josso.selfservices.passwdmanagement.PasswordManagementProcess"
*
* @param prototypeProcesses
*/
public void setPrototypeProcesses(Collection<PasswordManagementProcess> prototypeProcesses) {
for (PasswordManagementProcess prototype : prototypeProcesses) {
this.prototypeProcesses.put(prototype.getName(), prototype);
}
}

Discussion