com.sun.corba.se.impl.encoding.BufferManagerWrite Java Examples

The following examples show how to use com.sun.corba.se.impl.encoding.BufferManagerWrite. 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: BufferManagerFactory.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
        int strategy, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        if (strategy != BufferManagerFactory.GROW) {
            ORBUtilSystemException wrapper =
                ORBUtilSystemException.get((ORB)orb,
                                           CORBALogDomains.RPC_ENCODING);
            throw wrapper.invalidBuffMgrStrategy("newBufferManagerWrite");
        }
        return new BufferManagerWriteGrow(orb);
    }
    switch (strategy) {
        case BufferManagerFactory.GROW:
            return new BufferManagerWriteGrow(orb);
        case BufferManagerFactory.COLLECT:
            return new BufferManagerWriteCollect(orb);
        case BufferManagerFactory.STREAM:
            return new BufferManagerWriteStream(orb);
        default:
            throw new INTERNAL("Unknown buffer manager write strategy: "
                               + strategy);
    }
}
 
Example #2
Source File: BufferManagerFactory.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
        int strategy, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        if (strategy != BufferManagerFactory.GROW) {
            ORBUtilSystemException wrapper =
                ORBUtilSystemException.get((ORB)orb,
                                           CORBALogDomains.RPC_ENCODING);
            throw wrapper.invalidBuffMgrStrategy("newBufferManagerWrite");
        }
        return new BufferManagerWriteGrow(orb);
    }
    switch (strategy) {
        case BufferManagerFactory.GROW:
            return new BufferManagerWriteGrow(orb);
        case BufferManagerFactory.COLLECT:
            return new BufferManagerWriteCollect(orb);
        case BufferManagerFactory.STREAM:
            return new BufferManagerWriteStream(orb);
        default:
            throw new INTERNAL("Unknown buffer manager write strategy: "
                               + strategy);
    }
}
 
Example #3
Source File: BufferManagerFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
        int strategy, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        if (strategy != BufferManagerFactory.GROW) {
            ORBUtilSystemException wrapper =
                ORBUtilSystemException.get((ORB)orb,
                                           CORBALogDomains.RPC_ENCODING);
            throw wrapper.invalidBuffMgrStrategy("newBufferManagerWrite");
        }
        return new BufferManagerWriteGrow(orb);
    }
    switch (strategy) {
        case BufferManagerFactory.GROW:
            return new BufferManagerWriteGrow(orb);
        case BufferManagerFactory.COLLECT:
            return new BufferManagerWriteCollect(orb);
        case BufferManagerFactory.STREAM:
            return new BufferManagerWriteStream(orb);
        default:
            throw new INTERNAL("Unknown buffer manager write strategy: "
                               + strategy);
    }
}
 
Example #4
Source File: BufferManagerFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
        int strategy, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        if (strategy != BufferManagerFactory.GROW) {
            ORBUtilSystemException wrapper =
                ORBUtilSystemException.get((ORB)orb,
                                           CORBALogDomains.RPC_ENCODING);
            throw wrapper.invalidBuffMgrStrategy("newBufferManagerWrite");
        }
        return new BufferManagerWriteGrow(orb);
    }
    switch (strategy) {
        case BufferManagerFactory.GROW:
            return new BufferManagerWriteGrow(orb);
        case BufferManagerFactory.COLLECT:
            return new BufferManagerWriteCollect(orb);
        case BufferManagerFactory.STREAM:
            return new BufferManagerWriteStream(orb);
        default:
            throw new INTERNAL("Unknown buffer manager write strategy: "
                               + strategy);
    }
}
 
Example #5
Source File: BufferManagerFactory.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
        int strategy, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        if (strategy != BufferManagerFactory.GROW) {
            ORBUtilSystemException wrapper =
                ORBUtilSystemException.get((ORB)orb,
                                           CORBALogDomains.RPC_ENCODING);
            throw wrapper.invalidBuffMgrStrategy("newBufferManagerWrite");
        }
        return new BufferManagerWriteGrow(orb);
    }
    switch (strategy) {
        case BufferManagerFactory.GROW:
            return new BufferManagerWriteGrow(orb);
        case BufferManagerFactory.COLLECT:
            return new BufferManagerWriteCollect(orb);
        case BufferManagerFactory.STREAM:
            return new BufferManagerWriteStream(orb);
        default:
            throw new INTERNAL("Unknown buffer manager write strategy: "
                               + strategy);
    }
}
 
