Java Code Examples for com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage#write()

The following examples show how to use com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage#write() . 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: CorbaMessageMediatorImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected void handleAddressingDisposition(
    CorbaMessageMediator messageMediator,
    AddressingDispositionException ex)
{

    short addrDisp = -1;

    // from iiop.RequestProcessor.

    // Respond with expected target addressing disposition.

    switch (messageMediator.getRequestHeader().getType()) {
    case Message.GIOPRequest :
        ReplyMessage replyHeader = MessageBase.createReply(
                      (ORB)messageMediator.getBroker(),
                      messageMediator.getGIOPVersion(),
                      messageMediator.getEncodingVersion(),
                      messageMediator.getRequestId(),
                      ReplyMessage.NEEDS_ADDRESSING_MODE,
                      null, null);
        // REVISIT: via acceptor factory.
        CDROutputObject outputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(
            (ORB)messageMediator.getBroker(),
            this,
            messageMediator.getGIOPVersion(),
            (CorbaConnection)messageMediator.getConnection(),
            replyHeader,
            ORBConstants.STREAM_FORMAT_VERSION_1);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        replyHeader.write(outputObject);
        AddressingDispositionHelper.write(outputObject,
                                          ex.expectedAddrDisp());
        return;

    case Message.GIOPLocateRequest :
        LocateReplyMessage locateReplyHeader = MessageBase.createLocateReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            LocateReplyMessage.LOC_NEEDS_ADDRESSING_MODE,
            null);

        addrDisp = ex.expectedAddrDisp();

        // REVISIT: via acceptor factory.
        outputObject =
            createAppropriateOutputObject(messageMediator,
                                          messageMediator.getRequestHeader(),
                                          locateReplyHeader);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        locateReplyHeader.write(outputObject);
        IOR ior = null;
        if (ior != null) {
            ior.write(outputObject);
        }
        if (addrDisp != -1) {
            AddressingDispositionHelper.write(outputObject, addrDisp);
        }
        return;
    }
}
 
Example 2
Source File: CorbaMessageMediatorImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ReplyMessage reply, IOR ior)
{
    // REVISIT - these should be invoked from subcontract.
    runServantPostInvoke(messageMediator);
    runInterceptors(messageMediator, reply);
    runRemoveThreadInfo(messageMediator);

    if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) {
        dprint(".createResponseHelper: "
               + opAndId(messageMediator) + ": "
               + reply);
    }

    messageMediator.setReplyHeader(reply);

    OutputObject replyOutputObject;
    // REVISIT = do not use null.
    //
    if (messageMediator.getConnection() == null) {
        replyOutputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(orb,
                        messageMediator, messageMediator.getReplyHeader(),
                        messageMediator.getStreamFormatVersion(),
                        BufferManagerFactory.GROW);
    } else {
        replyOutputObject = messageMediator.getConnection().getAcceptor()
         .createOutputObject(messageMediator.getBroker(), messageMediator);
    }
    messageMediator.setOutputObject(replyOutputObject);
    messageMediator.getOutputObject().setMessageMediator(messageMediator);

    reply.write((OutputStream) messageMediator.getOutputObject());
    if (reply.getIOR() != null) {
        reply.getIOR().write((OutputStream) messageMediator.getOutputObject());
    }
    // REVISIT - not necessary?
    //messageMediator.this.replyIOR = reply.getIOR();

    // NOTE: The mediator holds onto output object so return value
    // not really necessary.
    return messageMediator;
}
 
