Java Code Examples for com.sun.corba.se.spi.protocol.CorbaMessageMediator#setReplyHeader()

The following examples show how to use com.sun.corba.se.spi.protocol.CorbaMessageMediator#setReplyHeader() . 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 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 2
Source File: CorbaResponseWaitingRoomImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void responseReceived(InputObject is)
{
    CDRInputObject inputObject = (CDRInputObject) is;
    LocateReplyOrReplyMessage header = (LocateReplyOrReplyMessage)
        inputObject.getMessageHeader();
    Integer requestId = new Integer(header.getRequestId());
    OutCallDesc call = out_calls.get(requestId);

    if (orb.transportDebugFlag) {
        dprint(".responseReceived: id/"
               + requestId  + ": "
               + header);
    }

    // This is an interesting case.  It could mean that someone sent us a
    // reply message, but we don't know what request it was for.  That
    // would probably call for an error.  However, there's another case
    // that's normal and we should think about --
    //
    // If the unmarshaling thread does all of its work inbetween the time
    // the ReaderThread gives it the last fragment and gets to the
    // out_calls.get line, then it will also be null, so just return;
    if (call == null) {
        if (orb.transportDebugFlag) {
            dprint(".responseReceived: id/"
                   + requestId
                   + ": no waiter: "
                   + header);
        }
        return;
    }

    // Set the reply InputObject and signal the client thread
    // that the reply has been received.
    // The thread signalled will remove outcall descriptor if appropriate.
    // Otherwise, it'll be removed when last fragment for it has been put on
    // BufferManagerRead's queue.
    synchronized (call.done) {
        CorbaMessageMediator messageMediator = (CorbaMessageMediator)
            call.messageMediator;

        if (orb.transportDebugFlag) {
            dprint(".responseReceived: "
                   + opAndId(messageMediator)
                   + ": notifying waiters");
        }

        messageMediator.setReplyHeader(header);
        messageMediator.setInputObject(is);
        inputObject.setMessageMediator(messageMediator);
        call.inputObject = is;
        call.done.notify();
    }
}
 
Example 3
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 4
Source File: CorbaResponseWaitingRoomImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void responseReceived(InputObject is)
{
    CDRInputObject inputObject = (CDRInputObject) is;
    LocateReplyOrReplyMessage header = (LocateReplyOrReplyMessage)
        inputObject.getMessageHeader();
    Integer requestId = new Integer(header.getRequestId());
    OutCallDesc call = out_calls.get(requestId);

    if (orb.transportDebugFlag) {
        dprint(".responseReceived: id/"
               + requestId  + ": "
               + header);
    }

    // This is an interesting case.  It could mean that someone sent us a
    // reply message, but we don't know what request it was for.  That
    // would probably call for an error.  However, there's another case
    // that's normal and we should think about --
    //
    // If the unmarshaling thread does all of its work inbetween the time
    // the ReaderThread gives it the last fragment and gets to the
    // out_calls.get line, then it will also be null, so just return;
    if (call == null) {
        if (orb.transportDebugFlag) {
            dprint(".responseReceived: id/"
                   + requestId
                   + ": no waiter: "
                   + header);
        }
        return;
    }

    // Set the reply InputObject and signal the client thread
    // that the reply has been received.
    // The thread signalled will remove outcall descriptor if appropriate.
    // Otherwise, it'll be removed when last fragment for it has been put on
    // BufferManagerRead's queue.
    synchronized (call.done) {
        CorbaMessageMediator messageMediator = (CorbaMessageMediator)
            call.messageMediator;

        if (orb.transportDebugFlag) {
            dprint(".responseReceived: "
                   + opAndId(messageMediator)
                   + ": notifying waiters");
        }

        messageMediator.setReplyHeader(header);
        messageMediator.setInputObject(is);
        inputObject.setMessageMediator(messageMediator);
        call.inputObject = is;
        call.done.notify();
    }
}
 
