com.sun.corba.se.impl.protocol.giopmsgheaders.Message Java Examples

The following examples show how to use com.sun.corba.se.impl.protocol.giopmsgheaders.Message. 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 TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public static BufferManagerRead newBufferManagerRead(
        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("newBufferManagerRead");
        }
        return new BufferManagerReadGrow(orb);
    }
    switch (strategy) {
        case BufferManagerFactory.GROW:
            return new BufferManagerReadGrow(orb);
        case BufferManagerFactory.COLLECT:
            throw new INTERNAL("Collect strategy invalid for reading");
        case BufferManagerFactory.STREAM:
            return new BufferManagerReadStream(orb);
        default:
            throw new INTERNAL("Unknown buffer manager read strategy: "
                               + strategy);
    }
}
 
Example #2
Source File: CDROutputObject.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public CDROutputObject(ORB orb, CorbaMessageMediator mediator,
                       GIOPVersion giopVersion,
                       CorbaConnection connection, Message header,
                       byte streamFormatVersion)
{
    this(
        orb,
        giopVersion,
        header,
        BufferManagerFactory.
        newBufferManagerWrite(giopVersion,
                              header.getEncodingVersion(),
                              orb),
        streamFormatVersion,
        mediator);
    this.connection = connection ;
}
 
Example #3
Source File: CorbaMessageMediatorImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void setWorkThenPoolOrResumeSelect(Message header)
{
    if (getConnection().getEventHandler().shouldUseSelectThreadToWait()) {
        resumeSelect(header);
    } else {
        // Leader/Follower when using reader thread.
        // When this thread is done working it will go back in pool.

        isThreadDone = true;

        // First unregister current registration.
        orb.getTransportManager().getSelector(0)
            .unregisterForEvent(getConnection().getEventHandler());
        // Have another thread become the reader.
        orb.getTransportManager().getSelector(0)
            .registerForEvent(getConnection().getEventHandler());
    }
}
 
Example #4
Source File: CDROutputObject.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public CDROutputObject(ORB orb, CorbaMessageMediator mediator,
                       GIOPVersion giopVersion,
                       CorbaConnection connection, Message header,
                       byte streamFormatVersion)
{
    this(
        orb,
        giopVersion,
        header,
        BufferManagerFactory.
        newBufferManagerWrite(giopVersion,
                              header.getEncodingVersion(),
                              orb),
        streamFormatVersion,
        mediator);
    this.connection = connection ;
}
 
Example #5
Source File: CDROutputObject.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public CDROutputObject(ORB orb, CorbaMessageMediator mediator,
                       GIOPVersion giopVersion,
                       CorbaConnection connection, Message header,
                       byte streamFormatVersion)
{
    this(
        orb,
        giopVersion,
        header,
        BufferManagerFactory.
        newBufferManagerWrite(giopVersion,
                              header.getEncodingVersion(),
                              orb),
        streamFormatVersion,
        mediator);
    this.connection = connection ;
}
 
Example #6
Source File: CDROutputObject.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private CDROutputObject(
    ORB orb, GIOPVersion giopVersion, Message header,
    BufferManagerWrite manager, byte streamFormatVersion,
    CorbaMessageMediator mediator)
{
    super(orb, giopVersion, header.getEncodingVersion(),
          false, manager, streamFormatVersion,
          ((mediator != null && mediator.getConnection() != null) ?
           ((CorbaConnection)mediator.getConnection()).
                 shouldUseDirectByteBuffers() : false));

    this.header = header;
    this.orb = orb;
    this.wrapper = ORBUtilSystemException.get( orb, CORBALogDomains.RPC_ENCODING ) ;
    this.omgWrapper = OMGSystemException.get( orb, CORBALogDomains.RPC_ENCODING ) ;

    getBufferManager().setOutputObject(this);
    this.corbaMessageMediator = mediator;
}
 
