Java Code Examples for com.sun.corba.se.impl.encoding.CDROutputObject#setByteBufferWithInfo()

The following examples show how to use com.sun.corba.se.impl.encoding.CDROutputObject#setByteBufferWithInfo() . 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: CDRInputStream_1_0.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
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 2
Source File: CDRInputStream_1_0.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
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 3
Source File: CDRInputStream_1_0.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
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 4
Source File: CDRInputStream_1_0.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
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 5
Source File: CDRInputStream_1_0.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
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 6
Source File: CDRInputStream_1_0.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
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 7
Source File: CDRInputStream_1_0.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
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 8
Source File: CDRInputStream_1_0.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
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 9
Source File: CDRInputStream_1_0.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
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 10
Source File: CDRInputStream_1_0.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
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;
    }
}