Example 5
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 6
Source File: CorbaResponseWaitingRoomImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void responseReceived(InputObject is)
{
    CDRInputObject inputObject = (CDRInputObject) is;
    LocateReplyOrReplyMessage header = (LocateReplyOrReplyMessage)
        inputObject.getMessageHeader();
    Integer requestId = new Integer(header.getRequestId());
    OutCallDesc call = out_calls.get(requestId);

    if (orb.transportDebugFlag) {
        dprint(".responseReceived: id/"
               + requestId  + ": "
               + header);
    }

    // This is an interesting case.  It could mean that someone sent us a
    // reply message, but we don't know what request it was for.  That
    // would probably call for an error.  However, there's another case
    // that's normal and we should think about --
    //
    // If the unmarshaling thread does all of its work inbetween the time
    // the ReaderThread gives it the last fragment and gets to the
    // out_calls.get line, then it will also be null, so just return;
    if (call == null) {
        if (orb.transportDebugFlag) {
            dprint(".responseReceived: id/"
                   + requestId
                   + ": no waiter: "
                   + header);
        }
        return;
    }

    // Set the reply InputObject and signal the client thread
    // that the reply has been received.
    // The thread signalled will remove outcall descriptor if appropriate.
    // Otherwise, it'll be removed when last fragment for it has been put on
    // BufferManagerRead's queue.
    synchronized (call.done) {
        CorbaMessageMediator messageMediator = (CorbaMessageMediator)
            call.messageMediator;

        if (orb.transportDebugFlag) {
            dprint(".responseReceived: "
                   + opAndId(messageMediator)
                   + ": notifying waiters");
        }

        messageMediator.setReplyHeader(header);
        messageMediator.setInputObject(is);
        inputObject.setMessageMediator(messageMediator);
        call.inputObject = is;
        call.done.notify();
    }
}
 
Example 7
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 8
Source File: CorbaResponseWaitingRoomImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void responseReceived(InputObject is)
{
    CDRInputObject inputObject = (CDRInputObject) is;
    LocateReplyOrReplyMessage header = (LocateReplyOrReplyMessage)
        inputObject.getMessageHeader();
    Integer requestId = new Integer(header.getRequestId());
    OutCallDesc call = out_calls.get(requestId);

    if (orb.transportDebugFlag) {
        dprint(".responseReceived: id/"
               + requestId  + ": "
               + header);
    }

    // This is an interesting case.  It could mean that someone sent us a
    // reply message, but we don't know what request it was for.  That
    // would probably call for an error.  However, there's another case
    // that's normal and we should think about --
    //
    // If the unmarshaling thread does all of its work inbetween the time
    // the ReaderThread gives it the last fragment and gets to the
    // out_calls.get line, then it will also be null, so just return;
    if (call == null) {
        if (orb.transportDebugFlag) {
            dprint(".responseReceived: id/"
                   + requestId
                   + ": no waiter: "
                   + header);
        }
        return;
    }

    // Set the reply InputObject and signal the client thread
    // that the reply has been received.
    // The thread signalled will remove outcall descriptor if appropriate.
    // Otherwise, it'll be removed when last fragment for it has been put on
    // BufferManagerRead's queue.
    synchronized (call.done) {
        CorbaMessageMediator messageMediator = (CorbaMessageMediator)
            call.messageMediator;

        if (orb.transportDebugFlag) {
            dprint(".responseReceived: "
                   + opAndId(messageMediator)
                   + ": notifying waiters");
        }

        messageMediator.setReplyHeader(header);
        messageMediator.setInputObject(is);
        inputObject.setMessageMediator(messageMediator);
        call.inputObject = is;
        call.done.notify();
    }
}
 
Example 9
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 10
Source File: CorbaResponseWaitingRoomImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void responseReceived(InputObject is)
{
    CDRInputObject inputObject = (CDRInputObject) is;
    LocateReplyOrReplyMessage header = (LocateReplyOrReplyMessage)
        inputObject.getMessageHeader();
    Integer requestId = new Integer(header.getRequestId());
    OutCallDesc call = out_calls.get(requestId);

    if (orb.transportDebugFlag) {
        dprint(".responseReceived: id/"
               + requestId  + ": "
               + header);
    }

    // This is an interesting case.  It could mean that someone sent us a
    // reply message, but we don't know what request it was for.  That
    // would probably call for an error.  However, there's another case
    // that's normal and we should think about --
    //
    // If the unmarshaling thread does all of its work inbetween the time
    // the ReaderThread gives it the last fragment and gets to the
    // out_calls.get line, then it will also be null, so just return;
    if (call == null) {
        if (orb.transportDebugFlag) {
            dprint(".responseReceived: id/"
                   + requestId
                   + ": no waiter: "
                   + header);
        }
        return;
    }

    // Set the reply InputObject and signal the client thread
    // that the reply has been received.
    // The thread signalled will remove outcall descriptor if appropriate.
    // Otherwise, it'll be removed when last fragment for it has been put on
    // BufferManagerRead's queue.
    synchronized (call.done) {
        CorbaMessageMediator messageMediator = (CorbaMessageMediator)
            call.messageMediator;

        if (orb.transportDebugFlag) {
            dprint(".responseReceived: "
                   + opAndId(messageMediator)
                   + ": notifying waiters");
        }

        messageMediator.setReplyHeader(header);
        messageMediator.setInputObject(is);
        inputObject.setMessageMediator(messageMediator);
        call.inputObject = is;
        call.done.notify();
    }
}
 
