本文整理汇总了Java中com.sun.corba.se.impl.encoding.CDROutputObject.writeTo方法的典型用法代码示例。如果您正苦于以下问题:Java CDROutputObject.writeTo方法的具体用法?Java CDROutputObject.writeTo怎么用?Java CDROutputObject.writeTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.corba.se.impl.encoding.CDROutputObject
的用法示例。
在下文中一共展示了CDROutputObject.writeTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendHelper
import com.sun.corba.se.impl.encoding.CDROutputObject; //导入方法依赖的package包/类
protected void sendHelper(GIOPVersion giopVersion, Message msg)
throws IOException
{
// REVISIT: See comments in CDROutputObject constructor.
CDROutputObject outputObject =
sun.corba.OutputStreamFactory.newCDROutputObject((ORB)orb, null, giopVersion,
this, msg, ORBConstants.STREAM_FORMAT_VERSION_1);
msg.write(outputObject);
outputObject.writeTo(this);
}
示例2: sendHelper
import com.sun.corba.se.impl.encoding.CDROutputObject; //导入方法依赖的package包/类
protected void sendHelper(GIOPVersion giopVersion, Message msg)
throws IOException
{
// REVISIT: See comments in CDROutputObject constructor.
CDROutputObject outputObject =
new CDROutputObject((ORB)orb, null, giopVersion, this, msg,
ORBConstants.STREAM_FORMAT_VERSION_1);
msg.write(outputObject);
outputObject.writeTo(this);
}
示例3: sendWithoutLock
import com.sun.corba.se.impl.encoding.CDROutputObject; //导入方法依赖的package包/类
public void sendWithoutLock(OutputObject outputObject)
{
// Don't we need to check for CloseConnection
// here? REVISIT
// XREVISIT - Shouldn't the MessageMediator
// be the one to handle writing the data here?
try {
// Write the fragment/message
CDROutputObject cdrOutputObject = (CDROutputObject) outputObject;
cdrOutputObject.writeTo(this);
// REVISIT - no flush?
//socket.getOutputStream().flush();
} catch (IOException e1) {
/*
* ADDED(Ram J) 10/13/2000 In the event of an IOException, try
* sending a CancelRequest for regular requests / locate requests
*/
// Since IIOPOutputStream's msgheader is set only once, and not
// altered during sending multiple fragments, the original
// msgheader will always have the requestId.
// REVISIT This could be optimized to send a CancelRequest only
// if any fragments had been sent already.
/* REVISIT: MOVE TO SUBCONTRACT
Message msg = os.getMessage();
if (msg.getType() == Message.GIOPRequest ||
msg.getType() == Message.GIOPLocateRequest) {
GIOPVersion requestVersion = msg.getGIOPVersion();
int requestId = MessageBase.getRequestId(msg);
try {
sendCancelRequest(requestVersion, requestId);
} catch (IOException e2) {
// most likely an abortive connection closure.
// ignore, since nothing more can be done.
if (orb.transportDebugFlag) {
}
}
*/
// REVISIT When a send failure happens, purgeCalls() need to be
// called to ensure that the connection is properly removed from
// further usage (ie., cancelling pending requests with COMM_FAILURE
// with an appropriate minor_code CompletionStatus.MAY_BE).
// Relying on the IIOPOutputStream (as noted below) is not
// sufficient as it handles COMM_FAILURE only for the final
// fragment (during invoke processing). Note that COMM_FAILURE could
// happen while sending the initial fragments.
// Also the IIOPOutputStream does not properly close the connection.
// It simply removes the connection from the table. An orderly
// closure is needed (ie., cancel pending requests on the connection
// COMM_FAILURE as well.
// IIOPOutputStream will cleanup the connection info when it
// sees this exception.
SystemException exc = wrapper.writeErrorSend(e1);
purgeCalls(exc, false, true);
throw exc;
}
}