Example 3
Source File: CorbaMessageMediatorImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected void handleAddressingDisposition(
    CorbaMessageMediator messageMediator,
    AddressingDispositionException ex)
{

    short addrDisp = -1;

    // from iiop.RequestProcessor.

    // Respond with expected target addressing disposition.

    switch (messageMediator.getRequestHeader().getType()) {
    case Message.GIOPRequest :
        ReplyMessage replyHeader = MessageBase.createReply(
                      (ORB)messageMediator.getBroker(),
                      messageMediator.getGIOPVersion(),
                      messageMediator.getEncodingVersion(),
                      messageMediator.getRequestId(),
                      ReplyMessage.NEEDS_ADDRESSING_MODE,
                      null, null);
        // REVISIT: via acceptor factory.
        CDROutputObject outputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(
            (ORB)messageMediator.getBroker(),
            this,
            messageMediator.getGIOPVersion(),
            (CorbaConnection)messageMediator.getConnection(),
            replyHeader,
            ORBConstants.STREAM_FORMAT_VERSION_1);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        replyHeader.write(outputObject);
        AddressingDispositionHelper.write(outputObject,
                                          ex.expectedAddrDisp());
        return;

    case Message.GIOPLocateRequest :
        LocateReplyMessage locateReplyHeader = MessageBase.createLocateReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            LocateReplyMessage.LOC_NEEDS_ADDRESSING_MODE,
            null);

        addrDisp = ex.expectedAddrDisp();

        // REVISIT: via acceptor factory.
        outputObject =
            createAppropriateOutputObject(messageMediator,
                                          messageMediator.getRequestHeader(),
                                          locateReplyHeader);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        locateReplyHeader.write(outputObject);
        IOR ior = null;
        if (ior != null) {
            ior.write(outputObject);
        }
        if (addrDisp != -1) {
            AddressingDispositionHelper.write(outputObject, addrDisp);
        }
        return;
    }
}
 
Example 4
Source File: CorbaMessageMediatorImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ReplyMessage reply, IOR ior)
{
    // REVISIT - these should be invoked from subcontract.
    runServantPostInvoke(messageMediator);
    runInterceptors(messageMediator, reply);
    runRemoveThreadInfo(messageMediator);

    if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) {
        dprint(".createResponseHelper: "
               + opAndId(messageMediator) + ": "
               + reply);
    }

    messageMediator.setReplyHeader(reply);

    OutputObject replyOutputObject;
    // REVISIT = do not use null.
    //
    if (messageMediator.getConnection() == null) {
        replyOutputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(orb,
                        messageMediator, messageMediator.getReplyHeader(),
                        messageMediator.getStreamFormatVersion(),
                        BufferManagerFactory.GROW);
    } else {
        replyOutputObject = messageMediator.getConnection().getAcceptor()
         .createOutputObject(messageMediator.getBroker(), messageMediator);
    }
    messageMediator.setOutputObject(replyOutputObject);
    messageMediator.getOutputObject().setMessageMediator(messageMediator);

    reply.write((OutputStream) messageMediator.getOutputObject());
    if (reply.getIOR() != null) {
        reply.getIOR().write((OutputStream) messageMediator.getOutputObject());
    }
    // REVISIT - not necessary?
    //messageMediator.this.replyIOR = reply.getIOR();

    // NOTE: The mediator holds onto output object so return value
    // not really necessary.
    return messageMediator;
}
 
Example 5
Source File: CorbaMessageMediatorImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected void handleAddressingDisposition(
    CorbaMessageMediator messageMediator,
    AddressingDispositionException ex)
{

    short addrDisp = -1;

    // from iiop.RequestProcessor.

    // Respond with expected target addressing disposition.

    switch (messageMediator.getRequestHeader().getType()) {
    case Message.GIOPRequest :
        ReplyMessage replyHeader = MessageBase.createReply(
                      (ORB)messageMediator.getBroker(),
                      messageMediator.getGIOPVersion(),
                      messageMediator.getEncodingVersion(),
                      messageMediator.getRequestId(),
                      ReplyMessage.NEEDS_ADDRESSING_MODE,
                      null, null);
        // REVISIT: via acceptor factory.
        CDROutputObject outputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(
            (ORB)messageMediator.getBroker(),
            this,
            messageMediator.getGIOPVersion(),
            (CorbaConnection)messageMediator.getConnection(),
            replyHeader,
            ORBConstants.STREAM_FORMAT_VERSION_1);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        replyHeader.write(outputObject);
        AddressingDispositionHelper.write(outputObject,
                                          ex.expectedAddrDisp());
        return;

    case Message.GIOPLocateRequest :
        LocateReplyMessage locateReplyHeader = MessageBase.createLocateReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            LocateReplyMessage.LOC_NEEDS_ADDRESSING_MODE,
            null);

        addrDisp = ex.expectedAddrDisp();

        // REVISIT: via acceptor factory.
        outputObject =
            createAppropriateOutputObject(messageMediator,
                                          messageMediator.getRequestHeader(),
                                          locateReplyHeader);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        locateReplyHeader.write(outputObject);
        IOR ior = null;
        if (ior != null) {
            ior.write(outputObject);
        }
        if (addrDisp != -1) {
            AddressingDispositionHelper.write(outputObject, addrDisp);
        }
        return;
    }
}
 