Example 11
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;
}
 
Example 12
Source File: CorbaResponseWaitingRoomImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void responseReceived(InputObject is)
{
    CDRInputObject inputObject = (CDRInputObject) is;
    LocateReplyOrReplyMessage header = (LocateReplyOrReplyMessage)
        inputObject.getMessageHeader();
    Integer requestId = new Integer(header.getRequestId());
    OutCallDesc call = out_calls.get(requestId);

    if (orb.transportDebugFlag) {
        dprint(".responseReceived: id/"
               + requestId  + ": "
               + header);
    }

    // This is an interesting case.  It could mean that someone sent us a
    // reply message, but we don't know what request it was for.  That
    // would probably call for an error.  However, there's another case
    // that's normal and we should think about --
    //
    // If the unmarshaling thread does all of its work inbetween the time
    // the ReaderThread gives it the last fragment and gets to the
    // out_calls.get line, then it will also be null, so just return;
    if (call == null) {
        if (orb.transportDebugFlag) {
            dprint(".responseReceived: id/"
                   + requestId
                   + ": no waiter: "
                   + header);
        }
        return;
    }

    // Set the reply InputObject and signal the client thread
    // that the reply has been received.
    // The thread signalled will remove outcall descriptor if appropriate.
    // Otherwise, it'll be removed when last fragment for it has been put on
    // BufferManagerRead's queue.
    synchronized (call.done) {
        CorbaMessageMediator messageMediator = (CorbaMessageMediator)
            call.messageMediator;

        if (orb.transportDebugFlag) {
            dprint(".responseReceived: "
                   + opAndId(messageMediator)
                   + ": notifying waiters");
        }

        messageMediator.setReplyHeader(header);
        messageMediator.setInputObject(is);
        inputObject.setMessageMediator(messageMediator);
        call.inputObject = is;
        call.done.notify();
    }
}
 
Example 13
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 14
Source File: CorbaResponseWaitingRoomImpl.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public void responseReceived(InputObject is)
{
    CDRInputObject inputObject = (CDRInputObject) is;
    LocateReplyOrReplyMessage header = (LocateReplyOrReplyMessage)
        inputObject.getMessageHeader();
    Integer requestId = new Integer(header.getRequestId());
    OutCallDesc call = out_calls.get(requestId);

    if (orb.transportDebugFlag) {
        dprint(".responseReceived: id/"
               + requestId  + ": "
               + header);
    }

    // This is an interesting case.  It could mean that someone sent us a
    // reply message, but we don't know what request it was for.  That
    // would probably call for an error.  However, there's another case
    // that's normal and we should think about --
    //
    // If the unmarshaling thread does all of its work inbetween the time
    // the ReaderThread gives it the last fragment and gets to the
    // out_calls.get line, then it will also be null, so just return;
    if (call == null) {
        if (orb.transportDebugFlag) {
            dprint(".responseReceived: id/"
                   + requestId
                   + ": no waiter: "
                   + header);
        }
        return;
    }

    // Set the reply InputObject and signal the client thread
    // that the reply has been received.
    // The thread signalled will remove outcall descriptor if appropriate.
    // Otherwise, it'll be removed when last fragment for it has been put on
    // BufferManagerRead's queue.
    synchronized (call.done) {
        CorbaMessageMediator messageMediator = (CorbaMessageMediator)
            call.messageMediator;

        if (orb.transportDebugFlag) {
            dprint(".responseReceived: "
                   + opAndId(messageMediator)
                   + ": notifying waiters");
        }

        messageMediator.setReplyHeader(header);
        messageMediator.setInputObject(is);
        inputObject.setMessageMediator(messageMediator);
        call.inputObject = is;
        call.done.notify();
    }
}
 
