当前位置: 首页>>代码示例>>Java>>正文


Java CorbaMessageMediator.setReplyHeader方法代码示例

本文整理汇总了Java中com.sun.corba.se.spi.protocol.CorbaMessageMediator.setReplyHeader方法的典型用法代码示例。如果您正苦于以下问题:Java CorbaMessageMediator.setReplyHeader方法的具体用法?Java CorbaMessageMediator.setReplyHeader怎么用?Java CorbaMessageMediator.setReplyHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.corba.se.spi.protocol.CorbaMessageMediator的用法示例。


在下文中一共展示了CorbaMessageMediator.setReplyHeader方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createResponseHelper

import com.sun.corba.se.spi.protocol.CorbaMessageMediator; //导入方法依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:44,代码来源:CorbaMessageMediatorImpl.java

示例2: responseReceived

import com.sun.corba.se.spi.protocol.CorbaMessageMediator; //导入方法依赖的package包/类
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();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:55,代码来源:CorbaResponseWaitingRoomImpl.java


注:本文中的com.sun.corba.se.spi.protocol.CorbaMessageMediator.setReplyHeader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。