private boolean applyRemoteDomainModel ( final List < ModelNode > bootOperations , final HostInfo hostInfo ) { try { HostControllerLogger . ROOT_LOGGER . debug ( "Applying domain level boot operations provided by master" ) ; SyncModelParameters parameters = new SyncModelParameters ( domainController , ignoredDomainResourceRegistry , hostControllerEnvironment , extensionRegistry , operationExecutor , true , serverProxies , remoteFileRepository , contentRepository ) ; final SyncDomainModelOperationHandler handler = new SyncDomainModelOperationHandler ( hostInfo , parameters ) ; final ModelNode operation = APPLY_DOMAIN_MODEL . clone ( ) ; operation . get ( DOMAIN_MODEL ) . set ( bootOperations ) ; final ModelNode result = operationExecutor . execute ( OperationBuilder . create ( operation ) . build ( ) , OperationMessageHandler . DISCARD , ModelController . OperationTransactionControl . COMMIT , handler ) ; final String outcome = result . get ( OUTCOME ) . asString ( ) ; final boolean success = SUCCESS . equals ( outcome ) ; // check if anything we synced triggered reload-required or restart-required. // if they did we log a warning on the synced slave. if ( result . has ( RESPONSE_HEADERS ) ) { final ModelNode headers = result . get ( RESPONSE_HEADERS ) ; if ( headers . hasDefined ( OPERATION_REQUIRES_RELOAD ) && headers . get ( OPERATION_REQUIRES_RELOAD ) . asBoolean ( ) ) { HostControllerLogger . ROOT_LOGGER . domainModelAppliedButReloadIsRequired ( ) ; } if ( headers . hasDefined ( OPERATION_REQUIRES_RESTART ) && headers . get ( OPERATION_REQUIRES_RESTART ) . asBoolean ( ) ) { HostControllerLogger . ROOT_LOGGER . domainModelAppliedButRestartIsRequired ( ) ; } } if ( ! success ) { ModelNode failureDesc = result . hasDefined ( FAILURE_DESCRIPTION ) ? result . get ( FAILURE_DESCRIPTION ) : new ModelNode ( ) ; HostControllerLogger . ROOT_LOGGER . failedToApplyDomainConfig ( outcome , failureDesc ) ; return false ; } else { return true ; } } catch ( Exception e ) { HostControllerLogger . ROOT_LOGGER . failedToApplyDomainConfig ( e ) ; return false ; } }
Apply the remote domain model to the local host controller .