Example 15
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 16
Source File: CorbaResponseWaitingRoomImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void responseReceived(InputObject is)
{
    CDRInputObject inputObject = (CDRInputObject) is;
    LocateReplyOrReplyMessage header = (LocateReplyOrReplyMessage)
        inputObject.getMessageHeader();
    Integer requestId = new Integer(header.getRequestId());
    OutCallDesc call = out_calls.get(requestId);

    if (orb.transportDebugFlag) {
        dprint(".responseReceived: id/"
               + requestId  + ": "
               + header);
    }

    // This is an interesting case.  It could mean that someone sent us a
    // reply message, but we don't know what request it was for.  That
    // would probably call for an error.  However, there's another case
    // that's normal and we should think about --
    //
    // If the unmarshaling thread does all of its work inbetween the time
    // the ReaderThread gives it the last fragment and gets to the
    // out_calls.get line, then it will also be null, so just return;
    if (call == null) {
        if (orb.transportDebugFlag) {
            dprint(".responseReceived: id/"
                   + requestId
                   + ": no waiter: "
                   + header);
        }
        return;
    }

    // Set the reply InputObject and signal the client thread
    // that the reply has been received.
    // The thread signalled will remove outcall descriptor if appropriate.
    // Otherwise, it'll be removed when last fragment for it has been put on
    // BufferManagerRead's queue.
    synchronized (call.done) {
        CorbaMessageMediator messageMediator = (CorbaMessageMediator)
            call.messageMediator;

        if (orb.transportDebugFlag) {
            dprint(".responseReceived: "
                   + opAndId(messageMediator)
                   + ": notifying waiters");
        }

        messageMediator.setReplyHeader(header);
        messageMediator.setInputObject(is);
        inputObject.setMessageMediator(messageMediator);
        call.inputObject = is;
        call.done.notify();
    }
}
 
Example 17
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 18
Source File: CorbaResponseWaitingRoomImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void responseReceived(InputObject is)
{
    CDRInputObject inputObject = (CDRInputObject) is;
    LocateReplyOrReplyMessage header = (LocateReplyOrReplyMessage)
        inputObject.getMessageHeader();
    Integer requestId = new Integer(header.getRequestId());
    OutCallDesc call = out_calls.get(requestId);

    if (orb.transportDebugFlag) {
        dprint(".responseReceived: id/"
               + requestId  + ": "
               + header);
    }

    // This is an interesting case.  It could mean that someone sent us a
    // reply message, but we don't know what request it was for.  That
    // would probably call for an error.  However, there's another case
    // that's normal and we should think about --
    //
    // If the unmarshaling thread does all of its work inbetween the time
    // the ReaderThread gives it the last fragment and gets to the
    // out_calls.get line, then it will also be null, so just return;
    if (call == null) {
        if (orb.transportDebugFlag) {
            dprint(".responseReceived: id/"
                   + requestId
                   + ": no waiter: "
                   + header);
        }
        return;
    }

    // Set the reply InputObject and signal the client thread
    // that the reply has been received.
    // The thread signalled will remove outcall descriptor if appropriate.
    // Otherwise, it'll be removed when last fragment for it has been put on
    // BufferManagerRead's queue.
    synchronized (call.done) {
        CorbaMessageMediator messageMediator = (CorbaMessageMediator)
            call.messageMediator;

        if (orb.transportDebugFlag) {
            dprint(".responseReceived: "
                   + opAndId(messageMediator)
                   + ": notifying waiters");
        }

        messageMediator.setReplyHeader(header);
        messageMediator.setInputObject(is);
        inputObject.setMessageMediator(messageMediator);
        call.inputObject = is;
        call.done.notify();
    }
}
 
Example 19
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 20
Source File: CorbaResponseWaitingRoomImpl.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public void responseReceived(InputObject is)
{
    CDRInputObject inputObject = (CDRInputObject) is;
    LocateReplyOrReplyMessage header = (LocateReplyOrReplyMessage)
        inputObject.getMessageHeader();
    Integer requestId = new Integer(header.getRequestId());
    OutCallDesc call = out_calls.get(requestId);

    if (orb.transportDebugFlag) {
        dprint(".responseReceived: id/"
               + requestId  + ": "
               + header);
    }

    // This is an interesting case.  It could mean that someone sent us a
    // reply message, but we don't know what request it was for.  That
    // would probably call for an error.  However, there's another case
    // that's normal and we should think about --
    //
    // If the unmarshaling thread does all of its work inbetween the time
    // the ReaderThread gives it the last fragment and gets to the
    // out_calls.get line, then it will also be null, so just return;
    if (call == null) {
        if (orb.transportDebugFlag) {
            dprint(".responseReceived: id/"
                   + requestId
                   + ": no waiter: "
                   + header);
        }
        return;
    }

    // Set the reply InputObject and signal the client thread
    // that the reply has been received.
    // The thread signalled will remove outcall descriptor if appropriate.
    // Otherwise, it'll be removed when last fragment for it has been put on
    // BufferManagerRead's queue.
    synchronized (call.done) {
        CorbaMessageMediator messageMediator = (CorbaMessageMediator)
            call.messageMediator;

        if (orb.transportDebugFlag) {
            dprint(".responseReceived: "
                   + opAndId(messageMediator)
                   + ": notifying waiters");
        }

        messageMediator.setReplyHeader(header);
        messageMediator.setInputObject(is);
        inputObject.setMessageMediator(messageMediator);
        call.inputObject = is;
        call.done.notify();
    }
}