private void createVirtualServer(HttpService hs) throws PropertyVetoException { try { while (!(parser.getEventType() == END_ELEMENT && parser.getLocalName().equals("http-service"))) { if (parser.next() == START_ELEMENT) { if (parser.getLocalName().equals("virtual-server")) { VirtualServer vs = hs.createChild(VirtualServer.class); hs.getVirtualServer().add(vs); for (int i = 0; i < parser.getAttributeCount(); i++) { String attr = parser.getAttributeLocalName(i); if (attr.equals("id")) { vs.setId(parser.getAttributeValue(i)); } if (attr.equals("network-listeners")) { vs.setNetworkListeners(parser.getAttributeValue(i)); } } createVirtualServerProperty(vs); } } } } catch (TransactionFailure ex) { Logger.getLogger(DefaultConfigUpgrade.class.getName()).log( Level.SEVERE, "Failed to create HttpService VirtualService config object", ex); } catch (XMLStreamException ex) { Logger.getLogger(DefaultConfigUpgrade.class.getName()).log( Level.SEVERE, "Problem parsing http-service virtual-server in domain.xml template", ex); } }
private void createVirtualServer(HttpService hs) throws PropertyVetoException { try { while (!(parser.getEventType() == END_ELEMENT && parser.getLocalName().equals("http-service"))) { if (parser.next() == START_ELEMENT) { if (parser.getLocalName().equals("virtual-server")) { VirtualServer vs = hs.createChild(VirtualServer.class); hs.getVirtualServer().add(vs); for (int i = 0; i < parser.getAttributeCount(); i++) { String attr = parser.getAttributeLocalName(i); if (attr.equals("id")) { vs.setId(parser.getAttributeValue(i)); } if (attr.equals("network-listeners")) { vs.setNetworkListeners(parser.getAttributeValue(i)); } } createVirtualServerProperty(vs); } } } } catch (TransactionFailure ex) { logger.log( Level.SEVERE, failureCreatingHttpServiceVS, ex); } catch (XMLStreamException ex) { logger.log( Level.SEVERE, problemParsingHttpServiceVs, ex); } }
@Override public Object run(Config param) throws PropertyVetoException, TransactionFailure { HttpService httpService = param.createChild(HttpService.class); AccessLog accessLog = httpService.createChild(AccessLog.class); List<VirtualServer> vsList = httpService.getVirtualServer(); httpService.setAccessLog(accessLog); VirtualServer vs = httpService.createChild(VirtualServer.class); vs.setId("server"); vs.setNetworkListeners("http-listener-1,http-listener-2"); VirtualServer vs1 = httpService.createChild(VirtualServer.class); vs1.setId("__asadmin"); vs1.setNetworkListeners("admin-listener"); vsList.add(vs); vsList.add(vs1); param.getContainers().add(httpService); return httpService; } }, param);
public Object run(Config config) throws PropertyVetoException, TransactionFailure { HttpService httpService = config.createChild(HttpService.class); config.setHttpService(httpService); AccessLog al = httpService.createChild(AccessLog.class); httpService.setAccessLog(al); createVirtualServer(httpService); return config; } }
public Object run(Config config) throws PropertyVetoException, TransactionFailure { HttpService httpService = config.createChild(HttpService.class); config.setHttpService(httpService); AccessLog al = httpService.createChild(AccessLog.class); httpService.setAccessLog(al); createVirtualServer(httpService); return config; } }
private VirtualServer createAdminVirtualServer( final Transaction t, final Config config_w) throws TransactionFailure, PropertyVetoException { final HttpService hs_w = t.enroll(config_w.getHttpService()); final VirtualServer vs_w = hs_w.createChild(VirtualServer.class); hs_w.getVirtualServer().add(vs_w); vs_w.setId(ASADMIN_VS_NAME); vs_w.setNetworkListeners(ADMIN_LISTENER_NAME); return vs_w; }
private VirtualServer createAdminVirtualServer( final Transaction t, final Config config_w) throws TransactionFailure, PropertyVetoException { final HttpService hs_w = t.enroll(config_w.getHttpService()); final VirtualServer vs_w = hs_w.createChild(VirtualServer.class); hs_w.getVirtualServer().add(vs_w); vs_w.setId(ASADMIN_VS_NAME); vs_w.setNetworkListeners(ADMIN_LISTENER_NAME); return vs_w; }