this.processManagerClient = processManagerClient;
this.managementSocket = managementSocket;
ServerFactory.combine(domainModel, hostModel, serverName, updateList);
ServerElement server = hostModel.getServer(serverName);
if (server == null)
throw new IllegalStateException("Server " + serverName + " is not listed in Host");
String serverGroupName = server.getServerGroup();
ServerGroupElement serverGroup = domainModel.getServerGroup(serverGroupName);
if (serverGroup == null)
throw new IllegalStateException("Server group" + serverGroupName + " is not listed in Domain");
this.portOffset = server.getSocketBindingGroupName() == null ? serverGroup.getSocketBindingPortOffset() : server.getSocketBindingPortOffset();
JvmElement serverVM = server.getJvm();
String serverVMName = serverVM != null ? serverVM.getName() : null;
JvmElement groupVM = serverGroup.getJvm();
String groupVMName = groupVM != null ? groupVM.getName() : null;
String ourVMName = serverVMName != null ? serverVMName : groupVMName;
if (ourVMName == null) {
throw new IllegalStateException("Neither " + Element.SERVER_GROUP.getLocalName() +
" nor " + Element.SERVER.getLocalName() + " has declared a JVM configuration; one or the other must");
}
if (!ourVMName.equals(groupVMName)) {
// the server setting replaced the group, so ignore group
groupVM = null;
}
JvmElement hostVM = hostModel.getJvm(ourVMName);
jvmElement = new JvmElement(groupVM, hostVM, serverVM);
Map<String, String> properties = new HashMap<String, String>();
properties.putAll(domainModel.getSystemProperties().getProperties());
properties.putAll(serverGroup.getSystemProperties().getProperties());
properties.putAll(hostModel.getSystemProperties().getProperties());
properties.putAll(server.getSystemProperties().getProperties());
// TODO remove system properties from JvmElement
properties.putAll(jvmElement.getSystemProperties().getProperties());
addStandardProperties(properties);
this.systemProperties = properties;