|
From: Michael R. <mr...@us...> - 2004-08-12 12:54:34
|
Update of /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/iiop In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6600/OpenORB/src/main/org/openorb/orb/iiop Modified Files: CDRCodec.java IIOPClientChannel.java IIOPServerChannel.java IIOPTransport.java SocketQueue.java Log Message: Various improvements, see WHATSNEW for details Index: CDRCodec.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/iiop/CDRCodec.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- CDRCodec.java 10 Feb 2004 21:02:48 -0000 1.6 +++ CDRCodec.java 12 Aug 2004 12:54:23 -0000 1.7 @@ -115,7 +115,6 @@ throws org.omg.IOP.CodecPackage.FormatMismatch { StorageBuffer buffer = new StorageBuffer( data, 0, data.length ); - CDRInputStream is; try @@ -138,10 +137,10 @@ } catch ( final Exception ex ) { - getLogger().error( "Unable to create CDROutputStream class.", ex ); + getLogger().error( "Unable to create CDRInputStream class.", ex ); throw ExceptionTool.initCause( new org.omg.CORBA.INITIALIZE( - "Unable to create CDROutputStream class (" + ex + ")" ), ex ); + "Unable to create CDRInputStream class (" + ex + ")" ), ex ); } org.omg.CORBA.Any ret = m_orb.create_any(); @@ -167,6 +166,7 @@ throws org.omg.IOP.CodecPackage.InvalidTypeForEncoding { MarshalBuffer marshal = new MarshalBuffer(); + marshal.enableLogging( getLogger().getChildLogger( "mb" ) ); CDROutputStream os; try Index: IIOPClientChannel.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/iiop/IIOPClientChannel.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- IIOPClientChannel.java 13 Feb 2004 11:43:05 -0000 1.16 +++ IIOPClientChannel.java 12 Aug 2004 12:54:23 -0000 1.17 @@ -964,6 +964,8 @@ req_disposition = m_disposition; } MarshalBuffer buf = new MarshalBuffer( new MarshalListener(), req ); + buf.enableLogging( getLogger().getChildLogger( "mb" ) ); + CDROutputStream os; try { @@ -1240,7 +1242,7 @@ { return; } - // TODO: set the minor code to somthing + // TODO: set the minor code to something StorageBuffer buf = buffer.fragment( SocketQueue.MAX_FRAG_SIZE ); if ( m_socket_queue.send( buf ) ) Index: IIOPServerChannel.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/iiop/IIOPServerChannel.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- IIOPServerChannel.java 10 Feb 2004 22:09:09 -0000 1.17 +++ IIOPServerChannel.java 12 Aug 2004 12:54:24 -0000 1.18 @@ -1082,6 +1082,7 @@ org.omg.IOP.ServiceContext [] reply_service_contexts = req.get_reply_service_contexts(); MarshalBuffer buf = new MarshalBuffer( m_marshal_listener, req ); + buf.enableLogging( getLogger().getChildLogger( "mb" ) ); CDROutputStream os; try @@ -1149,6 +1150,7 @@ int req_id = req.request_id(); MarshalBuffer buf = new MarshalBuffer( m_marshal_listener, req ); + buf.enableLogging( getLogger().getChildLogger( "mb" ) ); CDROutputStream os; @@ -1217,9 +1219,20 @@ private MarshalBuffer.Listener m_marshal_listener = new MarshalListener(); + /** + * This class implements the Marshal.Listener interface which is used by + * the MarshalBuffer to send important messages to interested listeners. + * + * @see MarhslBuffer.Listener + */ private class MarshalListener implements MarshalBuffer.Listener { + /** + * The availIncreased method is called when the size of the marshal buffer + * increases. + * The implementation of this method + */ public void availIncreaced( MarshalBuffer buffer, int available, Object cookie ) { if ( available > SocketQueue.MAX_FRAG_SIZE ) @@ -1228,13 +1241,17 @@ while ( buffer.available() > SocketQueue.MAX_FRAG_SIZE ) { + // send fragments now if ( !m_socket_queue.send( buffer.fragment( SocketQueue.MAX_FRAG_SIZE ) ) ) { + // throw COMM_FAILURE exception when the last fragment could not be sent throw new org.omg.CORBA.COMM_FAILURE( "Client has shutdown", IIOPMinorCodes.COMM_FAILURE_CLIENT_DIED, org.omg.CORBA.CompletionStatus.COMPLETED_YES ); } } + + // we reach this point only after the last fragment has been sent if ( IIOPServerChannel.this.getLogger().isDebugEnabled() && Trace.isMedium() ) { IIOPServerChannel.this.getLogger().debug( IIOPServerChannel.this @@ -1257,7 +1274,7 @@ if ( IIOPServerChannel.this.getLogger().isDebugEnabled() && Trace.isMedium() ) { IIOPServerChannel.this.getLogger().debug( IIOPServerChannel.this - + " request #" + req.request_id() + " last fragment sent" ); + + " request #" + req.request_id() + " last fragment sent after buffer close" ); } } Index: IIOPTransport.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/iiop/IIOPTransport.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- IIOPTransport.java 9 Apr 2004 16:38:33 -0000 1.16 +++ IIOPTransport.java 12 Aug 2004 12:54:24 -0000 1.17 @@ -268,7 +268,7 @@ } catch ( EOFException ex ) { - // TODO: ??? + getLogger().warn( "An EOFException occured during recvMessage()!", ex ); } } @@ -566,15 +566,22 @@ } catch ( final IOException ex ) { - // if( getLogger().isErrorEnabled() ) - // getLogger().error( "IOException while reading from input stream.", ex ); + if ( getLogger().isErrorEnabled() ) + { + getLogger().error( "IOException while reading from input stream.", ex ); + } throw ExceptionTool.initCause( new COMM_FAILURE( "IOException while reading from input stream (" + ex + ")", IIOPMinorCodes.COMM_FAILURE_IO_EXCEPTION, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE ), ex ); } - throw new EOFException(); + // m == -1 so the end of the stream has been reached + if ( getLogger().isErrorEnabled() ) + { + getLogger().error( "The end of the stream has been reached, no bytes available!" ); + } + throw new EOFException( "The end of the stream has been reached, no bytes available!" ); } /** Index: SocketQueue.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/iiop/SocketQueue.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- SocketQueue.java 10 Feb 2004 21:02:49 -0000 1.10 +++ SocketQueue.java 12 Aug 2004 12:54:24 -0000 1.11 @@ -57,7 +57,7 @@ public static final int MAX_FRAG_SIZE = 120000; /** - * This should be set to match DEFAULT_SCRAP + * This should be set to match SCRAP_SIZE_DEFAULT */ //private static final int BUFFER_SIZE = 2048; |