Example #7
Source File: BufferManagerFactory.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public static BufferManagerRead newBufferManagerRead(
        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("newBufferManagerRead");
        }
        return new BufferManagerReadGrow(orb);
    }
    switch (strategy) {
        case BufferManagerFactory.GROW:
            return new BufferManagerReadGrow(orb);
        case BufferManagerFactory.COLLECT:
            throw new INTERNAL("Collect strategy invalid for reading");
        case BufferManagerFactory.STREAM:
            return new BufferManagerReadStream(orb);
        default:
            throw new INTERNAL("Unknown buffer manager read 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: CDROutputObject.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private CDROutputObject(
    ORB orb, GIOPVersion giopVersion, Message header,
    BufferManagerWrite manager, byte streamFormatVersion,
    CorbaMessageMediator mediator)
{
    super(orb, giopVersion, header.getEncodingVersion(),
          false, manager, streamFormatVersion,
          ((mediator != null && mediator.getConnection() != null) ?
           ((CorbaConnection)mediator.getConnection()).
                 shouldUseDirectByteBuffers() : false));

    this.header = header;
    this.orb = orb;
    this.wrapper = ORBUtilSystemException.get( orb, CORBALogDomains.RPC_ENCODING ) ;
    this.omgWrapper = OMGSystemException.get( orb, CORBALogDomains.RPC_ENCODING ) ;

    getBufferManager().setOutputObject(this);
    this.corbaMessageMediator = mediator;
}
 
Example #10
Source File: CDROutputObject.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public CDROutputObject(ORB orb,
                       MessageMediator messageMediator,
                       Message header,
                       byte streamFormatVersion,
                       int strategy)
{
    this(
        orb,
        ((CorbaMessageMediator)messageMediator).getGIOPVersion(),
        header,
        BufferManagerFactory.
            newBufferManagerWrite(strategy,
                                  header.getEncodingVersion(),
                                  orb),
        streamFormatVersion,
        (CorbaMessageMediator)messageMediator);
}
 
Example #11
Source File: CorbaMessageMediatorImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private CDROutputObject createAppropriateOutputObject(
    CorbaMessageMediator messageMediator,
    Message msg, LocateReplyMessage reply)
{
    CDROutputObject outputObject;

    if (msg.getGIOPVersion().lessThan(GIOPVersion.V1_2)) {
        // locate msgs 1.0 & 1.1 :=> grow,
        outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
                         (ORB) messageMediator.getBroker(),
                         this,
                         GIOPVersion.V1_0,
                         (CorbaConnection) messageMediator.getConnection(),
                         reply,
                         ORBConstants.STREAM_FORMAT_VERSION_1);
    } else {
        // 1.2 :=> stream
        outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
                         (ORB) messageMediator.getBroker(),
                         messageMediator,
                         reply,
                         ORBConstants.STREAM_FORMAT_VERSION_1);
    }
    return outputObject;
}
 
Example #12
Source File: CorbaMessageMediatorImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
private CDROutputObject createAppropriateOutputObject(
    CorbaMessageMediator messageMediator,
    Message msg, LocateReplyMessage reply)
{
    CDROutputObject outputObject;

    if (msg.getGIOPVersion().lessThan(GIOPVersion.V1_2)) {
        // locate msgs 1.0 & 1.1 :=> grow,
        outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
                         (ORB) messageMediator.getBroker(),
                         this,
                         GIOPVersion.V1_0,
                         (CorbaConnection) messageMediator.getConnection(),
                         reply,
                         ORBConstants.STREAM_FORMAT_VERSION_1);
    } else {
        // 1.2 :=> stream
        outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
                         (ORB) messageMediator.getBroker(),
                         messageMediator,
                         reply,
                         ORBConstants.STREAM_FORMAT_VERSION_1);
    }
    return outputObject;
}
 
