final void reallySetLogWriter ( final PrintWriter out ) throws ResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "setting the logWriter to:" , out ) ; if ( dataSourceOrDriver != null ) { try { AccessController . doPrivileged ( new PrivilegedExceptionAction < Void > ( ) { public Void run ( ) throws SQLException { if ( ! Driver . class . equals ( type ) ) { ( ( CommonDataSource ) dataSourceOrDriver ) . setLogWriter ( out ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Unable to set logwriter on Driver type" ) ; } return null ; } } ) ; } catch ( PrivilegedActionException pae ) { SQLException se = ( SQLException ) pae . getCause ( ) ; FFDCFilter . processException ( se , getClass ( ) . getName ( ) , "593" , this ) ; throw AdapterUtil . translateSQLException ( se , this , false , getClass ( ) ) ; } } logWriter = out ; // Keep the value only if successful on the DataSource. }
This method is to be used by RRA code to set logwriter when needed