Example 6
Source File: CorbaMessageMediatorImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ReplyMessage reply, IOR ior)
{
    // REVISIT - these should be invoked from subcontract.
    runServantPostInvoke(messageMediator);
    runInterceptors(messageMediator, reply);
    runRemoveThreadInfo(messageMediator);

    if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) {
        dprint(".createResponseHelper: "
               + opAndId(messageMediator) + ": "
               + reply);
    }

    messageMediator.setReplyHeader(reply);

    OutputObject replyOutputObject;
    // REVISIT = do not use null.
    //
    if (messageMediator.getConnection() == null) {
        replyOutputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(orb,
                        messageMediator, messageMediator.getReplyHeader(),
                        messageMediator.getStreamFormatVersion(),
                        BufferManagerFactory.GROW);
    } else {
        replyOutputObject = messageMediator.getConnection().getAcceptor()
         .createOutputObject(messageMediator.getBroker(), messageMediator);
    }
    messageMediator.setOutputObject(replyOutputObject);
    messageMediator.getOutputObject().setMessageMediator(messageMediator);

    reply.write((OutputStream) messageMediator.getOutputObject());
    if (reply.getIOR() != null) {
        reply.getIOR().write((OutputStream) messageMediator.getOutputObject());
    }
    // REVISIT - not necessary?
    //messageMediator.this.replyIOR = reply.getIOR();

    // NOTE: The mediator holds onto output object so return value
    // not really necessary.
    return messageMediator;
}
 
Example 7
Source File: CorbaMessageMediatorImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected void handleAddressingDisposition(
    CorbaMessageMediator messageMediator,
    AddressingDispositionException ex)
{

    short addrDisp = -1;

    // from iiop.RequestProcessor.

    // Respond with expected target addressing disposition.

    switch (messageMediator.getRequestHeader().getType()) {
    case Message.GIOPRequest :
        ReplyMessage replyHeader = MessageBase.createReply(
                      (ORB)messageMediator.getBroker(),
                      messageMediator.getGIOPVersion(),
                      messageMediator.getEncodingVersion(),
                      messageMediator.getRequestId(),
                      ReplyMessage.NEEDS_ADDRESSING_MODE,
                      null, null);
        // REVISIT: via acceptor factory.
        CDROutputObject outputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(
            (ORB)messageMediator.getBroker(),
            this,
            messageMediator.getGIOPVersion(),
            (CorbaConnection)messageMediator.getConnection(),
            replyHeader,
            ORBConstants.STREAM_FORMAT_VERSION_1);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        replyHeader.write(outputObject);
        AddressingDispositionHelper.write(outputObject,
                                          ex.expectedAddrDisp());
        return;

    case Message.GIOPLocateRequest :
        LocateReplyMessage locateReplyHeader = MessageBase.createLocateReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            LocateReplyMessage.LOC_NEEDS_ADDRESSING_MODE,
            null);

        addrDisp = ex.expectedAddrDisp();

        // REVISIT: via acceptor factory.
        outputObject =
            createAppropriateOutputObject(messageMediator,
                                          messageMediator.getRequestHeader(),
                                          locateReplyHeader);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        locateReplyHeader.write(outputObject);
        IOR ior = null;
        if (ior != null) {
            ior.write(outputObject);
        }
        if (addrDisp != -1) {
            AddressingDispositionHelper.write(outputObject, addrDisp);
        }
        return;
    }
}
 
Example 8
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ReplyMessage reply, IOR ior)
{
    // REVISIT - these should be invoked from subcontract.
    runServantPostInvoke(messageMediator);
    runInterceptors(messageMediator, reply);
    runRemoveThreadInfo(messageMediator);

    if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) {
        dprint(".createResponseHelper: "
               + opAndId(messageMediator) + ": "
               + reply);
    }

    messageMediator.setReplyHeader(reply);

    OutputObject replyOutputObject;
    // REVISIT = do not use null.
    //
    if (messageMediator.getConnection() == null) {
        replyOutputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(orb,
                        messageMediator, messageMediator.getReplyHeader(),
                        messageMediator.getStreamFormatVersion(),
                        BufferManagerFactory.GROW);
    } else {
        replyOutputObject = messageMediator.getConnection().getAcceptor()
         .createOutputObject(messageMediator.getBroker(), messageMediator);
    }
    messageMediator.setOutputObject(replyOutputObject);
    messageMediator.getOutputObject().setMessageMediator(messageMediator);

    reply.write((OutputStream) messageMediator.getOutputObject());
    if (reply.getIOR() != null) {
        reply.getIOR().write((OutputStream) messageMediator.getOutputObject());
    }
    // REVISIT - not necessary?
    //messageMediator.this.replyIOR = reply.getIOR();

    // NOTE: The mediator holds onto output object so return value
    // not really necessary.
    return messageMediator;
}
 
