private void localChangeEnd ( IManagedContext < ? > managedContext , boolean silent , boolean deferCommit , ISurveyCallback callback ) throws ContextException { if ( pendingStack . isEmpty ( ) || pendingStack . peek ( ) != managedContext ) { throw new ContextException ( "Illegal context change nesting." ) ; } if ( ! managedContext . isPending ( ) ) { pendingStack . pop ( ) ; return ; } commitStack . push ( managedContext ) ; managedContext . surveySubscribers ( silent , response -> { boolean accept = ! response . rejected ( ) ; if ( ! accept && log . isDebugEnabled ( ) ) { log . debug ( "Survey of managed context " + managedContext . getContextName ( ) + " returned '" + response + "'." ) ; } pendingStack . remove ( managedContext ) ; if ( ! deferCommit && ( ! accept || pendingStack . isEmpty ( ) ) ) { commitContexts ( accept , accept ) ; } execCallback ( callback , response ) ; } ) ; }
Commits a pending context change .