private void createAdminServiceProperty(AdminService as) throws PropertyVetoException { while (true) { try { if (parser.next() == START_ELEMENT) { if (parser.getLocalName().equals("property")) { Property p = as.createChild(Property.class); as.getProperty().add(p); createProperty(p); break; } } } catch (TransactionFailure ex) { logger.log( Level.SEVERE, failedToCreateAdminService, ex); } catch (XMLStreamException ex) { logger.log( Level.SEVERE, problemParsingAdminService, ex); } } }
private void createAdminServiceProperty(AdminService as) throws PropertyVetoException { while (true) { try { if (parser.next() == START_ELEMENT) { if (parser.getLocalName().equals("property")) { Property p = as.createChild(Property.class); as.getProperty().add(p); createProperty(p); break; } } } catch (TransactionFailure ex) { Logger.getLogger(DefaultConfigUpgrade.class.getName()).log( Level.SEVERE, "Failed to create AdminService Property config object", ex); } catch (XMLStreamException ex) { Logger.getLogger(DefaultConfigUpgrade.class.getName()).log( Level.SEVERE, "Problem parsing asadmin-service property element in domain.xml template", ex); } } }
@Override public Object run(AdminService adminService) throws PropertyVetoException, TransactionFailure { Property newProp = adminService.createChild(Property.class); adminService.getProperty().add(newProp); newProp.setName(propName); newProp.setValue(propValue); return newProp; } }, adminService);
public Object run(Config config) throws PropertyVetoException, TransactionFailure { AdminService adminService = config.createChild(AdminService.class); config.setAdminService(adminService); //dasConfig cannot be null. Add a dummy. DasConfig dc = adminService.createChild(DasConfig.class); adminService.setDasConfig(dc); for (int i = 0; i < parser.getAttributeCount(); i++) { String attr = parser.getAttributeLocalName(i); String val = parser.getAttributeValue(i); if (attr.equals("system-jmx-connector-name")) { adminService.setSystemJmxConnectorName(val); } if (attr.equals("type")) { adminService.setType(val); } } createJmxConnector(adminService); createAdminServiceProperty(adminService); return null; } }
public Object run(Config config) throws PropertyVetoException, TransactionFailure { AdminService adminService = config.createChild(AdminService.class); config.setAdminService(adminService); //dasConfig cannot be null. Add a dummy. DasConfig dc = adminService.createChild(DasConfig.class); adminService.setDasConfig(dc); for (int i = 0; i < parser.getAttributeCount(); i++) { String attr = parser.getAttributeLocalName(i); String val = parser.getAttributeValue(i); if (attr.equals("system-jmx-connector-name")) { adminService.setSystemJmxConnectorName(val); } if (attr.equals("type")) { adminService.setType(val); } } createAdminServiceProperty(adminService); return null; } }
if (parser.next() == START_ELEMENT) { if (parser.getLocalName().equals("jmx-connector")) { JmxConnector jc = as.createChild(JmxConnector.class); as.getJmxConnector().add(jc); for (int i = 0; i < parser.getAttributeCount(); i++) {