Example 9
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected void handleAddressingDisposition(
    CorbaMessageMediator messageMediator,
    AddressingDispositionException ex)
{

    short addrDisp = -1;

    // from iiop.RequestProcessor.

    // Respond with expected target addressing disposition.

    switch (messageMediator.getRequestHeader().getType()) {
    case Message.GIOPRequest :
        ReplyMessage replyHeader = MessageBase.createReply(
                      (ORB)messageMediator.getBroker(),
                      messageMediator.getGIOPVersion(),
                      messageMediator.getEncodingVersion(),
                      messageMediator.getRequestId(),
                      ReplyMessage.NEEDS_ADDRESSING_MODE,
                      null, null);
        // REVISIT: via acceptor factory.
        CDROutputObject outputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(
            (ORB)messageMediator.getBroker(),
            this,
            messageMediator.getGIOPVersion(),
            (CorbaConnection)messageMediator.getConnection(),
            replyHeader,
            ORBConstants.STREAM_FORMAT_VERSION_1);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        replyHeader.write(outputObject);
        AddressingDispositionHelper.write(outputObject,
                                          ex.expectedAddrDisp());
        return;

    case Message.GIOPLocateRequest :
        LocateReplyMessage locateReplyHeader = MessageBase.createLocateReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            LocateReplyMessage.LOC_NEEDS_ADDRESSING_MODE,
            null);

        addrDisp = ex.expectedAddrDisp();

        // REVISIT: via acceptor factory.
        outputObject =
            createAppropriateOutputObject(messageMediator,
                                          messageMediator.getRequestHeader(),
                                          locateReplyHeader);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        locateReplyHeader.write(outputObject);
        IOR ior = null;
        if (ior != null) {
            ior.write(outputObject);
        }
        if (addrDisp != -1) {
            AddressingDispositionHelper.write(outputObject, addrDisp);
        }
        return;
    }
}
 
Example 10
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ReplyMessage reply, IOR ior)
{
    // REVISIT - these should be invoked from subcontract.
    runServantPostInvoke(messageMediator);
    runInterceptors(messageMediator, reply);
    runRemoveThreadInfo(messageMediator);

    if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) {
        dprint(".createResponseHelper: "
               + opAndId(messageMediator) + ": "
               + reply);
    }

    messageMediator.setReplyHeader(reply);

    OutputObject replyOutputObject;
    // REVISIT = do not use null.
    //
    if (messageMediator.getConnection() == null) {
        replyOutputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(orb,
                        messageMediator, messageMediator.getReplyHeader(),
                        messageMediator.getStreamFormatVersion(),
                        BufferManagerFactory.GROW);
    } else {
        replyOutputObject = messageMediator.getConnection().getAcceptor()
         .createOutputObject(messageMediator.getBroker(), messageMediator);
    }
    messageMediator.setOutputObject(replyOutputObject);
    messageMediator.getOutputObject().setMessageMediator(messageMediator);

    reply.write((OutputStream) messageMediator.getOutputObject());
    if (reply.getIOR() != null) {
        reply.getIOR().write((OutputStream) messageMediator.getOutputObject());
    }
    // REVISIT - not necessary?
    //messageMediator.this.replyIOR = reply.getIOR();

    // NOTE: The mediator holds onto output object so return value
    // not really necessary.
    return messageMediator;
}
 
