String rsvClaims[] = new String[3];
for (ExtensionConfig config : configs)
{
Extension ext = factory.newInstance(config);
if (ext == null)
{
// Extension not present on this side
continue;
}
// Check RSV
if (ext.isRsv1User() && (rsvClaims[0] != null))
{
LOG.debug("Not adding extension {}. Extension {} already claimed RSV1",config,rsvClaims[0]);
continue;
}
if (ext.isRsv2User() && (rsvClaims[1] != null))
{
LOG.debug("Not adding extension {}. Extension {} already claimed RSV2",config,rsvClaims[1]);
continue;
}
if (ext.isRsv3User() && (rsvClaims[2] != null))
{
LOG.debug("Not adding extension {}. Extension {} already claimed RSV3",config,rsvClaims[2]);
continue;
}
// Add Extension
extensions.add(ext);
addBean(ext);
if (LOG.isDebugEnabled())
LOG.debug("Adding Extension: {}",config);
// Record RSV Claims
if (ext.isRsv1User())
{
rsvClaims[0] = ext.getName();
}
if (ext.isRsv2User())
{
rsvClaims[1] = ext.getName();
}
if (ext.isRsv3User())
{
rsvClaims[2] = ext.getName();
}
}
}