com.sun.corba.se.pept.transport.ByteBufferPool Java Examples
The following examples show how to use
com.sun.corba.se.pept.transport.ByteBufferPool.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ByteBufferWithInfo.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public ByteBufferWithInfo(org.omg.CORBA.ORB orb, BufferManagerWrite bufferManager, boolean usePooledByteBuffers) { this.orb = (com.sun.corba.se.spi.orb.ORB)orb; debug = this.orb.transportDebugFlag; int bufferSize = bufferManager.getBufferSize(); if (usePooledByteBuffers) { ByteBufferPool byteBufferPool = this.orb.getByteBufferPool(); this.byteBuffer = byteBufferPool.getByteBuffer(bufferSize); if (debug) { // print address of ByteBuffer gotten from pool int bbAddress = System.identityHashCode(byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("constructor (ORB, BufferManagerWrite) - got ") .append("ByteBuffer id (").append(bbAddress) .append(") from ByteBufferPool."); String msgStr = sb.toString(); dprint(msgStr); } } else { // don't allocate from pool, allocate non-direct ByteBuffer this.byteBuffer = ByteBuffer.allocate(bufferSize); } position(0); this.buflen = bufferSize; this.byteBuffer.limit(this.buflen); this.needed = 0; this.fragmented = false; }
Example #2
Source File: ByteBufferWithInfo.java From JDKSourceCode1.8 with MIT License | 5 votes |
public ByteBufferWithInfo(org.omg.CORBA.ORB orb, BufferManagerWrite bufferManager, boolean usePooledByteBuffers) { this.orb = (com.sun.corba.se.spi.orb.ORB)orb; debug = this.orb.transportDebugFlag; int bufferSize = bufferManager.getBufferSize(); if (usePooledByteBuffers) { ByteBufferPool byteBufferPool = this.orb.getByteBufferPool(); this.byteBuffer = byteBufferPool.getByteBuffer(bufferSize); if (debug) { // print address of ByteBuffer gotten from pool int bbAddress = System.identityHashCode(byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("constructor (ORB, BufferManagerWrite) - got ") .append("ByteBuffer id (").append(bbAddress) .append(") from ByteBufferPool."); String msgStr = sb.toString(); dprint(msgStr); } } else { // don't allocate from pool, allocate non-direct ByteBuffer this.byteBuffer = ByteBuffer.allocate(bufferSize); } position(0); this.buflen = bufferSize; this.byteBuffer.limit(this.buflen); this.needed = 0; this.fragmented = false; }
Example #3
Source File: BufferManagerWriteCollect.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Close the BufferManagerWrite - do any outstanding cleanup. * * For a BufferManagerWriteGrow any queued ByteBufferWithInfo must * have its ByteBuffer released to the ByteBufferPool. */ public void close() { // iterate thru queue and release any ByteBufferWithInfo's // ByteBuffer that may be remaining on the queue to the // ByteBufferPool. Iterator bufs = iterator(); ByteBufferPool byteBufferPool = orb.getByteBufferPool(); while (bufs.hasNext()) { ByteBufferWithInfo bbwi = (ByteBufferWithInfo)bufs.next(); if (bbwi != null && bbwi.byteBuffer != null) { if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("close() - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } } }
Example #4
Source File: BufferManagerWriteCollect.java From JDKSourceCode1.8 with MIT License | 5 votes |
/** * Close the BufferManagerWrite - do any outstanding cleanup. * * For a BufferManagerWriteGrow any queued ByteBufferWithInfo must * have its ByteBuffer released to the ByteBufferPool. */ public void close() { // iterate thru queue and release any ByteBufferWithInfo's // ByteBuffer that may be remaining on the queue to the // ByteBufferPool. Iterator bufs = iterator(); ByteBufferPool byteBufferPool = orb.getByteBufferPool(); while (bufs.hasNext()) { ByteBufferWithInfo bbwi = (ByteBufferWithInfo)bufs.next(); if (bbwi != null && bbwi.byteBuffer != null) { if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("close() - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } } }
Example #5
Source File: ByteBufferWithInfo.java From hottub with GNU General Public License v2.0 | 5 votes |
public ByteBufferWithInfo(org.omg.CORBA.ORB orb, BufferManagerWrite bufferManager, boolean usePooledByteBuffers) { this.orb = (com.sun.corba.se.spi.orb.ORB)orb; debug = this.orb.transportDebugFlag; int bufferSize = bufferManager.getBufferSize(); if (usePooledByteBuffers) { ByteBufferPool byteBufferPool = this.orb.getByteBufferPool(); this.byteBuffer = byteBufferPool.getByteBuffer(bufferSize); if (debug) { // print address of ByteBuffer gotten from pool int bbAddress = System.identityHashCode(byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("constructor (ORB, BufferManagerWrite) - got ") .append("ByteBuffer id (").append(bbAddress) .append(") from ByteBufferPool."); String msgStr = sb.toString(); dprint(msgStr); } } else { // don't allocate from pool, allocate non-direct ByteBuffer this.byteBuffer = ByteBuffer.allocate(bufferSize); } position(0); this.buflen = bufferSize; this.byteBuffer.limit(this.buflen); this.needed = 0; this.fragmented = false; }
Example #6
Source File: BufferManagerWriteCollect.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Close the BufferManagerWrite - do any outstanding cleanup. * * For a BufferManagerWriteGrow any queued ByteBufferWithInfo must * have its ByteBuffer released to the ByteBufferPool. */ public void close() { // iterate thru queue and release any ByteBufferWithInfo's // ByteBuffer that may be remaining on the queue to the // ByteBufferPool. Iterator bufs = iterator(); ByteBufferPool byteBufferPool = orb.getByteBufferPool(); while (bufs.hasNext()) { ByteBufferWithInfo bbwi = (ByteBufferWithInfo)bufs.next(); if (bbwi != null && bbwi.byteBuffer != null) { if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("close() - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } } }
Example #7
Source File: BufferManagerWriteCollect.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Close the BufferManagerWrite - do any outstanding cleanup. * * For a BufferManagerWriteGrow any queued ByteBufferWithInfo must * have its ByteBuffer released to the ByteBufferPool. */ public void close() { // iterate thru queue and release any ByteBufferWithInfo's // ByteBuffer that may be remaining on the queue to the // ByteBufferPool. Iterator bufs = iterator(); ByteBufferPool byteBufferPool = orb.getByteBufferPool(); while (bufs.hasNext()) { ByteBufferWithInfo bbwi = (ByteBufferWithInfo)bufs.next(); if (bbwi != null && bbwi.byteBuffer != null) { if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("close() - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } } }
Example #8
Source File: BufferManagerWriteCollect.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Close the BufferManagerWrite - do any outstanding cleanup. * * For a BufferManagerWriteGrow any queued ByteBufferWithInfo must * have its ByteBuffer released to the ByteBufferPool. */ public void close() { // iterate thru queue and release any ByteBufferWithInfo's // ByteBuffer that may be remaining on the queue to the // ByteBufferPool. Iterator bufs = iterator(); ByteBufferPool byteBufferPool = orb.getByteBufferPool(); while (bufs.hasNext()) { ByteBufferWithInfo bbwi = (ByteBufferWithInfo)bufs.next(); if (bbwi != null && bbwi.byteBuffer != null) { if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("close() - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } } }
Example #9
Source File: BufferManagerWriteCollect.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Close the BufferManagerWrite - do any outstanding cleanup. * * For a BufferManagerWriteGrow any queued ByteBufferWithInfo must * have its ByteBuffer released to the ByteBufferPool. */ public void close() { // iterate thru queue and release any ByteBufferWithInfo's // ByteBuffer that may be remaining on the queue to the // ByteBufferPool. Iterator bufs = iterator(); ByteBufferPool byteBufferPool = orb.getByteBufferPool(); while (bufs.hasNext()) { ByteBufferWithInfo bbwi = (ByteBufferWithInfo)bufs.next(); if (bbwi != null && bbwi.byteBuffer != null) { if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("close() - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } } }
Example #10
Source File: ByteBufferWithInfo.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public ByteBufferWithInfo(org.omg.CORBA.ORB orb, BufferManagerWrite bufferManager, boolean usePooledByteBuffers) { this.orb = (com.sun.corba.se.spi.orb.ORB)orb; debug = this.orb.transportDebugFlag; int bufferSize = bufferManager.getBufferSize(); if (usePooledByteBuffers) { ByteBufferPool byteBufferPool = this.orb.getByteBufferPool(); this.byteBuffer = byteBufferPool.getByteBuffer(bufferSize); if (debug) { // print address of ByteBuffer gotten from pool int bbAddress = System.identityHashCode(byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("constructor (ORB, BufferManagerWrite) - got ") .append("ByteBuffer id (").append(bbAddress) .append(") from ByteBufferPool."); String msgStr = sb.toString(); dprint(msgStr); } } else { // don't allocate from pool, allocate non-direct ByteBuffer this.byteBuffer = ByteBuffer.allocate(bufferSize); } position(0); this.buflen = bufferSize; this.byteBuffer.limit(this.buflen); this.needed = 0; this.fragmented = false; }
Example #11
Source File: BufferManagerWriteCollect.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Close the BufferManagerWrite - do any outstanding cleanup. * * For a BufferManagerWriteGrow any queued ByteBufferWithInfo must * have its ByteBuffer released to the ByteBufferPool. */ public void close() { // iterate thru queue and release any ByteBufferWithInfo's // ByteBuffer that may be remaining on the queue to the // ByteBufferPool. Iterator bufs = iterator(); ByteBufferPool byteBufferPool = orb.getByteBufferPool(); while (bufs.hasNext()) { ByteBufferWithInfo bbwi = (ByteBufferWithInfo)bufs.next(); if (bbwi != null && bbwi.byteBuffer != null) { if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("close() - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } } }
Example #12
Source File: ByteBufferWithInfo.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public ByteBufferWithInfo(org.omg.CORBA.ORB orb, BufferManagerWrite bufferManager, boolean usePooledByteBuffers) { this.orb = (com.sun.corba.se.spi.orb.ORB)orb; debug = this.orb.transportDebugFlag; int bufferSize = bufferManager.getBufferSize(); if (usePooledByteBuffers) { ByteBufferPool byteBufferPool = this.orb.getByteBufferPool(); this.byteBuffer = byteBufferPool.getByteBuffer(bufferSize); if (debug) { // print address of ByteBuffer gotten from pool int bbAddress = System.identityHashCode(byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("constructor (ORB, BufferManagerWrite) - got ") .append("ByteBuffer id (").append(bbAddress) .append(") from ByteBufferPool."); String msgStr = sb.toString(); dprint(msgStr); } } else { // don't allocate from pool, allocate non-direct ByteBuffer this.byteBuffer = ByteBuffer.allocate(bufferSize); } position(0); this.buflen = bufferSize; this.byteBuffer.limit(this.buflen); this.needed = 0; this.fragmented = false; }
Example #13
Source File: ByteBufferWithInfo.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public ByteBufferWithInfo(org.omg.CORBA.ORB orb, BufferManagerWrite bufferManager, boolean usePooledByteBuffers) { this.orb = (com.sun.corba.se.spi.orb.ORB)orb; debug = this.orb.transportDebugFlag; int bufferSize = bufferManager.getBufferSize(); if (usePooledByteBuffers) { ByteBufferPool byteBufferPool = this.orb.getByteBufferPool(); this.byteBuffer = byteBufferPool.getByteBuffer(bufferSize); if (debug) { // print address of ByteBuffer gotten from pool int bbAddress = System.identityHashCode(byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("constructor (ORB, BufferManagerWrite) - got ") .append("ByteBuffer id (").append(bbAddress) .append(") from ByteBufferPool."); String msgStr = sb.toString(); dprint(msgStr); } } else { // don't allocate from pool, allocate non-direct ByteBuffer this.byteBuffer = ByteBuffer.allocate(bufferSize); } position(0); this.buflen = bufferSize; this.byteBuffer.limit(this.buflen); this.needed = 0; this.fragmented = false; }
Example #14
Source File: BufferManagerWriteCollect.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * Close the BufferManagerWrite - do any outstanding cleanup. * * For a BufferManagerWriteGrow any queued ByteBufferWithInfo must * have its ByteBuffer released to the ByteBufferPool. */ public void close() { // iterate thru queue and release any ByteBufferWithInfo's // ByteBuffer that may be remaining on the queue to the // ByteBufferPool. Iterator bufs = iterator(); ByteBufferPool byteBufferPool = orb.getByteBufferPool(); while (bufs.hasNext()) { ByteBufferWithInfo bbwi = (ByteBufferWithInfo)bufs.next(); if (bbwi != null && bbwi.byteBuffer != null) { if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("close() - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } } }
Example #15
Source File: BufferManagerWriteCollect.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Close the BufferManagerWrite - do any outstanding cleanup. * * For a BufferManagerWriteGrow any queued ByteBufferWithInfo must * have its ByteBuffer released to the ByteBufferPool. */ public void close() { // iterate thru queue and release any ByteBufferWithInfo's // ByteBuffer that may be remaining on the queue to the // ByteBufferPool. Iterator bufs = iterator(); ByteBufferPool byteBufferPool = orb.getByteBufferPool(); while (bufs.hasNext()) { ByteBufferWithInfo bbwi = (ByteBufferWithInfo)bufs.next(); if (bbwi != null && bbwi.byteBuffer != null) { if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("close() - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } } }
Example #16
Source File: BufferManagerWriteCollect.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Close the BufferManagerWrite - do any outstanding cleanup. * * For a BufferManagerWriteGrow any queued ByteBufferWithInfo must * have its ByteBuffer released to the ByteBufferPool. */ public void close() { // iterate thru queue and release any ByteBufferWithInfo's // ByteBuffer that may be remaining on the queue to the // ByteBufferPool. Iterator bufs = iterator(); ByteBufferPool byteBufferPool = orb.getByteBufferPool(); while (bufs.hasNext()) { ByteBufferWithInfo bbwi = (ByteBufferWithInfo)bufs.next(); if (bbwi != null && bbwi.byteBuffer != null) { if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("close() - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } } }
Example #17
Source File: ByteBufferWithInfo.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
public ByteBufferWithInfo(org.omg.CORBA.ORB orb, BufferManagerWrite bufferManager, boolean usePooledByteBuffers) { this.orb = (com.sun.corba.se.spi.orb.ORB)orb; debug = this.orb.transportDebugFlag; int bufferSize = bufferManager.getBufferSize(); if (usePooledByteBuffers) { ByteBufferPool byteBufferPool = this.orb.getByteBufferPool(); this.byteBuffer = byteBufferPool.getByteBuffer(bufferSize); if (debug) { // print address of ByteBuffer gotten from pool int bbAddress = System.identityHashCode(byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("constructor (ORB, BufferManagerWrite) - got ") .append("ByteBuffer id (").append(bbAddress) .append(") from ByteBufferPool."); String msgStr = sb.toString(); dprint(msgStr); } } else { // don't allocate from pool, allocate non-direct ByteBuffer this.byteBuffer = ByteBuffer.allocate(bufferSize); } position(0); this.buflen = bufferSize; this.byteBuffer.limit(this.buflen); this.needed = 0; this.fragmented = false; }
Example #18
Source File: CDROutputStream_1_0.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
public void close() throws IOException { // tell BufferManagerWrite to release any ByteBuffers getBufferManager().close(); // It's possible bbwi.byteBuffer is shared between // this OutputStream and an InputStream. Thus, we check // if the Input/Output streams are using the same ByteBuffer. // If they sharing the same ByteBuffer we need to ensure only // one of those ByteBuffers are released to the ByteBufferPool. if (getByteBufferWithInfo() != null && getByteBuffer() != null) { MessageMediator messageMediator = parent.getMessageMediator(); if (messageMediator != null) { CDRInputObject inputObj = (CDRInputObject)messageMediator.getInputObject(); if (inputObj != null) { if (inputObj.isSharing(getByteBuffer())) { // Set InputStream's ByteBuffer and bbwi to null // so its ByteBuffer cannot be released to the pool inputObj.setByteBuffer(null); inputObj.setByteBufferWithInfo(null); } } } // release this stream's ByteBuffer to the pool ByteBufferPool byteBufferPool = orb.getByteBufferPool(); if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append(".close - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(getByteBuffer()); bbwi.byteBuffer = null; bbwi = null; } }
Example #19
Source File: CorbaTransportManagerImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
public ByteBufferPool getByteBufferPool(int id) { throw new RuntimeException(); }
Example #20
Source File: CDRInputStream_1_0.java From hottub with GNU General Public License v2.0 | 4 votes |
public void close() throws IOException { // tell BufferManagerRead to release any ByteBuffers getBufferManager().close(bbwi); // It's possible bbwi.byteBuffer is shared between // this InputStream and an OutputStream. Thus, we check // if the Input/Output streams are using the same ByteBuffer. // If they sharing the same ByteBuffer we need to ensure only // one of those ByteBuffers are released to the ByteBufferPool. if (bbwi != null && getByteBuffer() != null) { MessageMediator messageMediator = parent.getMessageMediator(); if (messageMediator != null) { CDROutputObject outputObj = (CDROutputObject)messageMediator.getOutputObject(); if (outputObj != null) { if (outputObj.isSharing(getByteBuffer())) { // Set OutputStream's ByteBuffer and bbwi to null // so its ByteBuffer cannot be released to the pool outputObj.setByteBuffer(null); outputObj.setByteBufferWithInfo(null); } } } // release this stream's ByteBuffer to the pool ByteBufferPool byteBufferPool = orb.getByteBufferPool(); if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append(".close - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } }
Example #21
Source File: CorbaTransportManagerImpl.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
public ByteBufferPool getByteBufferPool(int id) { throw new RuntimeException(); }
Example #22
Source File: BufferManagerReadStream.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
protected ByteBufferPool getByteBufferPool() { return orb.getByteBufferPool(); }
Example #23
Source File: CDRInputStream_1_0.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
public void close() throws IOException { // tell BufferManagerRead to release any ByteBuffers getBufferManager().close(bbwi); // It's possible bbwi.byteBuffer is shared between // this InputStream and an OutputStream. Thus, we check // if the Input/Output streams are using the same ByteBuffer. // If they sharing the same ByteBuffer we need to ensure only // one of those ByteBuffers are released to the ByteBufferPool. if (bbwi != null && getByteBuffer() != null) { MessageMediator messageMediator = parent.getMessageMediator(); if (messageMediator != null) { CDROutputObject outputObj = (CDROutputObject)messageMediator.getOutputObject(); if (outputObj != null) { if (outputObj.isSharing(getByteBuffer())) { // Set OutputStream's ByteBuffer and bbwi to null // so its ByteBuffer cannot be released to the pool outputObj.setByteBuffer(null); outputObj.setByteBufferWithInfo(null); } } } // release this stream's ByteBuffer to the pool ByteBufferPool byteBufferPool = orb.getByteBufferPool(); if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append(".close - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } }
Example #24
Source File: BufferManagerReadStream.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
protected ByteBufferPool getByteBufferPool() { return orb.getByteBufferPool(); }
Example #25
Source File: BufferManagerReadStream.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
public ByteBufferWithInfo underflow (ByteBufferWithInfo bbwi) { ByteBufferWithInfo result = null; try { //System.out.println("ENTER underflow"); synchronized (fragmentQueue) { if (receivedCancel) { throw new RequestCanceledException(cancelReqId); } while (fragmentQueue.size() == 0) { if (endOfStream) { throw wrapper.endOfStream() ; } boolean interrupted = false; try { fragmentQueue.wait(FRAGMENT_TIMEOUT); } catch (InterruptedException e) { interrupted = true; } if (!interrupted && fragmentQueue.size() == 0) { throw wrapper.bufferReadManagerTimeout(); } if (receivedCancel) { throw new RequestCanceledException(cancelReqId); } } result = fragmentQueue.dequeue(); result.fragmented = true; if (debug) { // print address of ByteBuffer being dequeued int bbAddr = System.identityHashCode(result.byteBuffer); StringBuffer sb1 = new StringBuffer(80); sb1.append("underflow() - dequeued ByteBuffer id ("); sb1.append(bbAddr).append(") from fragment queue."); String msg1 = sb1.toString(); dprint(msg1); } // VERY IMPORTANT // Release bbwi.byteBuffer to the ByteBufferPool only if // this BufferManagerStream is not marked for potential restore. if (markEngaged == false && bbwi != null && bbwi.byteBuffer != null) { ByteBufferPool byteBufferPool = getByteBufferPool(); if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("underflow() - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } } return result; } finally { //System.out.println("EXIT underflow"); } }
Example #26
Source File: BufferManagerWriteCollect.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
public void sendMessage () { // Enqueue the last fragment queue.enqueue(((CDROutputObject)outputObject).getByteBufferWithInfo()); Iterator bufs = iterator(); Connection conn = ((OutputObject)outputObject).getMessageMediator(). getConnection(); // With the collect strategy, we must lock the connection // while fragments are being sent. This is so that there are // no interleved fragments in GIOP 1.1. // // Note that this thread must not call writeLock again in any // of its send methods! conn.writeLock(); try { // Get a reference to ByteBufferPool so that the ByteBufferWithInfo // ByteBuffer can be released to the ByteBufferPool ByteBufferPool byteBufferPool = orb.getByteBufferPool(); while (bufs.hasNext()) { ByteBufferWithInfo bbwi = (ByteBufferWithInfo)bufs.next(); ((CDROutputObject)outputObject).setByteBufferWithInfo(bbwi); conn.sendWithoutLock(((CDROutputObject)outputObject)); sentFragment = true; // Release ByteBufferWithInfo's ByteBuffer back to the pool // of ByteBuffers. if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append("sendMessage() - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } sentFullMessage = true; } finally { conn.writeUnlock(); } }
Example #27
Source File: CDROutputStream_1_0.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
public void close() throws IOException { // tell BufferManagerWrite to release any ByteBuffers getBufferManager().close(); // It's possible bbwi.byteBuffer is shared between // this OutputStream and an InputStream. Thus, we check // if the Input/Output streams are using the same ByteBuffer. // If they sharing the same ByteBuffer we need to ensure only // one of those ByteBuffers are released to the ByteBufferPool. if (getByteBufferWithInfo() != null && getByteBuffer() != null) { MessageMediator messageMediator = parent.getMessageMediator(); if (messageMediator != null) { CDRInputObject inputObj = (CDRInputObject)messageMediator.getInputObject(); if (inputObj != null) { if (inputObj.isSharing(getByteBuffer())) { // Set InputStream's ByteBuffer and bbwi to null // so its ByteBuffer cannot be released to the pool inputObj.setByteBuffer(null); inputObj.setByteBufferWithInfo(null); } } } // release this stream's ByteBuffer to the pool ByteBufferPool byteBufferPool = orb.getByteBufferPool(); if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append(".close - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(getByteBuffer()); bbwi.byteBuffer = null; bbwi = null; } }
Example #28
Source File: CorbaTransportManagerImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
public ByteBufferPool getByteBufferPool(int id) { throw new RuntimeException(); }
Example #29
Source File: CDRInputStream_1_0.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
public void close() throws IOException { // tell BufferManagerRead to release any ByteBuffers getBufferManager().close(bbwi); // It's possible bbwi.byteBuffer is shared between // this InputStream and an OutputStream. Thus, we check // if the Input/Output streams are using the same ByteBuffer. // If they sharing the same ByteBuffer we need to ensure only // one of those ByteBuffers are released to the ByteBufferPool. if (bbwi != null && getByteBuffer() != null) { MessageMediator messageMediator = parent.getMessageMediator(); if (messageMediator != null) { CDROutputObject outputObj = (CDROutputObject)messageMediator.getOutputObject(); if (outputObj != null) { if (outputObj.isSharing(getByteBuffer())) { // Set OutputStream's ByteBuffer and bbwi to null // so its ByteBuffer cannot be released to the pool outputObj.setByteBuffer(null); outputObj.setByteBufferWithInfo(null); } } } // release this stream's ByteBuffer to the pool ByteBufferPool byteBufferPool = orb.getByteBufferPool(); if (debug) { // print address of ByteBuffer being released int bbAddress = System.identityHashCode(bbwi.byteBuffer); StringBuffer sb = new StringBuffer(80); sb.append(".close - releasing ByteBuffer id ("); sb.append(bbAddress).append(") to ByteBufferPool."); String msg = sb.toString(); dprint(msg); } byteBufferPool.releaseByteBuffer(bbwi.byteBuffer); bbwi.byteBuffer = null; bbwi = null; } }
Example #30
Source File: BufferManagerReadStream.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
protected ByteBufferPool getByteBufferPool() { return orb.getByteBufferPool(); }