Example 11
Source File: CorbaMessageMediatorImpl.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
protected void handleAddressingDisposition(
    CorbaMessageMediator messageMediator,
    AddressingDispositionException ex)
{

    short addrDisp = -1;

    // from iiop.RequestProcessor.

    // Respond with expected target addressing disposition.

    switch (messageMediator.getRequestHeader().getType()) {
    case Message.GIOPRequest :
        ReplyMessage replyHeader = MessageBase.createReply(
                      (ORB)messageMediator.getBroker(),
                      messageMediator.getGIOPVersion(),
                      messageMediator.getEncodingVersion(),
                      messageMediator.getRequestId(),
                      ReplyMessage.NEEDS_ADDRESSING_MODE,
                      null, null);
        // REVISIT: via acceptor factory.
        CDROutputObject outputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(
            (ORB)messageMediator.getBroker(),
            this,
            messageMediator.getGIOPVersion(),
            (CorbaConnection)messageMediator.getConnection(),
            replyHeader,
            ORBConstants.STREAM_FORMAT_VERSION_1);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        replyHeader.write(outputObject);
        AddressingDispositionHelper.write(outputObject,
                                          ex.expectedAddrDisp());
        return;

    case Message.GIOPLocateRequest :
        LocateReplyMessage locateReplyHeader = MessageBase.createLocateReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            LocateReplyMessage.LOC_NEEDS_ADDRESSING_MODE,
            null);

        addrDisp = ex.expectedAddrDisp();

        // REVISIT: via acceptor factory.
        outputObject =
            createAppropriateOutputObject(messageMediator,
                                          messageMediator.getRequestHeader(),
                                          locateReplyHeader);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        locateReplyHeader.write(outputObject);
        IOR ior = null;
        if (ior != null) {
            ior.write(outputObject);
        }
        if (addrDisp != -1) {
            AddressingDispositionHelper.write(outputObject, addrDisp);
        }
        return;
    }
}
 
Example 12
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ReplyMessage reply, IOR ior)
{
    // REVISIT - these should be invoked from subcontract.
    runServantPostInvoke(messageMediator);
    runInterceptors(messageMediator, reply);
    runRemoveThreadInfo(messageMediator);

    if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) {
        dprint(".createResponseHelper: "
               + opAndId(messageMediator) + ": "
               + reply);
    }

    messageMediator.setReplyHeader(reply);

    OutputObject replyOutputObject;
    // REVISIT = do not use null.
    //
    if (messageMediator.getConnection() == null) {
        replyOutputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(orb,
                        messageMediator, messageMediator.getReplyHeader(),
                        messageMediator.getStreamFormatVersion(),
                        BufferManagerFactory.GROW);
    } else {
        replyOutputObject = messageMediator.getConnection().getAcceptor()
         .createOutputObject(messageMediator.getBroker(), messageMediator);
    }
    messageMediator.setOutputObject(replyOutputObject);
    messageMediator.getOutputObject().setMessageMediator(messageMediator);

    reply.write((OutputStream) messageMediator.getOutputObject());
    if (reply.getIOR() != null) {
        reply.getIOR().write((OutputStream) messageMediator.getOutputObject());
    }
    // REVISIT - not necessary?
    //messageMediator.this.replyIOR = reply.getIOR();

    // NOTE: The mediator holds onto output object so return value
    // not really necessary.
    return messageMediator;
}
 
Example 13
Source File: CorbaMessageMediatorImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected void handleAddressingDisposition(
    CorbaMessageMediator messageMediator,
    AddressingDispositionException ex)
{

    short addrDisp = -1;

    // from iiop.RequestProcessor.

    // Respond with expected target addressing disposition.

    switch (messageMediator.getRequestHeader().getType()) {
    case Message.GIOPRequest :
        ReplyMessage replyHeader = MessageBase.createReply(
                      (ORB)messageMediator.getBroker(),
                      messageMediator.getGIOPVersion(),
                      messageMediator.getEncodingVersion(),
                      messageMediator.getRequestId(),
                      ReplyMessage.NEEDS_ADDRESSING_MODE,
                      null, null);
        // REVISIT: via acceptor factory.
        CDROutputObject outputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(
            (ORB)messageMediator.getBroker(),
            this,
            messageMediator.getGIOPVersion(),
            (CorbaConnection)messageMediator.getConnection(),
            replyHeader,
            ORBConstants.STREAM_FORMAT_VERSION_1);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        replyHeader.write(outputObject);
        AddressingDispositionHelper.write(outputObject,
                                          ex.expectedAddrDisp());
        return;

    case Message.GIOPLocateRequest :
        LocateReplyMessage locateReplyHeader = MessageBase.createLocateReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            LocateReplyMessage.LOC_NEEDS_ADDRESSING_MODE,
            null);

        addrDisp = ex.expectedAddrDisp();

        // REVISIT: via acceptor factory.
        outputObject =
            createAppropriateOutputObject(messageMediator,
                                          messageMediator.getRequestHeader(),
                                          locateReplyHeader);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        locateReplyHeader.write(outputObject);
        IOR ior = null;
        if (ior != null) {
            ior.write(outputObject);
        }
        if (addrDisp != -1) {
            AddressingDispositionHelper.write(outputObject, addrDisp);
        }
        return;
    }
}
 
