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


Java OutputObject.close方法代码示例

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


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

示例1: endRequest

import com.sun.corba.se.pept.encoding.OutputObject; //导入方法依赖的package包/类
private void endRequest(CorbaMessageMediator messageMediator)
{
    ORB orb = (ORB) messageMediator.getBroker();
    if (orb.subcontractDebugFlag) {
        dprint(".handleRequest<-: " + opAndId(messageMediator));
    }

    // release NIO ByteBuffers to ByteBufferPool

    try {
        OutputObject outputObj = messageMediator.getOutputObject();
        if (outputObj != null) {
            outputObj.close();
        }
        InputObject inputObj = messageMediator.getInputObject();
        if (inputObj != null) {
            inputObj.close();
        }
    } catch (IOException ex) {
        // Given what close() does, this catch shouldn't ever happen.
        // See CDRInput/OutputObject.close() for more info.
        // It also won't result in a Corba error if an IOException happens.
        if (orb.subcontractDebugFlag) {
            dprint(".endRequest: IOException:" + ex.getMessage(), ex);
        }
    } finally {
        ((CorbaConnection)messageMediator.getConnection()).serverRequestProcessingEnds();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:CorbaMessageMediatorImpl.java

示例2: endRequest

import com.sun.corba.se.pept.encoding.OutputObject; //导入方法依赖的package包/类
public void endRequest(Broker broker, Object self, InputObject inputObject)
{
    ORB orb = (ORB)broker ;

    try {
        if (orb.subcontractDebugFlag) {
            dprint(".endRequest->");
        }

        // Note: the inputObject may be null if an error occurs
        //       in request or before _invoke returns.
        // Note: self may be null also (e.g., compiler generates null in stub).

        MessageMediator messageMediator =
            orb.getInvocationInfo().getMessageMediator();
        if (messageMediator != null)
        {
            if (messageMediator.getConnection() != null)
            {
                ((CorbaMessageMediator)messageMediator)
                          .sendCancelRequestIfFinalFragmentNotSent();
            }

            // Release any outstanding NIO ByteBuffers to the ByteBufferPool

            InputObject inputObj = messageMediator.getInputObject();
            if (inputObj != null) {
                inputObj.close();
            }

            OutputObject outputObj = messageMediator.getOutputObject();
            if (outputObj != null) {
                outputObj.close();
            }

        }

        // XREVISIT NOTE - Assumes unregistering the waiter for
        // location forwards has already happened somewhere else.
        // The code below is only going to unregister the final successful
        // request.

        // NOTE: In the case of a recursive stack of endRequests in a
        // finally block (because of Remarshal) only the first call to
        // unregisterWaiter will remove the waiter.  The rest will be
        // noops.
        unregisterWaiter(orb);

        // Invoke Portable Interceptors cleanup.  This is done to handle
        // exceptions during stream marshaling.  More generally, exceptions
        // that occur in the ORB after send_request (which includes
        // after returning from _request) before _invoke:
        orb.getPIHandler().cleanupClientPIRequest();

        // REVISIT: Early replies?
    } catch (IOException ex) {
        // See CDRInput/OutputObject.close() for more info.
        // This won't result in a Corba error if an IOException happens.
        if (orb.subcontractDebugFlag)
        {
            dprint(".endRequest: ignoring IOException - " + ex.toString());
        }
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".endRequest<-");
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:69,代码来源:CorbaClientRequestDispatcherImpl.java


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