Example #6
Source File: BufferManagerFactory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
        int strategy, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        if (strategy != BufferManagerFactory.GROW) {
            ORBUtilSystemException wrapper =
                ORBUtilSystemException.get((ORB)orb,
                                           CORBALogDomains.RPC_ENCODING);
            throw wrapper.invalidBuffMgrStrategy("newBufferManagerWrite");
        }
        return new BufferManagerWriteGrow(orb);
    }
    switch (strategy) {
        case BufferManagerFactory.GROW:
            return new BufferManagerWriteGrow(orb);
        case BufferManagerFactory.COLLECT:
            return new BufferManagerWriteCollect(orb);
        case BufferManagerFactory.STREAM:
            return new BufferManagerWriteStream(orb);
        default:
            throw new INTERNAL("Unknown buffer manager write strategy: "
                               + strategy);
    }
}
 
Example #7
Source File: BufferManagerFactory.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
        int strategy, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        if (strategy != BufferManagerFactory.GROW) {
            ORBUtilSystemException wrapper =
                ORBUtilSystemException.get((ORB)orb,
                                           CORBALogDomains.RPC_ENCODING);
            throw wrapper.invalidBuffMgrStrategy("newBufferManagerWrite");
        }
        return new BufferManagerWriteGrow(orb);
    }
    switch (strategy) {
        case BufferManagerFactory.GROW:
            return new BufferManagerWriteGrow(orb);
        case BufferManagerFactory.COLLECT:
            return new BufferManagerWriteCollect(orb);
        case BufferManagerFactory.STREAM:
            return new BufferManagerWriteStream(orb);
        default:
            throw new INTERNAL("Unknown buffer manager write strategy: "
                               + strategy);
    }
}
 
Example #8
Source File: BufferManagerFactory.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
        int strategy, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        if (strategy != BufferManagerFactory.GROW) {
            ORBUtilSystemException wrapper =
                ORBUtilSystemException.get((ORB)orb,
                                           CORBALogDomains.RPC_ENCODING);
            throw wrapper.invalidBuffMgrStrategy("newBufferManagerWrite");
        }
        return new BufferManagerWriteGrow(orb);
    }
    switch (strategy) {
        case BufferManagerFactory.GROW:
            return new BufferManagerWriteGrow(orb);
        case BufferManagerFactory.COLLECT:
            return new BufferManagerWriteCollect(orb);
        case BufferManagerFactory.STREAM:
            return new BufferManagerWriteStream(orb);
        default:
            throw new INTERNAL("Unknown buffer manager write strategy: "
                               + strategy);
    }
}
 
Example #9
Source File: BufferManagerFactory.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
        int strategy, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        if (strategy != BufferManagerFactory.GROW) {
            ORBUtilSystemException wrapper =
                ORBUtilSystemException.get((ORB)orb,
                                           CORBALogDomains.RPC_ENCODING);
            throw wrapper.invalidBuffMgrStrategy("newBufferManagerWrite");
        }
        return new BufferManagerWriteGrow(orb);
    }
    switch (strategy) {
        case BufferManagerFactory.GROW:
            return new BufferManagerWriteGrow(orb);
        case BufferManagerFactory.COLLECT:
            return new BufferManagerWriteCollect(orb);
        case BufferManagerFactory.STREAM:
            return new BufferManagerWriteStream(orb);
        default:
            throw new INTERNAL("Unknown buffer manager write strategy: "
                               + strategy);
    }
}
 
Example #10
Source File: BufferManagerFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
        int strategy, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        if (strategy != BufferManagerFactory.GROW) {
            ORBUtilSystemException wrapper =
                ORBUtilSystemException.get((ORB)orb,
                                           CORBALogDomains.RPC_ENCODING);
            throw wrapper.invalidBuffMgrStrategy("newBufferManagerWrite");
        }
        return new BufferManagerWriteGrow(orb);
    }
    switch (strategy) {
        case BufferManagerFactory.GROW:
            return new BufferManagerWriteGrow(orb);
        case BufferManagerFactory.COLLECT:
            return new BufferManagerWriteCollect(orb);
        case BufferManagerFactory.STREAM:
            return new BufferManagerWriteStream(orb);
        default:
            throw new INTERNAL("Unknown buffer manager write strategy: "
                               + strategy);
    }
}
 
Example #11
Source File: ByteBufferWithInfo.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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 #12
Source File: CorbaOutputObject.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public CorbaOutputObject(
    ORB orb, GIOPVersion version, byte encodingVersion,
    boolean littleEndian, BufferManagerWrite bufferManager,
    byte streamFormatVersion, boolean usePooledByteBuffers)
{
    super(orb, version, encodingVersion, littleEndian, bufferManager,
          streamFormatVersion, usePooledByteBuffers);
}
 
Example #13
Source File: BufferManagerFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
    GIOPVersion version, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        return new BufferManagerWriteGrow(orb);
    }
    return BufferManagerFactory.newBufferManagerWrite(
        orb.getORBData().getGIOPBuffMgrStrategy(version),
        encodingVersion, orb);
}
 
