Java Code Examples for com.sun.corba.se.impl.encoding.CDROutputObject#writeTo()
The following examples show how to use
com.sun.corba.se.impl.encoding.CDROutputObject#writeTo() .
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: SocketOrChannelConnectionImpl.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
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); }
Example 2
Source File: SocketOrChannelConnectionImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
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); }
Example 3
Source File: SocketOrChannelConnectionImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
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); }
Example 4
Source File: SocketOrChannelConnectionImpl.java From hottub with GNU General Public License v2.0 | 5 votes |
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); }
Example 5
Source File: SocketOrChannelConnectionImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
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); }
Example 6
Source File: SocketOrChannelConnectionImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
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); }
Example 7
Source File: SocketOrChannelConnectionImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
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); }
Example 8
Source File: SocketOrChannelConnectionImpl.java From JDKSourceCode1.8 with MIT License | 5 votes |
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); }
Example 9
Source File: SocketOrChannelConnectionImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
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); }
Example 10
Source File: SocketOrChannelConnectionImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
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); }
Example 11
Source File: SocketOrChannelConnectionImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
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; } }
Example 12
Source File: SocketOrChannelConnectionImpl.java From JDKSourceCode1.8 with MIT License | 4 votes |
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; } }
Example 13
Source File: SocketOrChannelConnectionImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
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; } }
Example 14
Source File: SocketOrChannelConnectionImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
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; } }
Example 15
Source File: SocketOrChannelConnectionImpl.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
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; } }
Example 16
Source File: SocketOrChannelConnectionImpl.java From hottub with GNU General Public License v2.0 | 4 votes |
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; } }
Example 17
Source File: SocketOrChannelConnectionImpl.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
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; } }
Example 18
Source File: SocketOrChannelConnectionImpl.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
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; } }
Example 19
Source File: SocketOrChannelConnectionImpl.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
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; } }
Example 20
Source File: SocketOrChannelConnectionImpl.java From jdk1.8-source-analysis with Apache License 2.0 | 4 votes |
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; } }