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());