Example #14
Source File: CorbaOutputObject.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public CorbaOutputObject(
    ORB orb, GIOPVersion version, byte encodingVersion,
    boolean littleEndian, BufferManagerWrite bufferManager,
    byte streamFormatVersion, boolean usePooledByteBuffers)
{
    super(orb, version, encodingVersion, littleEndian, bufferManager,
          streamFormatVersion, usePooledByteBuffers);
}
 
Example #15
Source File: ByteBufferWithInfo.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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 #16
Source File: BufferManagerFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
    GIOPVersion version, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        return new BufferManagerWriteGrow(orb);
    }
    return BufferManagerFactory.newBufferManagerWrite(
        orb.getORBData().getGIOPBuffMgrStrategy(version),
        encodingVersion, orb);
}
 
Example #17
Source File: CorbaOutputObject.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public CorbaOutputObject(
    ORB orb, GIOPVersion version, byte encodingVersion,
    boolean littleEndian, BufferManagerWrite bufferManager,
    byte streamFormatVersion, boolean usePooledByteBuffers)
{
    super(orb, version, encodingVersion, littleEndian, bufferManager,
          streamFormatVersion, usePooledByteBuffers);
}
 
Example #18
Source File: ByteBufferWithInfo.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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 #19
Source File: BufferManagerFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
    GIOPVersion version, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        return new BufferManagerWriteGrow(orb);
    }
    return BufferManagerFactory.newBufferManagerWrite(
        orb.getORBData().getGIOPBuffMgrStrategy(version),
        encodingVersion, orb);
}
 
Example #20
Source File: CorbaOutputObject.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public CorbaOutputObject(
    ORB orb, GIOPVersion version, byte encodingVersion,
    boolean littleEndian, BufferManagerWrite bufferManager,
    byte streamFormatVersion, boolean usePooledByteBuffers)
{
    super(orb, version, encodingVersion, littleEndian, bufferManager,
          streamFormatVersion, usePooledByteBuffers);
}
 
Example #21
Source File: ByteBufferWithInfo.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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 #22
Source File: BufferManagerFactory.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
    GIOPVersion version, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        return new BufferManagerWriteGrow(orb);
    }
    return BufferManagerFactory.newBufferManagerWrite(
        orb.getORBData().getGIOPBuffMgrStrategy(version),
        encodingVersion, orb);
}
 
Example #23
Source File: CorbaOutputObject.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public CorbaOutputObject(
    ORB orb, GIOPVersion version, byte encodingVersion,
    boolean littleEndian, BufferManagerWrite bufferManager,
    byte streamFormatVersion, boolean usePooledByteBuffers)
{
    super(orb, version, encodingVersion, littleEndian, bufferManager,
          streamFormatVersion, usePooledByteBuffers);
}
 
Example #24
Source File: ByteBufferWithInfo.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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 #25
Source File: BufferManagerFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
    GIOPVersion version, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        return new BufferManagerWriteGrow(orb);
    }
    return BufferManagerFactory.newBufferManagerWrite(
        orb.getORBData().getGIOPBuffMgrStrategy(version),
        encodingVersion, orb);
}
 
Example #26
Source File: CorbaOutputObject.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public CorbaOutputObject(
    ORB orb, GIOPVersion version, byte encodingVersion,
    boolean littleEndian, BufferManagerWrite bufferManager,
    byte streamFormatVersion, boolean usePooledByteBuffers)
{
    super(orb, version, encodingVersion, littleEndian, bufferManager,
          streamFormatVersion, usePooledByteBuffers);
}
 
Example #27
Source File: BufferManagerFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static BufferManagerWrite newBufferManagerWrite(
    GIOPVersion version, byte encodingVersion, ORB orb) {
    if (encodingVersion != Message.CDR_ENC_VERSION) {
        return new BufferManagerWriteGrow(orb);
    }
    return BufferManagerFactory.newBufferManagerWrite(
        orb.getORBData().getGIOPBuffMgrStrategy(version),
        encodingVersion, orb);
}
 
Example #28
Source File: ByteBufferWithInfo.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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 #29
Source File: CorbaOutputObject.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public CorbaOutputObject(
    ORB orb, GIOPVersion version, byte encodingVersion,
    boolean littleEndian, BufferManagerWrite bufferManager,
    byte streamFormatVersion, boolean usePooledByteBuffers)
{
    super(orb, version, encodingVersion, littleEndian, bufferManager,
          streamFormatVersion, usePooledByteBuffers);
}
 
Example #30
Source File: ByteBufferWithInfo.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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;
}