private void createHttp(Protocol p) throws PropertyVetoException { try { if (parser.getLocalName().equals("http") && p != null) { Http h = p.createChild(Http.class); p.setHttp(h); for (int i = 0; i < parser.getAttributeCount(); i++) { String attr = parser.getAttributeLocalName(i); String val = parser.getAttributeValue(i); if (attr.equals("default-virtual-server")) { h.setDefaultVirtualServer(val); } if (attr.equals("encoded-slash-enabled")) { h.setEncodedSlashEnabled(val); } if (attr.equals("max-connections")) { h.setMaxConnections(val); } } createFileCache(h); } } catch (TransactionFailure ex) { logger.log( Level.SEVERE, failureCreatingHttpConfig, ex); } }
public Object run(Protocols param) throws TransactionFailure { final Protocol protocol = param.createChild(Protocol.class); param.getProtocol().add(protocol); protocol.setName(ASADMIN_LISTENER); Http http = protocol.createChild(Http.class); http.setFileCache(http.createChild(FileCache.class)); protocol.setHttp(http); http.setDefaultVirtualServer(ASADMIN_VIRTUAL_SERVER); http.setMaxConnections("250"); return protocol; } }, protocols);
private Http writeableHttpWithFileCacheChild(final Transaction t, final Protocol secAdminListenerProtocol_w) throws TransactionFailure { /* * Because of the calling context, the secAdminListenerProtocol is already * writeable -- it was just created moments ago and has not yet * been committed. */ Http http_w; Http http = secAdminListenerProtocol_w.getHttp(); if (http == null) { http_w = secAdminListenerProtocol_w.createChild(Http.class); secAdminListenerProtocol_w.setHttp(http_w); } else { http_w = t.enroll(http); } http_w.setDefaultVirtualServer(ASADMIN_VIRTUAL_SERVER_NAME); http_w.setEncodedSlashEnabled("true"); final FileCache cache = http_w.createChild(FileCache.class); // cache.setEnabled("false"); http_w.setFileCache(cache); return http_w; }