docFactory.setNamespaceAware(true);
Element element = docFactory.newDocumentBuilder()
.parse(new ByteArrayInputStream(parsedElement.getBytes())).getDocumentElement();
JettyHTTPServerEngineFactoryConfigType config
= (JettyHTTPServerEngineFactoryConfigType) getJaxbObject(element,
JettyHTTPServerEngineFactoryConfigType.class);
factory = new JettyHTTPServerEngineFactory();
Map<String, ThreadingParameters> threadingParametersMap
= new TreeMap<String, ThreadingParameters>();
if (config.getIdentifiedThreadingParameters() != null) {
for (ThreadingParametersIdentifiedType threads : config.getIdentifiedThreadingParameters()) {
ThreadingParameters rThreads = new ThreadingParameters();
String id = threads.getId();
rThreads.setMaxThreads(threads.getThreadingParameters().getMaxThreads());
rThreads.setMinThreads(threads.getThreadingParameters().getMinThreads());
threadingParametersMap.put(id, rThreads);
}
factory.setThreadingParametersMap(threadingParametersMap);
}
//SSL
Map<String, TLSServerParameters> sslMap = new TreeMap<String, TLSServerParameters>();
if (config.getIdentifiedTLSServerParameters() != null) {
for (TLSServerParametersIdentifiedType t : config.getIdentifiedTLSServerParameters()) {
try {
TLSServerParameters parameter
= new TLSServerParametersConfig(t.getTlsServerParameters());
sslMap.put(t.getId(), parameter);
} catch (Exception e) {
throw new RuntimeException("Could not configure TLS for id " + t.getId(), e);
}
}
factory.setTlsServerParametersMap(sslMap);
}
//Engines
List<JettyHTTPServerEngine> engineList = new ArrayList<JettyHTTPServerEngine>();
for (JettyHTTPServerEngineConfigType engine : config.getEngine()) {
JettyHTTPServerEngine eng = new JettyHTTPServerEngine();
if (engine.getConnector() != null && connectorMap != null) {
// we need to setup the Connector from the connectorMap
Connector connector = connectorMap.get(engine.getPort().toString());
if (connector != null) {