Example 14
Source File: CorbaMessageMediatorImpl.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ReplyMessage reply, IOR ior)
{
    // REVISIT - these should be invoked from subcontract.
    runServantPostInvoke(messageMediator);
    runInterceptors(messageMediator, reply);
    runRemoveThreadInfo(messageMediator);

    if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) {
        dprint(".createResponseHelper: "
               + opAndId(messageMediator) + ": "
               + reply);
    }

    messageMediator.setReplyHeader(reply);

    OutputObject replyOutputObject;
    // REVISIT = do not use null.
    //
    if (messageMediator.getConnection() == null) {
        replyOutputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(orb,
                        messageMediator, messageMediator.getReplyHeader(),
                        messageMediator.getStreamFormatVersion(),
                        BufferManagerFactory.GROW);
    } else {
        replyOutputObject = messageMediator.getConnection().getAcceptor()
         .createOutputObject(messageMediator.getBroker(), messageMediator);
    }
    messageMediator.setOutputObject(replyOutputObject);
    messageMediator.getOutputObject().setMessageMediator(messageMediator);

    reply.write((OutputStream) messageMediator.getOutputObject());
    if (reply.getIOR() != null) {
        reply.getIOR().write((OutputStream) messageMediator.getOutputObject());
    }
    // REVISIT - not necessary?
    //messageMediator.this.replyIOR = reply.getIOR();

    // NOTE: The mediator holds onto output object so return value
    // not really necessary.
    return messageMediator;
}
 
Example 15
Source File: CorbaMessageMediatorImpl.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
protected void handleAddressingDisposition(
    CorbaMessageMediator messageMediator,
    AddressingDispositionException ex)
{

    short addrDisp = -1;

    // from iiop.RequestProcessor.

    // Respond with expected target addressing disposition.

    switch (messageMediator.getRequestHeader().getType()) {
    case Message.GIOPRequest :
        ReplyMessage replyHeader = MessageBase.createReply(
                      (ORB)messageMediator.getBroker(),
                      messageMediator.getGIOPVersion(),
                      messageMediator.getEncodingVersion(),
                      messageMediator.getRequestId(),
                      ReplyMessage.NEEDS_ADDRESSING_MODE,
                      null, null);
        // REVISIT: via acceptor factory.
        CDROutputObject outputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(
            (ORB)messageMediator.getBroker(),
            this,
            messageMediator.getGIOPVersion(),
            (CorbaConnection)messageMediator.getConnection(),
            replyHeader,
            ORBConstants.STREAM_FORMAT_VERSION_1);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        replyHeader.write(outputObject);
        AddressingDispositionHelper.write(outputObject,
                                          ex.expectedAddrDisp());
        return;

    case Message.GIOPLocateRequest :
        LocateReplyMessage locateReplyHeader = MessageBase.createLocateReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            LocateReplyMessage.LOC_NEEDS_ADDRESSING_MODE,
            null);

        addrDisp = ex.expectedAddrDisp();

        // REVISIT: via acceptor factory.
        outputObject =
            createAppropriateOutputObject(messageMediator,
                                          messageMediator.getRequestHeader(),
                                          locateReplyHeader);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        locateReplyHeader.write(outputObject);
        IOR ior = null;
        if (ior != null) {
            ior.write(outputObject);
        }
        if (addrDisp != -1) {
            AddressingDispositionHelper.write(outputObject, addrDisp);
        }
        return;
    }
}
 