Example #13
Source File: EncapsInputStream.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Full constructor with a CodeBase parameter useful for
 * unmarshaling RMI-IIOP valuetypes (technically against the
 * intention of an encapsulation, but necessary due to OMG
 * issue 4795.  Used by ServiceContexts.
 */
public EncapsInputStream(org.omg.CORBA.ORB orb,
                         byte[] data,
                         int size,
                         GIOPVersion version,
                         CodeBase codeBase) {
    super(orb,
          ByteBuffer.wrap(data),
          size,
          false,
          version, Message.CDR_ENC_VERSION,
          BufferManagerFactory.newBufferManagerRead(
                                  BufferManagerFactory.GROW,
                                  Message.CDR_ENC_VERSION,
                                  (ORB)orb));

    this.codeBase = codeBase;

    performORBVersionSpecificInit();
}
 
Example #14
Source File: BufferManagerFactory.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public static BufferManagerRead newBufferManagerRead(
        GIOPVersion version, byte encodingVersion, ORB orb) {

    // REVISIT - On the reading side, shouldn't we monitor the incoming
    // fragments on a given connection to determine what fragment size
    // they're using, then use that ourselves?

    if (encodingVersion != Message.CDR_ENC_VERSION) {
        return new BufferManagerReadGrow(orb);
    }

    switch (version.intValue())
    {
        case GIOPVersion.VERSION_1_0:
            return new BufferManagerReadGrow(orb);
        case GIOPVersion.VERSION_1_1:
        case GIOPVersion.VERSION_1_2:
            // The stream reader can handle fragmented and
            // non fragmented messages
            return new BufferManagerReadStream(orb);
        default:
            // REVISIT - what is appropriate?
            throw new INTERNAL("Unknown GIOP version: "
                               + version);
    }
}
 
Example #15
Source File: BufferManagerFactory.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public static BufferManagerRead newBufferManagerRead(
        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("newBufferManagerRead");
        }
        return new BufferManagerReadGrow(orb);
    }
    switch (strategy) {
        case BufferManagerFactory.GROW:
            return new BufferManagerReadGrow(orb);
        case BufferManagerFactory.COLLECT:
            throw new INTERNAL("Collect strategy invalid for reading");
        case BufferManagerFactory.STREAM:
            return new BufferManagerReadStream(orb);
        default:
            throw new INTERNAL("Unknown buffer manager read strategy: "
                               + strategy);
    }
}
 
Example #16
Source File: CorbaMessageMediatorImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
private void setWorkThenPoolOrResumeSelect(Message header)
{
    if (getConnection().getEventHandler().shouldUseSelectThreadToWait()) {
        resumeSelect(header);
    } else {
        // Leader/Follower when using reader thread.
        // When this thread is done working it will go back in pool.

        isThreadDone = true;

        // First unregister current registration.
        orb.getTransportManager().getSelector(0)
            .unregisterForEvent(getConnection().getEventHandler());
        // Have another thread become the reader.
        orb.getTransportManager().getSelector(0)
            .registerForEvent(getConnection().getEventHandler());
    }
}
 
Example #17
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private CDROutputObject createAppropriateOutputObject(
    CorbaMessageMediator messageMediator,
    Message msg, LocateReplyMessage reply)
{
    CDROutputObject outputObject;

    if (msg.getGIOPVersion().lessThan(GIOPVersion.V1_2)) {
        // locate msgs 1.0 & 1.1 :=> grow,
        outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
                         (ORB) messageMediator.getBroker(),
                         this,
                         GIOPVersion.V1_0,
                         (CorbaConnection) messageMediator.getConnection(),
                         reply,
                         ORBConstants.STREAM_FORMAT_VERSION_1);
    } else {
        // 1.2 :=> stream
        outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
                         (ORB) messageMediator.getBroker(),
                         messageMediator,
                         reply,
                         ORBConstants.STREAM_FORMAT_VERSION_1);
    }
    return outputObject;
}
 
Example #18
Source File: CDROutputStream.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public static CDROutputStreamBase newOutputStream(
        ORB orb, GIOPVersion version, byte encodingVersion) {
    switch(version.intValue()) {
        case GIOPVersion.VERSION_1_0:
            return new CDROutputStream_1_0();
        case GIOPVersion.VERSION_1_1:
            return new CDROutputStream_1_1();
    case GIOPVersion.VERSION_1_2:
        if (encodingVersion != Message.CDR_ENC_VERSION) {
            return
                new IDLJavaSerializationOutputStream(encodingVersion);
        }
        return new CDROutputStream_1_2();
    default:
            ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
                CORBALogDomains.RPC_ENCODING ) ;
            // REVISIT - what is appropriate?  INTERNAL exceptions
            // are really hard to track later.
            throw wrapper.unsupportedGiopVersion( version ) ;
    }
}
 
Example #19
Source File: BufferManagerFactory.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public static BufferManagerRead newBufferManagerRead(
        GIOPVersion version, byte encodingVersion, ORB orb) {

    // REVISIT - On the reading side, shouldn't we monitor the incoming
    // fragments on a given connection to determine what fragment size
    // they're using, then use that ourselves?

    if (encodingVersion != Message.CDR_ENC_VERSION) {
        return new BufferManagerReadGrow(orb);
    }

    switch (version.intValue())
    {
        case GIOPVersion.VERSION_1_0:
            return new BufferManagerReadGrow(orb);
        case GIOPVersion.VERSION_1_1:
        case GIOPVersion.VERSION_1_2:
            // The stream reader can handle fragmented and
            // non fragmented messages
            return new BufferManagerReadStream(orb);
        default:
            // REVISIT - what is appropriate?
            throw new INTERNAL("Unknown GIOP version: "
                               + version);
    }
}
 
