public Context setEngine ( Engine engine ) { checkThread ( ) ; if ( engine != null ) { if ( template != null && template . getEngine ( ) != engine ) { throw new IllegalStateException ( "Failed to set the context engine, because is not the same to template engine. template engine: " + template . getEngine ( ) . getName ( ) + ", context engine: " + engine . getName ( ) + ", template: " + template . getName ( ) + ", context: " + thread . getName ( ) ) ; } if ( parent != null && parent . getEngine ( ) != engine ) { parent . setEngine ( engine ) ; } if ( this . engine == null ) { setCurrent ( engine . createContext ( parent , current ) ) ; } } this . engine = engine ; return this ; }
Set the current engine .