Example 16
Source File: CorbaMessageMediatorImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ReplyMessage reply, IOR ior)
{
    // REVISIT - these should be invoked from subcontract.
    runServantPostInvoke(messageMediator);
    runInterceptors(messageMediator, reply);
    runRemoveThreadInfo(messageMediator);

    if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) {
        dprint(".createResponseHelper: "
               + opAndId(messageMediator) + ": "
               + reply);
    }

    messageMediator.setReplyHeader(reply);

    OutputObject replyOutputObject;
    // REVISIT = do not use null.
    //
    if (messageMediator.getConnection() == null) {
        replyOutputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(orb,
                        messageMediator, messageMediator.getReplyHeader(),
                        messageMediator.getStreamFormatVersion(),
                        BufferManagerFactory.GROW);
    } else {
        replyOutputObject = messageMediator.getConnection().getAcceptor()
         .createOutputObject(messageMediator.getBroker(), messageMediator);
    }
    messageMediator.setOutputObject(replyOutputObject);
    messageMediator.getOutputObject().setMessageMediator(messageMediator);

    reply.write((OutputStream) messageMediator.getOutputObject());
    if (reply.getIOR() != null) {
        reply.getIOR().write((OutputStream) messageMediator.getOutputObject());
    }
    // REVISIT - not necessary?
    //messageMediator.this.replyIOR = reply.getIOR();

    // NOTE: The mediator holds onto output object so return value
    // not really necessary.
    return messageMediator;
}
 
Example 17
Source File: CorbaMessageMediatorImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected void handleAddressingDisposition(
    CorbaMessageMediator messageMediator,
    AddressingDispositionException ex)
{

    short addrDisp = -1;

    // from iiop.RequestProcessor.

    // Respond with expected target addressing disposition.

    switch (messageMediator.getRequestHeader().getType()) {
    case Message.GIOPRequest :
        ReplyMessage replyHeader = MessageBase.createReply(
                      (ORB)messageMediator.getBroker(),
                      messageMediator.getGIOPVersion(),
                      messageMediator.getEncodingVersion(),
                      messageMediator.getRequestId(),
                      ReplyMessage.NEEDS_ADDRESSING_MODE,
                      null, null);
        // REVISIT: via acceptor factory.
        CDROutputObject outputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(
            (ORB)messageMediator.getBroker(),
            this,
            messageMediator.getGIOPVersion(),
            (CorbaConnection)messageMediator.getConnection(),
            replyHeader,
            ORBConstants.STREAM_FORMAT_VERSION_1);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        replyHeader.write(outputObject);
        AddressingDispositionHelper.write(outputObject,
                                          ex.expectedAddrDisp());
        return;

    case Message.GIOPLocateRequest :
        LocateReplyMessage locateReplyHeader = MessageBase.createLocateReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            LocateReplyMessage.LOC_NEEDS_ADDRESSING_MODE,
            null);

        addrDisp = ex.expectedAddrDisp();

        // REVISIT: via acceptor factory.
        outputObject =
            createAppropriateOutputObject(messageMediator,
                                          messageMediator.getRequestHeader(),
                                          locateReplyHeader);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        locateReplyHeader.write(outputObject);
        IOR ior = null;
        if (ior != null) {
            ior.write(outputObject);
        }
        if (addrDisp != -1) {
            AddressingDispositionHelper.write(outputObject, addrDisp);
        }
        return;
    }
}
 
Example 18
Source File: CorbaMessageMediatorImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ReplyMessage reply, IOR ior)
{
    // REVISIT - these should be invoked from subcontract.
    runServantPostInvoke(messageMediator);
    runInterceptors(messageMediator, reply);
    runRemoveThreadInfo(messageMediator);

    if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) {
        dprint(".createResponseHelper: "
               + opAndId(messageMediator) + ": "
               + reply);
    }

    messageMediator.setReplyHeader(reply);

    OutputObject replyOutputObject;
    // REVISIT = do not use null.
    //
    if (messageMediator.getConnection() == null) {
        replyOutputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(orb,
                        messageMediator, messageMediator.getReplyHeader(),
                        messageMediator.getStreamFormatVersion(),
                        BufferManagerFactory.GROW);
    } else {
        replyOutputObject = messageMediator.getConnection().getAcceptor()
         .createOutputObject(messageMediator.getBroker(), messageMediator);
    }
    messageMediator.setOutputObject(replyOutputObject);
    messageMediator.getOutputObject().setMessageMediator(messageMediator);

    reply.write((OutputStream) messageMediator.getOutputObject());
    if (reply.getIOR() != null) {
        reply.getIOR().write((OutputStream) messageMediator.getOutputObject());
    }
    // REVISIT - not necessary?
    //messageMediator.this.replyIOR = reply.getIOR();

    // NOTE: The mediator holds onto output object so return value
    // not really necessary.
    return messageMediator;
}
 