Example #20
Source File: EncapsInputStream.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public EncapsInputStream(org.omg.CORBA.ORB orb, byte[] buf,
                         int size, boolean littleEndian,
                         GIOPVersion version) {
    super(orb, ByteBuffer.wrap(buf), size, littleEndian,
          version, Message.CDR_ENC_VERSION,
          BufferManagerFactory.newBufferManagerRead(
                                  BufferManagerFactory.GROW,
                                  Message.CDR_ENC_VERSION,
                                  (ORB)orb));

    wrapper = ORBUtilSystemException.get( (ORB)orb,
        CORBALogDomains.RPC_ENCODING ) ;

    performORBVersionSpecificInit();
}
 
Example #21
Source File: ORBUtility.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return the Java serialization encoding version.
 */
public static byte getEncodingVersion(ORB orb, IOR ior) {

    // Is Java serialization enabled?
    // Check the JavaSerializationComponent (tagged component)
    // in the IIOPProfile. If present, the peer ORB's GIOP is capable
    // of using Java serialization instead of CDR serialization.
    // In such a case, use Java serialization, iff the java serialization
    // versions match.

    if (orb.getORBData().isJavaSerializationEnabled()) {
        IIOPProfile prof = ior.getProfile();
        IIOPProfileTemplate profTemp =
            (IIOPProfileTemplate) prof.getTaggedProfileTemplate();
        java.util.Iterator iter = profTemp.iteratorById(
                              ORBConstants.TAG_JAVA_SERIALIZATION_ID);
        if (iter.hasNext()) {
            JavaSerializationComponent jc =
                (JavaSerializationComponent) iter.next();
            byte jcVersion = jc.javaSerializationVersion();
            if (jcVersion >= Message.JAVA_ENC_VERSION) {
                return Message.JAVA_ENC_VERSION;
            } else if (jcVersion > Message.CDR_ENC_VERSION) {
                return jc.javaSerializationVersion();
            } else {
                // throw error?
                // Since encodingVersion is <= 0 (CDR_ENC_VERSION).
            }
        }
    }
    return Message.CDR_ENC_VERSION; // default
}
 
Example #22
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void setWorkThenReadOrResumeSelect(Message header)
{
    if (getConnection().getEventHandler().shouldUseSelectThreadToWait()) {
        resumeSelect(header);
    } else {
        // When using reader thread then wen this thread is
        // done working it will continue reading.
        isThreadDone = false;
    }
}
 
Example #23
Source File: OutputStreamFactory.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static CDROutputObject newCDROutputObject(
        final ORB orb, final CorbaMessageMediator mediator,
        final GIOPVersion giopVersion, final CorbaConnection connection,
        final Message header, final byte streamFormatVersion) {
    return AccessController.doPrivileged(
        new PrivilegedAction<CDROutputObject>() {
            @Override
            public CDROutputObject run() {
                return new CDROutputObject(orb, mediator,
                    giopVersion, connection, header, streamFormatVersion);
            }
    });
}
 
Example #24
Source File: OutputStreamFactory.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static CDROutputObject newCDROutputObject(
        final ORB orb, final MessageMediator messageMediator,
        final Message header, final byte streamFormatVersion,
        final int strategy) {
    return AccessController.doPrivileged(
        new PrivilegedAction<CDROutputObject>() {
            @Override
            public CDROutputObject run() {
                return new CDROutputObject(orb, messageMediator,
                    header, streamFormatVersion, strategy);
            }
    });
}
 
Example #25
Source File: OutputStreamFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static CDROutputObject newCDROutputObject(
        final ORB orb, final CorbaMessageMediator mediator,
        final GIOPVersion giopVersion, final CorbaConnection connection,
        final Message header, final byte streamFormatVersion) {
    return AccessController.doPrivileged(
        new PrivilegedAction<CDROutputObject>() {
            @Override
            public CDROutputObject run() {
                return new CDROutputObject(orb, mediator,
                    giopVersion, connection, header, streamFormatVersion);
            }
    });
}
 
