{
if (!AMXConfigProxy.class.isAssignableFrom(proxy.extra().genericInterface()))
{
return;
}
final AMXConfigProxy config = proxy.as(AMXConfigProxy.class);
// All AMXConfig must be descendants of Domain
if ( ! config.type().equals( "domain" ) ) // hard-coded type, we can't import Domain.class here
{
// verify that all its ancestors are also AMXConfig
// Do a quick check, ultimately if all AMXConfig have an AMXConfig as a parent,
// then they all have DomainConfig as a parent.
if ( ! AMXConfigProxy.class.isAssignableFrom(config.parent().extra().genericInterface() ) )
{
problems.add("AMXConfig MBean is not a descendant of Domain: " + config.objectName() + ", it has parent " + config.getParent() );
}
}
// check default values support
final Map<String, String> defaultValues = config.getDefaultValues(false);
final Map<String, String> defaultValuesAMX = config.getDefaultValues(true);
if (defaultValues.keySet().size() != defaultValuesAMX.keySet().size())
{
problems.add("Default values for AMX names differ in number from XML names: " + defaultValues.keySet().size() + " != " + defaultValuesAMX.keySet().size());
}
for (final String key : defaultValues.keySet())
{
final Object value = defaultValues.get(key);
if (value == null)
{
problems.add("Default value of null for: " + key);
}
else if (!(value instanceof String))
{
problems.add("Default value is not a String for: " + key);
}
}
final String[] subTypes = config.extra().subTypes();
if (subTypes != null)
{
for (final String subType : subTypes)
{
final Map<String, String> subTypeDefaults = config.getDefaultValues(subType, false);
}
}
}