final List<AdminObject> adminObjects = connector.getResourceAdapter().getAdminObject();
for (final Class<?> cls : classes) {
final AdministeredObject administeredObjectAnnotation = cls.getAnnotation(AdministeredObject.class);
final Class[] adminObjectInterfaces = administeredObjectAnnotation.adminObjectInterfaces();
AdminObject adminObject = null;
for (final AdminObject admObj : adminObjects) {
if (admObj.getAdminObjectClass().equals(cls.getName())) {
adminObject = admObj;
}
}
if (adminObject == null) {
for (final Class iface : adminObjectInterfaces) {
final AdminObject newAdminObject = new AdminObject();
newAdminObject.setAdminObjectClass(cls.getName());
newAdminObject.setAdminObjectInterface(iface.getName());
adminObjects.add(newAdminObject);
}
}
}