Example #26
Source File: JavaSerializationComponent.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static JavaSerializationComponent singleton() {
    if (singleton == null) {
        synchronized (JavaSerializationComponent.class) {
            singleton =
                new JavaSerializationComponent(Message.JAVA_ENC_VERSION);
        }
    }
    return singleton;
}
 
Example #27
Source File: CorbaContactInfoBase.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public MessageMediator finishCreatingMessageMediator(Broker broker,
                           Connection conn, MessageMediator messageMediator)
{
    ORB orb = (ORB) broker;
    CorbaConnection connection = (CorbaConnection) conn;
    CorbaMessageMediator corbaMessageMediator =
                  (CorbaMessageMediator)messageMediator;

    if (orb.transportDebugFlag) {
        dprint(
        ".finishCreatingMessageMediator: waiting for message body on connection: "
            + connection);
    }

    Message msg = corbaMessageMediator.getDispatchHeader();
    msg.setByteBuffer(corbaMessageMediator.getDispatchBuffer());

    // read giop body only
    msg = MessageBase.readGIOPBody(orb, connection, msg);

    ByteBuffer byteBuffer = msg.getByteBuffer();
    msg.setByteBuffer(null);
    corbaMessageMediator.setDispatchHeader(msg);
    corbaMessageMediator.setDispatchBuffer(byteBuffer);

    return corbaMessageMediator;
}
 
Example #28
Source File: CorbaContactInfoBase.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public MessageMediator createMessageMediator(Broker broker,Connection conn)
{
    ORB orb = (ORB) broker;
    CorbaConnection connection = (CorbaConnection) conn;

    if (orb.transportDebugFlag) {
        if (connection.shouldReadGiopHeaderOnly()) {
            dprint(
            ".createMessageMediator: waiting for message header on connection: "
            + connection);
        } else {
            dprint(
            ".createMessageMediator: waiting for message on connection: "
            + connection);
        }
    }

    Message msg = null;

    if (connection.shouldReadGiopHeaderOnly()) {
        // read giop header only
        msg = MessageBase.readGIOPHeader(orb, connection);
    } else {
        // read entire giop message
        msg = MessageBase.readGIOPMessage(orb, connection);
    }

    ByteBuffer byteBuffer = msg.getByteBuffer();
    msg.setByteBuffer(null);
    CorbaMessageMediator messageMediator =
        new CorbaMessageMediatorImpl(orb, connection, msg, byteBuffer);

    return messageMediator;
}
 
Example #29
Source File: ORBUtility.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return the Java serialization encoding version.
 */
public static byte getEncodingVersion(ORB orb, IOR ior) {

    // Is Java serialization enabled?
    // Check the JavaSerializationComponent (tagged component)
    // in the IIOPProfile. If present, the peer ORB's GIOP is capable
    // of using Java serialization instead of CDR serialization.
    // In such a case, use Java serialization, iff the java serialization
    // versions match.

    if (orb.getORBData().isJavaSerializationEnabled()) {
        IIOPProfile prof = ior.getProfile();
        IIOPProfileTemplate profTemp =
            (IIOPProfileTemplate) prof.getTaggedProfileTemplate();
        java.util.Iterator iter = profTemp.iteratorById(
                              ORBConstants.TAG_JAVA_SERIALIZATION_ID);
        if (iter.hasNext()) {
            JavaSerializationComponent jc =
                (JavaSerializationComponent) iter.next();
            byte jcVersion = jc.javaSerializationVersion();
            if (jcVersion >= Message.JAVA_ENC_VERSION) {
                return Message.JAVA_ENC_VERSION;
            } else if (jcVersion > Message.CDR_ENC_VERSION) {
                return jc.javaSerializationVersion();
            } else {
                // throw error?
                // Since encodingVersion is <= 0 (CDR_ENC_VERSION).
            }
        }
    }
    return Message.CDR_ENC_VERSION; // default
}
 
Example #30
Source File: CorbaMessageMediatorImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public int getThreadPoolToUse() {
    int poolToUse = 0;
    Message msg = getDispatchHeader();
    // A null msg should never happen. But, we'll be
    // defensive just in case.
    if (msg != null) {
        poolToUse = msg.getThreadPoolToUse();
    }
    return poolToUse;
}