// Configure the core configuration.
String socketBindingName = null;
final CoreEnvironmentService coreEnvironmentService = new CoreEnvironmentService(nodeIdentifier, varDirPath);
if (processId.hasDefined(ProcessIdType.UUID.getName())) {
// Use the UUID based id
UuidProcessId id = new UuidProcessId();
coreEnvironmentService.setProcessImplementation(id);
} else if (processId.hasDefined(ProcessIdType.SOCKET.getName())) {
// Use the socket process id
coreEnvironmentService.setProcessImplementationClassName(ProcessIdType.SOCKET.getClazz());
ModelNode socket = processId.get(ProcessIdType.SOCKET.getName());
socketBindingName = socket.require(BINDING).asString();
if (socket.hasDefined(SOCKET_PROCESS_ID_MAX_PORTS)) {
int ports = socket.get(SOCKET_PROCESS_ID_MAX_PORTS).asInt(maxPorts);
coreEnvironmentService.setSocketProcessIdMaxPorts(ports);
}
} else {
// Default to UUID implementation
UuidProcessId id = new UuidProcessId();
coreEnvironmentService.setProcessImplementation(id);
}
ServiceBuilder<?> coreEnvBuilder = target.addService(TxnServices.JBOSS_TXN_CORE_ENVIRONMENT, coreEnvironmentService);
if (socketBindingName != null) {
// Add a dependency on the socket id binding