本文整理汇总了Java中com.sun.corba.se.pept.protocol.MessageMediator.getOutputObject方法的典型用法代码示例。如果您正苦于以下问题:Java MessageMediator.getOutputObject方法的具体用法?Java MessageMediator.getOutputObject怎么用?Java MessageMediator.getOutputObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.corba.se.pept.protocol.MessageMediator
的用法示例。
在下文中一共展示了MessageMediator.getOutputObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: endRequest
import com.sun.corba.se.pept.protocol.MessageMediator; //导入方法依赖的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<-");
}
}
}
示例2: close
import com.sun.corba.se.pept.protocol.MessageMediator; //导入方法依赖的package包/类
public void close() throws IOException
{
// tell BufferManagerRead to release any ByteBuffers
getBufferManager().close(bbwi);
// It's possible bbwi.byteBuffer is shared between
// this InputStream and an OutputStream. Thus, we check
// if the Input/Output streams are using the same ByteBuffer.
// If they sharing the same ByteBuffer we need to ensure only
// one of those ByteBuffers are released to the ByteBufferPool.
if (bbwi != null && getByteBuffer() != null)
{
MessageMediator messageMediator = parent.getMessageMediator();
if (messageMediator != null)
{
CDROutputObject outputObj =
(CDROutputObject)messageMediator.getOutputObject();
if (outputObj != null)
{
if (outputObj.isSharing(getByteBuffer()))
{
// Set OutputStream's ByteBuffer and bbwi to null
// so its ByteBuffer cannot be released to the pool
outputObj.setByteBuffer(null);
outputObj.setByteBufferWithInfo(null);
}
}
}
// release this stream's ByteBuffer to the pool
ByteBufferPool byteBufferPool = orb.getByteBufferPool();
if (debug)
{
// print address of ByteBuffer being released
int bbAddress = System.identityHashCode(bbwi.byteBuffer);
StringBuffer sb = new StringBuffer(80);
sb.append(".close - releasing ByteBuffer id (");
sb.append(bbAddress).append(") to ByteBufferPool.");
String msg = sb.toString();
dprint(msg);
}
byteBufferPool.releaseByteBuffer(bbwi.byteBuffer);
bbwi.byteBuffer = null;
bbwi = null;
}
}