//
// first we need a map of the published admin objects by interface type
Map adminObjectInterfaceMap = new HashMap();
for (int i = 0; i < resourceadapter.getAdminobjectArray().length; i++) {
AdminobjectType adminobject = resourceadapter.getAdminobjectArray()[i];
adminObjectInterfaceMap.put(adminobject.getAdminobjectInterface().getStringValue(), adminobject);
}
// add configured admin objects
for (int i = 0; i < geronimoConnector.getAdminobjectArray().length; i++) {
GerAdminobjectType gerAdminObject = geronimoConnector.getAdminobjectArray()[i];
String adminObjectInterface = gerAdminObject.getAdminobjectInterface().getStringValue();
AdminobjectType adminObject = (AdminobjectType) adminObjectInterfaceMap.get(adminObjectInterface);
if (adminObject == null) {
throw new DeploymentException("No admin object declared for interface: " + adminObjectInterface);
}
for (int j = 0; j < gerAdminObject.getAdminobjectInstanceArray().length; j++) {
GerAdminobjectInstanceType gerAdminObjectInstance = gerAdminObject.getAdminobjectInstanceArray()[j];
// create the adminObjectGBean
GBeanInfoBuilder adminObjectInfoFactory = new GBeanInfoBuilder("org.apache.geronimo.connector.AdminObjectWrapper", cl);
ConfigProperty[] configProperties = getConfigProperties(adminObject.getConfigPropertyArray(), gerAdminObjectInstance.getConfigPropertySettingArray());
GBeanMBean adminObjectGBean = setUpDynamicGBean(adminObjectInfoFactory, configProperties, cl);
// set the standard properties
try {
adminObjectGBean.setAttribute("adminObjectInterface", cl.loadClass(adminObjectInterface));
adminObjectGBean.setAttribute("adminObjectClass", cl.loadClass(adminObject.getAdminobjectClass().getStringValue()));
} catch (Exception e) {
throw new DeploymentException("Could not initialize AdminObject", e);
}
// add it