private WsByteBuffer getWriteContextBuffer ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getWriteContextBuffer" ) ; WsByteBuffer writeBuffer = getSoleWriteContextBuffer ( ) ; if ( firstInvocation . compareAndSet ( true , false ) || ( writeBuffer == null ) ) { final int writeBufferSize = Integer . parseInt ( RuntimeInfo . getProperty ( "com.ibm.ws.sib.jfapchannel.DEFAULT_WRITE_BUFFER_SIZE" , "" + JFapChannelConstants . DEFAULT_WRITE_BUFFER_SIZE ) ) ; if ( ( writeBuffer != null ) && ( ! writeBuffer . isDirect ( ) || writeBuffer . capacity ( ) < writeBufferSize ) ) { writeBuffer . release ( ) ; writeBuffer = null ; } if ( writeBuffer == null ) { writeBuffer = WsByteBufferPool . getInstance ( ) . allocateDirect ( writeBufferSize ) ; // F196678.10 writeCtx . setBuffer ( writeBuffer ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getWriteContextBuffer" , writeBuffer ) ; return writeBuffer ; }
Returns the single WsByteBuffer set in writeCtx ensuring that it is a direct byte buffer and is of sufficient capacity .