Example 19
Source File: CorbaMessageMediatorImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected void handleAddressingDisposition(
    CorbaMessageMediator messageMediator,
    AddressingDispositionException ex)
{

    short addrDisp = -1;

    // from iiop.RequestProcessor.

    // Respond with expected target addressing disposition.

    switch (messageMediator.getRequestHeader().getType()) {
    case Message.GIOPRequest :
        ReplyMessage replyHeader = MessageBase.createReply(
                      (ORB)messageMediator.getBroker(),
                      messageMediator.getGIOPVersion(),
                      messageMediator.getEncodingVersion(),
                      messageMediator.getRequestId(),
                      ReplyMessage.NEEDS_ADDRESSING_MODE,
                      null, null);
        // REVISIT: via acceptor factory.
        CDROutputObject outputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(
            (ORB)messageMediator.getBroker(),
            this,
            messageMediator.getGIOPVersion(),
            (CorbaConnection)messageMediator.getConnection(),
            replyHeader,
            ORBConstants.STREAM_FORMAT_VERSION_1);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        replyHeader.write(outputObject);
        AddressingDispositionHelper.write(outputObject,
                                          ex.expectedAddrDisp());
        return;

    case Message.GIOPLocateRequest :
        LocateReplyMessage locateReplyHeader = MessageBase.createLocateReply(
            (ORB)messageMediator.getBroker(),
            messageMediator.getGIOPVersion(),
            messageMediator.getEncodingVersion(),
            messageMediator.getRequestId(),
            LocateReplyMessage.LOC_NEEDS_ADDRESSING_MODE,
            null);

        addrDisp = ex.expectedAddrDisp();

        // REVISIT: via acceptor factory.
        outputObject =
            createAppropriateOutputObject(messageMediator,
                                          messageMediator.getRequestHeader(),
                                          locateReplyHeader);
        messageMediator.setOutputObject(outputObject);
        outputObject.setMessageMediator(messageMediator);
        locateReplyHeader.write(outputObject);
        IOR ior = null;
        if (ior != null) {
            ior.write(outputObject);
        }
        if (addrDisp != -1) {
            AddressingDispositionHelper.write(outputObject, addrDisp);
        }
        return;
    }
}
 
Example 20
Source File: CorbaMessageMediatorImpl.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
protected CorbaMessageMediator createResponseHelper(
    CorbaMessageMediator messageMediator, ReplyMessage reply, IOR ior)
{
    // REVISIT - these should be invoked from subcontract.
    runServantPostInvoke(messageMediator);
    runInterceptors(messageMediator, reply);
    runRemoveThreadInfo(messageMediator);

    if (((ORB)messageMediator.getBroker()).subcontractDebugFlag) {
        dprint(".createResponseHelper: "
               + opAndId(messageMediator) + ": "
               + reply);
    }

    messageMediator.setReplyHeader(reply);

    OutputObject replyOutputObject;
    // REVISIT = do not use null.
    //
    if (messageMediator.getConnection() == null) {
        replyOutputObject =
            sun.corba.OutputStreamFactory.newCDROutputObject(orb,
                        messageMediator, messageMediator.getReplyHeader(),
                        messageMediator.getStreamFormatVersion(),
                        BufferManagerFactory.GROW);
    } else {
        replyOutputObject = messageMediator.getConnection().getAcceptor()
         .createOutputObject(messageMediator.getBroker(), messageMediator);
    }
    messageMediator.setOutputObject(replyOutputObject);
    messageMediator.getOutputObject().setMessageMediator(messageMediator);

    reply.write((OutputStream) messageMediator.getOutputObject());
    if (reply.getIOR() != null) {
        reply.getIOR().write((OutputStream) messageMediator.getOutputObject());
    }
    // REVISIT - not necessary?
    //messageMediator.this.replyIOR = reply.getIOR();

    // NOTE: The mediator holds onto output object so return value
    // not really necessary.
    return messageMediator;
}