You can subscribe to this list here.
| 2002 |
Jan
(887) |
Feb
(1041) |
Mar
(429) |
Apr
(147) |
May
(358) |
Jun
(378) |
Jul
(484) |
Aug
(501) |
Sep
(259) |
Oct
(934) |
Nov
(235) |
Dec
(108) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(287) |
Feb
(571) |
Mar
(939) |
Apr
(282) |
May
(71) |
Jun
(4) |
Jul
|
Aug
(10) |
Sep
|
Oct
(121) |
Nov
(141) |
Dec
(32) |
| 2004 |
Jan
(119) |
Feb
(697) |
Mar
(12) |
Apr
(23) |
May
(34) |
Jun
(44) |
Jul
(270) |
Aug
(62) |
Sep
(4) |
Oct
(2) |
Nov
(35) |
Dec
(18) |
| 2005 |
Jan
(37) |
Feb
(7) |
Mar
(49) |
Apr
(1) |
May
(6) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2007 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Michael R. <mr...@us...> - 2004-08-16 11:59:43
|
Update of /cvsroot/openorb/native/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24413/lib Modified Files: openorb_native-1.4.0.jar Log Message: Updated the SunOS library Index: openorb_native-1.4.0.jar =================================================================== RCS file: /cvsroot/openorb/native/lib/openorb_native-1.4.0.jar,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 Binary files /tmp/cvsXGq8dy and /tmp/cvs4SWsn6 differ |
|
From: Michael R. <mr...@us...> - 2004-08-16 11:56:34
|
Update of /cvsroot/openorb/native/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23934/lib Modified Files: openorb_native-1.4.0.jar Log Message: Updated the AIX library Index: openorb_native-1.4.0.jar =================================================================== RCS file: /cvsroot/openorb/native/lib/openorb_native-1.4.0.jar,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 Binary files /tmp/cvsHQCVkt and /tmp/cvsWRYp4G differ |
|
From: Michael R. <mr...@us...> - 2004-08-16 11:50:52
|
Update of /cvsroot/openorb/native/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23135/lib Modified Files: openorb_native-1.4.0.jar Log Message: Readded the ReleaseStringUTFChars calls to avoid memory leaks Index: openorb_native-1.4.0.jar =================================================================== RCS file: /cvsroot/openorb/native/lib/openorb_native-1.4.0.jar,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 Binary files /tmp/cvsURnRTF and /tmp/cvsXmvmpH differ |
|
From: Michael R. <mr...@us...> - 2004-08-16 11:49:21
|
Update of /cvsroot/openorb/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22907 Modified Files: WHATSNEW Log Message: Readded the ReleaseStringUTFChars calls to avoid memory leaks Index: WHATSNEW =================================================================== RCS file: /cvsroot/openorb/native/WHATSNEW,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- WHATSNEW 29 Jul 2004 09:48:13 -0000 1.6 +++ WHATSNEW 16 Aug 2004 11:49:10 -0000 1.7 @@ -1,6 +1,9 @@ OpenORB native -------------- +- The ReleaseStringUTFChars _is_ necessary as we are getting + memory leaks otherwise. + - Implemented the setting of parameters for the testLibrary function. |
|
From: Michael R. <mr...@us...> - 2004-08-16 11:49:21
|
Update of /cvsroot/openorb/native/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22907/lib Modified Files: openorb_native-1.4.0.jar Log Message: Readded the ReleaseStringUTFChars calls to avoid memory leaks Index: openorb_native-1.4.0.jar =================================================================== RCS file: /cvsroot/openorb/native/lib/openorb_native-1.4.0.jar,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 Binary files /tmp/cvsG1EB9e and /tmp/cvsWXoSr8 differ |
|
From: Michael R. <mr...@us...> - 2004-08-16 11:49:21
|
Update of /cvsroot/openorb/native/src/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22907/src/native Modified Files: rmiiiop.c Log Message: Readded the ReleaseStringUTFChars calls to avoid memory leaks Index: rmiiiop.c =================================================================== RCS file: /cvsroot/openorb/native/src/native/rmiiiop.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- rmiiiop.c 27 Feb 2004 11:34:43 -0000 1.6 +++ rmiiiop.c 16 Aug 2004 11:49:10 -0000 1.7 @@ -38,7 +38,12 @@ { const char* strFieldName = (*env)->GetStringUTFChars(env, fName, 0L); const char* strFieldSig = (*env)->GetStringUTFChars(env, fSig, 0L); + jfieldID fieldID = (*env)->GetFieldID(env, clz, strFieldName, strFieldSig); + + (*env)->ReleaseStringUTFChars(env, fName, strFieldName); + (*env)->ReleaseStringUTFChars(env, fSig, strFieldSig); + (*env)->SetObjectField(env, obj, fieldID, val); } @@ -52,7 +57,12 @@ { const char* strFieldName = (*env)->GetStringUTFChars(env, fName, 0L); const char* strFieldSig = (*env)->GetStringUTFChars(env, fSig, 0L); + jfieldID fieldID = (*env)->GetFieldID(env, clz, strFieldName, strFieldSig); + + (*env)->ReleaseStringUTFChars(env, fName, strFieldName); + (*env)->ReleaseStringUTFChars(env, fSig, strFieldSig); + (*env)->SetBooleanField(env, obj, fieldID, val); } @@ -66,7 +76,12 @@ { const char* strFieldName = (*env)->GetStringUTFChars(env, fName, 0L); const char* strFieldSig = (*env)->GetStringUTFChars(env, fSig, 0L); + jfieldID fieldID = (*env)->GetFieldID(env, clz, strFieldName, strFieldSig); + + (*env)->ReleaseStringUTFChars(env, fName, strFieldName); + (*env)->ReleaseStringUTFChars(env, fSig, strFieldSig); + (*env)->SetByteField(env, obj, fieldID, val); } @@ -80,7 +95,12 @@ { const char* strFieldName = (*env)->GetStringUTFChars(env, fName, 0L); const char* strFieldSig = (*env)->GetStringUTFChars(env, fSig, 0L); + jfieldID fieldID = (*env)->GetFieldID(env, clz, strFieldName, strFieldSig); + + (*env)->ReleaseStringUTFChars(env, fName, strFieldName); + (*env)->ReleaseStringUTFChars(env, fSig, strFieldSig); + (*env)->SetCharField(env, obj, fieldID, val); } @@ -94,7 +114,12 @@ { const char* strFieldName = (*env)->GetStringUTFChars(env, fName, 0L); const char* strFieldSig = (*env)->GetStringUTFChars(env, fSig, 0L); + jfieldID fieldID = (*env)->GetFieldID(env, clz, strFieldName, strFieldSig); + + (*env)->ReleaseStringUTFChars(env, fName, strFieldName); + (*env)->ReleaseStringUTFChars(env, fSig, strFieldSig); + (*env)->SetShortField(env, obj, fieldID, val); } @@ -108,7 +133,12 @@ { const char* strFieldName = (*env)->GetStringUTFChars(env, fName, 0L); const char* strFieldSig = (*env)->GetStringUTFChars(env, fSig, 0L); + jfieldID fieldID = (*env)->GetFieldID(env, clz, strFieldName, strFieldSig); + + (*env)->ReleaseStringUTFChars(env, fName, strFieldName); + (*env)->ReleaseStringUTFChars(env, fSig, strFieldSig); + (*env)->SetIntField(env, obj, fieldID, val); } @@ -122,7 +152,12 @@ { const char* strFieldName = (*env)->GetStringUTFChars(env, fName, 0L); const char* strFieldSig = (*env)->GetStringUTFChars(env, fSig, 0L); + jfieldID fieldID = (*env)->GetFieldID(env, clz, strFieldName, strFieldSig); + + (*env)->ReleaseStringUTFChars(env, fName, strFieldName); + (*env)->ReleaseStringUTFChars(env, fSig, strFieldSig); + (*env)->SetLongField(env, obj, fieldID, val); } @@ -136,7 +171,12 @@ { const char* strFieldName = (*env)->GetStringUTFChars(env, fName, 0L); const char* strFieldSig = (*env)->GetStringUTFChars(env, fSig, 0L); + jfieldID fieldID = (*env)->GetFieldID(env, clz, strFieldName, strFieldSig); + + (*env)->ReleaseStringUTFChars(env, fName, strFieldName); + (*env)->ReleaseStringUTFChars(env, fSig, strFieldSig); + (*env)->SetFloatField(env, obj, fieldID, val); } @@ -150,7 +190,12 @@ { const char* strFieldName = (*env)->GetStringUTFChars(env, fName, 0L); const char* strFieldSig = (*env)->GetStringUTFChars(env, fSig, 0L); + jfieldID fieldID = (*env)->GetFieldID(env, clz, strFieldName, strFieldSig); + + (*env)->ReleaseStringUTFChars(env, fName, strFieldName); + (*env)->ReleaseStringUTFChars(env, fSig, strFieldSig); + (*env)->SetDoubleField(env, obj, fieldID, val); } |
Update of /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/iiop/fragmentedmessage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26121/src/test/org/openorb/orb/test/iiop/fragmentedmessage Modified Files: AttributeManagerImpl.java FragmentedMessageTest.java LocalContentHandler.java package.html Added Files: ObjectIdDefaultFactory.java Log Message: Added testcase update --- NEW FILE: ObjectIdDefaultFactory.java --- /* * Copyright (C) The Community OpenORB Project. All rights reserved. * * This software is published under the terms of The OpenORB Community Software * License version 1.0, a copy of which has been included with this distribution * in the LICENSE.txt file. */ package org.openorb.orb.test.iiop.fragmentedmessage; /** * The default factory implementation for value type ObjectId. * * @author Michael Macaluso */ public class ObjectIdDefaultFactory implements org.omg.CORBA.portable.ValueFactory { /** * Read the value type from an input stream. * * @param is The input stream to read the value type from. * @return The valut type read from the stream. */ public java.io.Serializable read_value( org.omg.CORBA_2_3.portable.InputStream is ) { ObjectIdImpl ret = new ObjectIdImpl(); is.read_value( ret ); return ret; } } Index: AttributeManagerImpl.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/iiop/fragmentedmessage/AttributeManagerImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AttributeManagerImpl.java 9 Aug 2004 10:06:09 -0000 1.1 +++ AttributeManagerImpl.java 12 Aug 2004 14:30:56 -0000 1.2 @@ -8,13 +8,14 @@ package org.openorb.orb.test.iiop.fragmentedmessage; -import org.omg.PortableServer.POA; import java.util.List; import java.util.LinkedList; import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParser; +import org.omg.PortableServer.POA; + /** * @author Michael Macaluso */ @@ -34,9 +35,6 @@ return m_poa; } - /** - * Operation getAttributeDefinitions - */ public AttributeDefinition[] getAttributeDefinitions() { if ( null == m_attributeDefinitions ) @@ -61,10 +59,10 @@ t.printStackTrace(); } - m_attributeDefinitions = (AttributeDefinition[]) anAttributeDefinitionsList.toArray( + m_attributeDefinitions = ( AttributeDefinition[] ) anAttributeDefinitionsList.toArray( new AttributeDefinition[ anAttributeDefinitionsList.size() ] ); } - return m_attributeDefinitions; } } + Index: FragmentedMessageTest.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/iiop/fragmentedmessage/FragmentedMessageTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FragmentedMessageTest.java 11 Aug 2004 10:23:47 -0000 1.2 +++ FragmentedMessageTest.java 12 Aug 2004 14:30:56 -0000 1.3 @@ -63,11 +63,9 @@ { ORB anORB = getORB(); POA rootPOA = ( POA ) anORB.resolve_initial_references( "RootPOA" ); - m_serverReference = ( new AttributeManagerImpl( rootPOA ) )._this( - anORB ); + m_serverReference = ( new AttributeManagerImpl( rootPOA ) )._this( anORB ); rootPOA.the_POAManager().activate(); - m_clientReference = AttributeManagerHelper.narrow( - forceMarshal( m_serverReference ) ); + m_clientReference = AttributeManagerHelper.narrow( forceMarshal( m_serverReference ) ); } catch ( org.omg.CORBA.UserException ex ) { @@ -95,51 +93,51 @@ { if ( args.length > 0 && args[ 0 ].equals( "server" ) ) { - FragmentedMessageTest test = new FragmentedMessageTest( "standalone" ); - test.setUp(); - String reference = test.getORB().object_to_string( test.getReference() ); - try - { - java.io.FileOutputStream file = new java.io.FileOutputStream( "ObjectId" ); - java.io.PrintStream pfile = new java.io.PrintStream( file ); - pfile.println( reference ); - file.close(); - } - catch ( java.io.IOException ex ) - { - System.out.println( "File error" ); - } - test.getORB().run(); + FragmentedMessageTest test = new FragmentedMessageTest( "standalone" ); + test.setUp(); + String reference = test.getORB().object_to_string( test.getReference() ); + try + { + java.io.FileOutputStream file = new java.io.FileOutputStream( "ObjectId" ); + java.io.PrintStream pfile = new java.io.PrintStream( file ); + pfile.println( reference ); + file.close(); + } + catch ( java.io.IOException ex ) + { + System.out.println( "File error" ); + } + test.getORB().run(); } else if ( args.length > 0 && args[ 0 ].equals( "client" ) ) { - org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init( args, null ); - org.omg.CORBA.Object obj = null; - try - { - java.io.FileInputStream file = new java.io.FileInputStream( "ObjectId" ); - java.io.InputStreamReader myInput = new java.io.InputStreamReader( file ); - java.io.BufferedReader reader = new java.io.BufferedReader( myInput ); - String ref = reader.readLine(); - obj = orb.string_to_object( ref ); - } - catch ( java.io.IOException ex ) - { - ex.printStackTrace(); - } + org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init( args, null ); + org.omg.CORBA.Object obj = null; + try + { + java.io.FileInputStream file = new java.io.FileInputStream( "ObjectId" ); + java.io.InputStreamReader myInput = new java.io.InputStreamReader( file ); + java.io.BufferedReader reader = new java.io.BufferedReader( myInput ); + String ref = reader.readLine(); + obj = orb.string_to_object( ref ); + } + catch ( java.io.IOException ex ) + { + ex.printStackTrace(); + } - try - { - AttributeManager mgr = AttributeManagerHelper.narrow( obj ); - System.out.println( "Test: AttributeManager.getAttributeDefinitions" ); - AttributeDefinition[] anAttributeDefinitionArray = - mgr.getAttributeDefinitions(); - } - catch ( Exception ex ) - { - System.out.println( "An unknown exception occured!" ); - ex.printStackTrace(); - } + try + { + AttributeManager mgr = AttributeManagerHelper.narrow( obj ); + System.out.println( "Test: AttributeManager.getAttributeDefinitions" ); + AttributeDefinition[] anAttributeDefinitionArray = + mgr.getAttributeDefinitions(); + } + catch ( Exception ex ) + { + System.out.println( "An unknown exception occured!" ); + ex.printStackTrace(); + } } else { @@ -148,3 +146,4 @@ } } } + Index: LocalContentHandler.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/iiop/fragmentedmessage/LocalContentHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LocalContentHandler.java 9 Aug 2004 10:06:09 -0000 1.1 +++ LocalContentHandler.java 12 Aug 2004 14:30:56 -0000 1.2 @@ -9,6 +9,7 @@ package org.openorb.orb.test.iiop.fragmentedmessage; import org.omg.CORBA.ORB; +import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; /** @@ -20,8 +21,7 @@ public class LocalContentHandler extends DefaultHandler { - public static final java.util.Map ATTRIBUTE_TYPECODE2ATTRIBUTE_ENUM_MAP = - new java.util.HashMap(); + public static final java.util.Map ATTRTYPECODE_2_ATTRENUM_MAP = new java.util.HashMap(); public static final String STRING_ATTRIBUTE = "As"; public static final String DIMENSION_ATTRIBUTE = "Ai"; @@ -38,30 +38,30 @@ static { - ATTRIBUTE_TYPECODE2ATTRIBUTE_ENUM_MAP.put( STRING_ATTRIBUTE, - AttributeEnum.StringAttr ); - ATTRIBUTE_TYPECODE2ATTRIBUTE_ENUM_MAP.put( DIMENSION_ATTRIBUTE, - AttributeEnum.Dimension ); - ATTRIBUTE_TYPECODE2ATTRIBUTE_ENUM_MAP.put( DOUBLE_ATTRIBUTE, - AttributeEnum.DoubleAttr ); - ATTRIBUTE_TYPECODE2ATTRIBUTE_ENUM_MAP.put( BOOLEAN_ATTRIBUTE, - AttributeEnum.BooleanAttr ); - ATTRIBUTE_TYPECODE2ATTRIBUTE_ENUM_MAP.put( LONG_ATTRIBUTE, - AttributeEnum.LongAttr ); - ATTRIBUTE_TYPECODE2ATTRIBUTE_ENUM_MAP.put( DATE_ATTRIBUTE, - AttributeEnum.DateAttr ); - ATTRIBUTE_TYPECODE2ATTRIBUTE_ENUM_MAP.put( DATETIME_ATTRIBUTE, - AttributeEnum.DateTime ); - ATTRIBUTE_TYPECODE2ATTRIBUTE_ENUM_MAP.put( ENUMERATION_ATTRIBUTE, - AttributeEnum.Enumerated ); - ATTRIBUTE_TYPECODE2ATTRIBUTE_ENUM_MAP.put( USERLIST_ATTRIBUTE, - AttributeEnum.UserList ); - ATTRIBUTE_TYPECODE2ATTRIBUTE_ENUM_MAP.put( SEQUENCE_ATTRIBUTE, - AttributeEnum.SequenceAttr ); - ATTRIBUTE_TYPECODE2ATTRIBUTE_ENUM_MAP.put( STRINGBUFFER_ATTRIBUTE, - AttributeEnum.StringBuffer ); - ATTRIBUTE_TYPECODE2ATTRIBUTE_ENUM_MAP.put( STYLEDTEXT_ATTRIBUTE, - AttributeEnum.StyledText ); + ATTRTYPECODE_2_ATTRENUM_MAP.put( + STRING_ATTRIBUTE, AttributeEnum.StringAttr ); + ATTRTYPECODE_2_ATTRENUM_MAP.put( + DIMENSION_ATTRIBUTE, AttributeEnum.Dimension ); + ATTRTYPECODE_2_ATTRENUM_MAP.put( + DOUBLE_ATTRIBUTE, AttributeEnum.DoubleAttr ); + ATTRTYPECODE_2_ATTRENUM_MAP.put( + BOOLEAN_ATTRIBUTE, AttributeEnum.BooleanAttr ); + ATTRTYPECODE_2_ATTRENUM_MAP.put( + LONG_ATTRIBUTE, AttributeEnum.LongAttr ); + ATTRTYPECODE_2_ATTRENUM_MAP.put( + DATE_ATTRIBUTE, AttributeEnum.DateAttr ); + ATTRTYPECODE_2_ATTRENUM_MAP.put( + DATETIME_ATTRIBUTE, AttributeEnum.DateTime ); + ATTRTYPECODE_2_ATTRENUM_MAP.put( + ENUMERATION_ATTRIBUTE, AttributeEnum.Enumerated ); + ATTRTYPECODE_2_ATTRENUM_MAP.put( + USERLIST_ATTRIBUTE, AttributeEnum.UserList ); + ATTRTYPECODE_2_ATTRENUM_MAP.put( + SEQUENCE_ATTRIBUTE, AttributeEnum.SequenceAttr ); + ATTRTYPECODE_2_ATTRENUM_MAP.put( + STRINGBUFFER_ATTRIBUTE, AttributeEnum.StringBuffer ); + ATTRTYPECODE_2_ATTRENUM_MAP.put( + STYLEDTEXT_ATTRIBUTE, AttributeEnum.StyledText ); } private final java.util.Collection m_collectionOfAttributeDefintions; @@ -100,7 +100,7 @@ int index; index = atts.getIndex( "ID" ); - m_attributeDefinition.id = atts.getValue( index ); + m_attributeDefinition.id = new ObjectIdImpl( atts.getValue( index ) ); index = atts.getIndex( "Name" ); m_attributeDefinition.name = atts.getValue( index ); @@ -121,8 +121,7 @@ { try { - m_attributeDefinition.moreInfo.insert_long( - Integer.parseInt( atts.getValue( index ) ) ); + m_attributeDefinition.moreInfo.insert_wstring( atts.getValue( index ) ); } catch ( NumberFormatException e ) { @@ -153,7 +152,7 @@ index = atts.getIndex( "Code" ); String anAttributeEnumCode = atts.getValue( index ); - anAttributeType.type = ( AttributeEnum ) ATTRIBUTE_TYPECODE2ATTRIBUTE_ENUM_MAP.get( + anAttributeType.type = ( AttributeEnum ) ATTRTYPECODE_2_ATTRENUM_MAP.get( anAttributeEnumCode ); index = atts.getIndex( "TSCounter" ); @@ -167,11 +166,17 @@ } // hard-coded attributes - anAttributeType.constraints = new AttributeConstraint[0]; + anAttributeType.constraints = new AttributeConstraint[ 0 ]; m_attributeDefinition.type = anAttributeType; m_attributeDefinition = null; } } + + public void endDocument() + throws SAXException + { + System.out.println( "Got end of document!!!!" ); + } } Index: package.html =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/iiop/fragmentedmessage/package.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- package.html 11 Aug 2004 10:23:47 -0000 1.2 +++ package.html 12 Aug 2004 14:30:56 -0000 1.3 @@ -1,5 +1,5 @@ -<body> -<p> -IIOP test case to create multiple large fragments. -</p> -</body> +<body> +<p> +IIOP test case to create multiple large fragments. +</p> +</body> |
|
From: Michael R. <mr...@us...> - 2004-08-12 14:31:05
|
Update of /cvsroot/openorb/OpenORB/src/idl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26121/src/idl/test Modified Files: fragmentedmessage.idl Log Message: Added testcase update Index: fragmentedmessage.idl =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/idl/test/fragmentedmessage.idl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- fragmentedmessage.idl 9 Aug 2004 10:06:09 -0000 1.1 +++ fragmentedmessage.idl 12 Aug 2004 14:30:55 -0000 1.2 @@ -1,92 +1,91 @@ -/* -* Copyright (C) The Community OpenORB Project. All rights reserved. -* -* This software is published under the terms of The OpenORB Community Software -* License version 1.0, a copy of which has been included with this distribution -* in the LICENSE.txt file. -*/ - -#ifndef _TEST_FRAGMENTEDMESSAGE_IDL_ -#define _TEST_FRAGMENTEDMESSAGE_IDL_ - -#pragma prefix "openorb.org" - -module orb -{ - module test - { - module iiop - { - module fragmentedmessage - { - valuetype ValueString wstring; - - custom valuetype ObjectId - { - public wstring objectid; - }; - - enum AttributeEnum - { - StringAttr, - Dimension, - DoubleAttr, - BooleanAttr, - LongAttr, - DateAttr, - DateTime, - Enumerated, - SequenceAttr, - StringBuffer, - StyledText, - UserList - }; - - enum ItemStatus - { - ADDED, - DELETED, - MODIFIED, - UNMODIFIED - }; - - struct AttributeConstraint - { - ValueString key; - any value; - }; - typedef sequence<AttributeConstraint> AttributeConstraints; - - struct AttributeType - { - ValueString name; - AttributeEnum type; - AttributeConstraints constraints; - ObjectId id; - long tsCounter; - }; - typedef sequence<AttributeType> AttributeTypes; - - struct AttributeDefinition - { - ValueString name; - AttributeType type; - any moreInfo; - AttributeConstraints uiDefinition; - ValueString id; - ItemStatus status; - long tsCounter; - }; - typedef sequence<AttributeDefinition> AttributeDefinitions; - - interface AttributeManager - { - AttributeDefinitions getAttributeDefinitions(); - }; - }; - }; - }; -}; - -#endif - +/* +* Copyright (C) The Community OpenORB Project. All rights reserved. +* +* This software is published under the terms of The OpenORB Community Software +* License version 1.0, a copy of which has been included with this distribution +* in the LICENSE.txt file. +*/ + +#ifndef _TEST_FRAGMENTEDMESSAGE_IDL_ +#define _TEST_FRAGMENTEDMESSAGE_IDL_ + +#pragma prefix "openorb.org" + +module orb +{ + module test + { + module iiop + { + module fragmentedmessage + { + valuetype ValueString wstring; + + custom valuetype ObjectId + { + public wstring objectid; + }; + + enum AttributeEnum + { + StringAttr, + Dimension, + DoubleAttr, + BooleanAttr, + LongAttr, + DateAttr, + DateTime, + Enumerated, + SequenceAttr, + StringBuffer, + StyledText, + UserList + }; + + enum ItemStatus + { + ADDED, + DELETED, + MODIFIED, + UNMODIFIED + }; + + struct AttributeConstraint + { + ValueString key; + any value; + }; + typedef sequence<AttributeConstraint> AttributeConstraints; + + struct AttributeType + { + ValueString name; + AttributeEnum type; + AttributeConstraints constraints; + ObjectId id; + long tsCounter; + }; + typedef sequence<AttributeType> AttributeTypes; + + struct AttributeDefinition + { + ValueString name; + AttributeType type; + any moreInfo; + AttributeConstraints uiDefinition; + ObjectId id; + ItemStatus status; + long tsCounter; + }; + typedef sequence<AttributeDefinition> AttributeDefinitions; + + interface AttributeManager + { + AttributeDefinitions getAttributeDefinitions(); + }; + }; + }; + }; +}; + +#endif |
|
From: Michael R. <mr...@us...> - 2004-08-12 14:31:05
|
Update of /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/iiop In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26121/src/test/org/openorb/orb/test/iiop Modified Files: IIOPTest.java Log Message: Added testcase update Index: IIOPTest.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/iiop/IIOPTest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- IIOPTest.java 9 Aug 2004 12:43:55 -0000 1.8 +++ IIOPTest.java 12 Aug 2004 14:30:56 -0000 1.9 @@ -52,7 +52,6 @@ suite.addTestSuite( BiDirTest.class ); suite.addTestSuite( StateTest.class ); suite.addTestSuite( ComplexTest.class ); - // TODO: Fix the problem before removing the comment //suite.addTestSuite( FragmentedMessageTest.class ); return suite; } |
|
From: Michael R. <mr...@us...> - 2004-08-12 13:00:14
|
Update of /cvsroot/openorb/tools/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7736/tools/bin Modified Files: launchdbg Log Message: Added documenttation of the new debug flag Index: launchdbg =================================================================== RCS file: /cvsroot/openorb/tools/bin/launchdbg,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- launchdbg 11 Aug 2004 11:02:46 -0000 1.10 +++ launchdbg 12 Aug 2004 12:59:58 -0000 1.11 @@ -83,6 +83,7 @@ # # Launch the application +# "-Dopenorb.debug.enabled=true" might be specified to enable performance critical debug output. # DEBUGGER="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=$DEBUGGER_SUSPEND -Djava.compiler=NONE" VM_ARGS="-Xbootclasspath/p:$BOOTCLASSPATH $DEBUGGER -Dopenorb.home.path=$TCOO_HOME -Dopenorb.debug.trace=DEBUG -Dopenorb.debug.level=HIGH" |
|
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; |
|
From: Michael R. <mr...@us...> - 2004-08-12 12:54:34
|
Update of /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6600/OpenORB/src/main/org/openorb/orb/io Modified Files: MarshalBuffer.java Scrap.java StorageBuffer.java Log Message: Various improvements, see WHATSNEW for details Index: MarshalBuffer.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/io/MarshalBuffer.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- MarshalBuffer.java 19 Feb 2004 07:21:31 -0000 1.8 +++ MarshalBuffer.java 12 Aug 2004 12:54:24 -0000 1.9 @@ -8,8 +8,10 @@ package org.openorb.orb.io; +import org.apache.avalon.framework.logger.Logger; import org.omg.CORBA.OctetSeqHolder; import org.omg.CORBA.IntHolder; +import org.openorb.orb.util.Trace; /** * MarshalBuffers serve as a sink for data to be marshaled into. Fragmentation @@ -20,6 +22,35 @@ */ public class MarshalBuffer { + private static final boolean DEBUG_ENABLED = + Boolean.getBoolean( System.getProperty( "openorb.debug.enabled" ) ); + + private Logger m_logger; + + private org.omg.CORBA.SystemException m_cancel_exception = null; + + private Scrap m_head; + private Scrap m_tail; + + private OctetSeqHolder m_last_buffer = null; + + private boolean m_allow_fragment = false; + private boolean m_in_fragment = false; + + private boolean m_header_fragment = true; + private HeaderData m_last_header = null; + + private boolean m_block_fragment = true; + private BlockData m_last_block = null; + + // informed when size grows and buffer is closed. + private Listener m_listener = null; + private Object m_listener_cookie = null; + private boolean m_in_listener = false; + + // dummy buffer to marshal data into once cancel has been called. + private byte [] m_ignore_buffer = null; + /** * Construct marshal buffer without listener. Use the fragment and * lastFragment methods to extract data from the buffer. @@ -28,10 +59,10 @@ { m_tail = new Scrap(); m_head = m_tail; - m_tail.m_fBuffer = new byte[ Scrap.DEFAULT_SCRAP ]; + m_tail.m_fBuffer = new byte[ Scrap.SCRAP_SIZE_DEFAULT ]; m_tail.m_fOffset = 0; m_tail.m_fLength = 0; - m_tail.m_fMode = Scrap.MODE_NORMAL; + m_tail.m_fMode = Scrap.SCRAP_MODE_NORMAL; m_tail.m_fPosition = 0; } @@ -49,6 +80,30 @@ } /** + * Enable logging for this class. + * + * @param logger The logger instance. + */ + public void enableLogging( Logger logger ) + { + m_logger = logger; + } + + /** + * Return the logger for this class. + * + * @return The logger instance. + */ + protected Logger getLogger() + { + if ( null == m_logger ) + { + Trace.signalIllegalCondition( null, "The logger has not been set!" ); + } + return m_logger; + } + + /** * Returns true if not connected to a listener. To get the data from * the buffer use lastFragment() */ @@ -58,8 +113,10 @@ } /** - * count of all bytes inserted into the buffer, including previous - * fragments + * Counts of all bytes inserted into the buffer, including previous + * fragments. + * + * @return The number of all bytes inserted into this buffer. */ public int size() { @@ -71,7 +128,9 @@ } /** - * count of all bytes available for extracting into a fragment. + * Count of all bytes available for extracting into a fragment. + * + * @return The bumber fo bytes available for a fragment. */ public int available() { @@ -103,9 +162,9 @@ } /** - * Alocate space at end of buffer. The dest scrap is modified so - * it's contents contain the allocated space. The allocated space is - * considered to be scratch space, it's buffer is only avalable + * Alocate space at end of buffer. The destination scrap is modified so + * its contents contain the allocated space. The allocated space is + * considered to be scratch space, its buffer is only available * until the next call. * * @param buf Out parameter, holds pointer to scratch space on @@ -116,6 +175,12 @@ */ public void alloc( OctetSeqHolder buf, IntHolder off, int len ) { + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isMedium() ) + { + getLogger().debug( "Entering method 'alloc(" + buf.value + ", " + off.value + ", " + + len + ")'..." ); + } + if ( !prealloc() ) { if ( m_ignore_buffer == null || m_ignore_buffer.length < len ) @@ -142,6 +207,11 @@ m_tail.m_fLength += len; m_tail.m_fPosition += len; + + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isHigh() ) + { + getLogger().debug( "Found space in tail element: " + m_tail ); + } } else { @@ -149,19 +219,19 @@ // newly allocated space in new tail Scrap nex = new Scrap(); - if ( len > Scrap.DEFAULT_SCRAP ) + if ( len > Scrap.SCRAP_SIZE_DEFAULT ) { nex.m_fBuffer = new byte[ len ]; } else { - nex.m_fBuffer = new byte[ Scrap.DEFAULT_SCRAP ]; + nex.m_fBuffer = new byte[ Scrap.SCRAP_SIZE_DEFAULT ]; } nex.m_fOffset = 0; nex.m_fLength = len; - nex.m_fMode = Scrap.MODE_NORMAL; + nex.m_fMode = Scrap.SCRAP_MODE_NORMAL; nex.m_fPosition = m_tail.m_fPosition + len; @@ -172,6 +242,11 @@ m_tail.m_fNext = nex; m_tail = nex; + + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isHigh() ) + { + getLogger().debug( "Added new element: " + nex ); + } } m_last_buffer = buf; @@ -184,6 +259,12 @@ */ public void append( byte [] buf, int off, int len ) { + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isMedium() ) + { + getLogger().debug( "Entering method 'append(" + buf + ", " + off + ", " + + len + ")'..." ); + } + if ( !prealloc() ) { return; @@ -196,9 +277,9 @@ { return; } - if ( len < Scrap.DEFAULT_SCRAP ) + if ( len < Scrap.SCRAP_SIZE_DEFAULT ) { - // append by copy. Not worth doing otherwise realy. + // append by copy. Not worth doing otherwise, really! if ( m_tail.m_fBuffer.length - m_tail.m_fLength - m_tail.m_fOffset >= len ) { // tail contains entire append buffer. @@ -207,6 +288,11 @@ m_tail.m_fLength += len; m_tail.m_fPosition += len; + + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isHigh() ) + { + getLogger().debug( "Found space in tail element: " + m_tail ); + } } else { @@ -219,16 +305,21 @@ m_tail.m_fPosition += rem; Scrap nex = new Scrap(); - nex.m_fBuffer = new byte[ Scrap.DEFAULT_SCRAP ]; + nex.m_fBuffer = new byte[ Scrap.SCRAP_SIZE_DEFAULT ]; nex.m_fOffset = 0; nex.m_fLength = len - rem; - nex.m_fMode = Scrap.MODE_NORMAL; + nex.m_fMode = Scrap.SCRAP_MODE_NORMAL; nex.m_fPosition = m_tail.m_fPosition + len - rem; System.arraycopy( buf, off + rem, nex.m_fBuffer, 0, len - rem ); m_tail.m_fNext = nex; m_tail = nex; + + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isHigh() ) + { + getLogger().debug( "Added new element: " + nex ); + } } return; @@ -245,29 +336,34 @@ nex.m_fBuffer = m_tail.m_fBuffer; nex.m_fOffset = m_tail.m_fOffset; nex.m_fLength = 0; - nex.m_fMode = Scrap.MODE_NORMAL; + nex.m_fMode = Scrap.SCRAP_MODE_NORMAL; nex.m_fPosition = m_tail.m_fPosition + len; m_tail.m_fBuffer = buf; m_tail.m_fOffset = off; m_tail.m_fLength = len; - m_tail.m_fMode = Scrap.MODE_READONLY; + m_tail.m_fMode = Scrap.SCRAP_MODE_READONLY; m_tail.m_fPosition = nex.m_fPosition; m_tail.m_fNext = nex; m_tail = nex; + + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isHigh() ) + { + getLogger().debug( "Added new element before 0-length tail: " + nex ); + } } else { // make current tail shared, append a readonly scrap then append // a normal scrap with the rest of the old tail's buffer. - m_tail.m_fMode = Scrap.MODE_SHARED; + m_tail.m_fMode = Scrap.SCRAP_MODE_SHARED; Scrap ro = new Scrap(); ro.m_fBuffer = buf; ro.m_fOffset = off; ro.m_fLength = len; - ro.m_fMode = Scrap.MODE_READONLY; + ro.m_fMode = Scrap.SCRAP_MODE_READONLY; ro.m_fPosition = m_tail.m_fPosition + len; Scrap nex = new Scrap(); @@ -275,11 +371,16 @@ nex.m_fOffset = m_tail.m_fOffset + m_tail.m_fLength; nex.m_fLength = 0; nex.m_fPosition = ro.m_fPosition; - nex.m_fMode = Scrap.MODE_NORMAL; + nex.m_fMode = Scrap.SCRAP_MODE_NORMAL; m_tail.m_fNext = ro; ro.m_fNext = nex; m_tail = nex; + + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isHigh() ) + { + getLogger().debug( "Added two elements (RO, SHARED) to tail: " + ro + ", " + nex ); + } } postalloc(); @@ -287,9 +388,16 @@ /** * Insert padding. + * + * @param len The number of bytes to add. */ public void pad( int len ) { + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isMedium() ) + { + getLogger().debug( "Entering method 'pad(" + len + ")'..." ); + } + if ( !prealloc() ) { return; @@ -309,6 +417,11 @@ // all the padding fits in the current scrap m_tail.m_fLength += len; m_tail.m_fPosition += len; + + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isHigh() ) + { + getLogger().debug( "Found space in tail element: " + m_tail ); + } } else { @@ -318,14 +431,19 @@ // and the rest into a new scrap. Scrap nex = new Scrap(); - nex.m_fBuffer = new byte[ Scrap.DEFAULT_SCRAP ]; + nex.m_fBuffer = new byte[ Scrap.SCRAP_SIZE_DEFAULT ]; nex.m_fOffset = 0; nex.m_fLength = len - rem; - nex.m_fMode = Scrap.MODE_NORMAL; + nex.m_fMode = Scrap.SCRAP_MODE_NORMAL; nex.m_fPosition = m_tail.m_fPosition + nex.m_fLength; m_tail.m_fNext = nex; m_tail = nex; + + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isHigh() ) + { + getLogger().debug( "Added new element: " + nex ); + } } postalloc(); @@ -345,6 +463,12 @@ */ public void addHeader( HeaderGenerator gen, int len, boolean frag, Object cookie ) { + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isMedium() ) + { + getLogger().debug( "Entering method 'addHeader(" + gen + ", " + len + ", " + + frag + ", " + cookie + ")'..." ); + } + if ( m_in_listener && !m_in_fragment ) { throw new IllegalStateException( "Cannot modify buffer while calling listener" ); @@ -407,6 +531,12 @@ */ public void beginBlock( BlockGenerator gen, int len, boolean frag, Object cookie ) { + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isMedium() ) + { + getLogger().debug( "Entering method 'beginBlock(" + gen + ", " + len + ", " + + frag + ", " + cookie + ")'..." ); + } + if ( m_in_listener && !m_in_fragment ) { throw new IllegalStateException( "Cannot modify buffer while calling listener" ); @@ -461,6 +591,11 @@ */ public void endBlock() { + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isMedium() ) + { + getLogger().debug( "Entering method 'endBlock()'..." ); + } + if ( m_in_listener && !m_in_fragment ) { throw new IllegalStateException( "Cannot modify buffer while calling listener" ); @@ -485,6 +620,11 @@ */ public void close() { + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isMedium() ) + { + getLogger().debug( "Entering method 'close()'..." ); + } + if ( m_in_listener ) { throw new IllegalStateException( "Cannot close buffer while calling listener." ); @@ -500,8 +640,14 @@ if ( m_listener != null ) { m_in_listener = true; - m_listener.bufferClosed( this, m_tail.m_fPosition, m_listener_cookie ); - m_in_listener = false; + try + { + m_listener.bufferClosed( this, m_tail.m_fPosition, m_listener_cookie ); + } + finally + { + m_in_listener = false; + } } m_head = null; @@ -517,6 +663,11 @@ */ public void cancel( org.omg.CORBA.SystemException ex ) { + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isMedium() ) + { + getLogger().debug( "Entering method 'cancel(" + ex + ")'..." ); + } + if ( !prealloc() ) { return; @@ -524,7 +675,6 @@ if ( m_listener != null ) { m_in_listener = true; - try { m_listener.bufferCanceled( this, ex, m_listener_cookie ); @@ -533,8 +683,10 @@ { m_cancel_exception = sex; } - - m_in_listener = false; + finally + { + m_in_listener = false; + } } else { @@ -554,11 +706,16 @@ } /** - * Prepare fragment. The returned storage buffer will be exactly the length - * specified. + * Prepare a fragment message. + * The returned storage buffer will be exactly the length specified. */ public StorageBuffer fragment( int len ) { + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isMedium() ) + { + getLogger().debug( "Entering method 'fragment(" + len + ")'..." ); + } + if ( !prealloc() ) { return null; @@ -628,7 +785,7 @@ { int olap = mid.m_fPosition - endpos; nexthead = new Scrap(); - nexthead.m_fMode = Scrap.MODE_SHARED | mid.m_fMode; + nexthead.m_fMode = Scrap.SCRAP_MODE_SHARED | mid.m_fMode; nexthead.m_fBuffer = mid.m_fBuffer; nexthead.m_fPosition = mid.m_fPosition; nexthead.m_fOffset = mid.m_fOffset + mid.m_fLength - olap; @@ -638,7 +795,7 @@ mid.m_fLength = mid.m_fLength - olap; mid.m_fPosition = endpos; mid.m_fNext = null; - mid.m_fMode = Scrap.MODE_SHARED | mid.m_fMode; + mid.m_fMode = Scrap.SCRAP_MODE_SHARED | mid.m_fMode; } mid = null; @@ -647,10 +804,10 @@ // now begin the next message. m_tail = new Scrap(); m_head = m_tail; - m_tail.m_fBuffer = new byte[ Scrap.DEFAULT_SCRAP ]; + m_tail.m_fBuffer = new byte[ Scrap.SCRAP_SIZE_DEFAULT ]; m_tail.m_fOffset = 0; m_tail.m_fLength = 0; - m_tail.m_fMode = Scrap.MODE_NORMAL; + m_tail.m_fMode = Scrap.SCRAP_MODE_NORMAL; m_tail.m_fPosition = endpos; // call begin block on all the header blocks @@ -710,10 +867,16 @@ } /** - * Return the last fragment. This also closes the buffer. + * Return the last fragment. The size of the last fragment will be less + * than the default MAX_FRAGMENT_SIZE. This also closes the buffer. */ public StorageBuffer lastFragment() { + if ( DEBUG_ENABLED && getLogger().isDebugEnabled() && Trace.isMedium() ) + { + getLogger().debug( "Entering method 'lastFragment()'..." ); + } + if ( !prealloc() ) { return null; @@ -728,6 +891,7 @@ throw new IllegalStateException( "Attempt to close buffer without closing all blocks" ); } + // fill in the headers. while ( m_last_header != null ) { @@ -739,7 +903,7 @@ } Scrap msghead = m_head; - int len = m_tail.m_fPosition; + int len = m_tail.m_fPosition - m_head.m_fPosition + m_head.m_fLength; // go to closed state. m_tail = null; @@ -817,17 +981,38 @@ int length, MarshalBuffer buffer, Object cookie ); } + /** + * This interface is used by the MarshalBuffer to send important messages + * to a registered listener. + * + * The messages are: + * <ul> + * <li>availIncreased</li> + * <li>bufferClosed</li> + * <li>bufferCanceled</li> + * </ul> + */ public static interface Listener extends java.util.EventListener { /** - * called whenever the size of the buffer increaces or flush is called + * Called whenever the size of the buffer increases or flush is called * while fragemntation is enabled. + * + * @param buffer The marshal buffer instance for which this method + * is called. + * @param available The number of bytes stored in the buffer. + * @param cookie The cookie passed to the addHeader operation. */ void availIncreaced( MarshalBuffer buffer, int available, Object cookie ); /** - * called when the buffer is closed. + * Called when the buffer is closed. + * + * @param buffer The marshal buffer instance for which this method + * is called. + * @param available The number of bytes stored in the buffer. + * @param cookie The cookie passed to the addHeader operation. */ void bufferClosed( MarshalBuffer buffer, int available, Object cookie ); @@ -835,22 +1020,40 @@ * Called when the marshal sequence is canceled by calling the cancel * operation. This should either throw a system exception or simply return * if the cancel will be handled later on. + * + * @param buffer The marshal buffer instance for which this method + * is called. + * @param ex The system exception to be thrown. + * @param cookie The cookie passed to the addHeader operation. */ void bufferCanceled( MarshalBuffer buffer, org.omg.CORBA.SystemException ex, Object cookie ); } + /** + * The prealloc method is called for each method that allocates another + * piece of buffer memory. It performs various checks that must be done for + * each buffer operation in order not to destroy buffer consistency. + * When the member m_cancel_exception is set the exception will be + * thrown by this method. + * + * @return True when the method, from which prealloc is called, may + * continue, false otherwise. + */ private boolean prealloc() { if ( m_cancel_exception != null ) { throw m_cancel_exception; } + + // No head element has been allocated yet if ( m_head == null ) { return false; } - // invalidate last allocated buffer. + + // Invalidate last allocated buffer if ( m_last_buffer != null ) { m_last_buffer.value = null; @@ -861,6 +1064,10 @@ return true; } + /** + * This method calls the Listener.availIncreaced method after the + * buffer memory has been increased. + */ private void postalloc() { // check for fragment request @@ -871,9 +1078,17 @@ && !m_in_fragment ) { m_in_listener = true; - m_listener.availIncreaced( this, - m_tail.m_fPosition - m_head.m_fPosition + m_head.m_fLength, m_listener_cookie ); - m_in_listener = false; + try + { + m_listener.availIncreaced( + this, + m_tail.m_fPosition - m_head.m_fPosition + m_head.m_fLength, + m_listener_cookie ); + } + finally + { + m_in_listener = false; + } } } @@ -905,30 +1120,6 @@ private int m_length; } - private org.omg.CORBA.SystemException m_cancel_exception = null; - - private Scrap m_head; - private Scrap m_tail; - - private OctetSeqHolder m_last_buffer = null; - - private boolean m_allow_fragment = false; - private boolean m_in_fragment = false; - - private boolean m_header_fragment = true; - private HeaderData m_last_header = null; - - private boolean m_block_fragment = true; - private BlockData m_last_block = null; - - // informed when size grows and buffer is closed. - private Listener m_listener = null; - private Object m_listener_cookie = null; - private boolean m_in_listener = false; - - // dummy buffer to marshal data into once cancel has been called. - private byte [] m_ignore_buffer = null; - public static void main( String [] args ) { MarshalBuffer mbuf = new MarshalBuffer(); Index: Scrap.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/io/Scrap.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Scrap.java 10 Feb 2004 21:02:50 -0000 1.4 +++ Scrap.java 12 Aug 2004 12:54:24 -0000 1.5 @@ -8,35 +8,110 @@ package org.openorb.orb.io; +import org.openorb.util.HexPrintStream; + /** * Small scrap of data. * This is a simple struct (no behaviour) for a small piece of - * data received from a fragmented GIOP message. + * data inside a marshalling stream. + * + * <pre> + * m_head m_tail + * m_fPosition m_fPosition + * |-----------------|---------------------------------------| + * | ____fNext___ | + * | | | | + * +----------------------------------+ +----------------------------------+ + * | | | | | | + * | |-----fLength-----| | | |-----fLength-----| | + * | +--------------------------+ | | +--------------------------+ | + * | | m_fBuffer | | | | m_fBuffer | | + * | +--------------------------+ | | +--------------------------+ | + * | |-----m_fBuffer.length-----| | | |-----m_fBuffer.length-----| | + * | | | | + * +----------------------------------+ +----------------------------------+ + * + * </pre> * * @author Chris Wood * @version $Revision$ $Date$ */ class Scrap { - /** Default size of a scrap's buffer. */ - public static final int DEFAULT_SCRAP = 2048; + /** Default size of a scrap's buffer: 2 kBytes. */ + public static final int SCRAP_SIZE_DEFAULT = 2048; /** Normal internal scrap. */ - public static final int MODE_NORMAL = 0x00; + public static final int SCRAP_MODE_NORMAL = 0x00; /** A scrap that shares buffer space with a buffer further down the list. */ - public static final int MODE_SHARED = 0x01; + public static final int SCRAP_MODE_SHARED = 0x01; /** The scrap's buffer space is readonly. Clone it to make it read-write. */ - public static final int MODE_READONLY = 0x03; + public static final int SCRAP_MODE_READONLY = 0x03; + + /** A counter that identifies this instance. */ + private static int s_global_index = 0; + /** This scrap's byte buffer. */ public byte [] m_fBuffer; + + /** ??? */ public int m_fOffset; + + /** The number of valid bytes inside the buffer. */ public int m_fLength; + + /** The overall position of this scrap inside the top level container (array). */ public int m_fPosition; - /** The mode of this scrap. See MODE_* constants in this class. */ - public int m_fMode; + /** The mode of this scrap. See SCRAP_MODE_* constants in this class. */ + public int m_fMode = SCRAP_MODE_NORMAL; /** Next scrap instance in the list. */ public Scrap m_fNext = null; -} + /** The unique index of this Scrap instance. */ + private int m_index; + + /** + * Constructor. + */ + public Scrap() + { + m_index = ++s_global_index; + } + + /** + * Return a string representation of this instance. + * + * @return A string describing this instance. + */ + public String toString() + { + StringBuffer sb = new StringBuffer(); + sb.append( "Scrap [" ); + sb.append( "idx=" ); + sb.append( m_index ); + sb.append( ", buf[8]='" ); + sb.append( HexPrintStream.toHex( m_fBuffer[0] ) ); + sb.append( HexPrintStream.toHex( m_fBuffer[1] ) ); + sb.append( HexPrintStream.toHex( m_fBuffer[2] ) ); + sb.append( HexPrintStream.toHex( m_fBuffer[3] ) ); + sb.append( " " ); + sb.append( HexPrintStream.toHex( m_fBuffer[4] ) ); + sb.append( HexPrintStream.toHex( m_fBuffer[5] ) ); + sb.append( HexPrintStream.toHex( m_fBuffer[6] ) ); + sb.append( HexPrintStream.toHex( m_fBuffer[7] ) ); + sb.append( "' , buf_size=" ); + sb.append( ( ( m_fBuffer != null ) ? ( "" + m_fBuffer.length ) : "null" ) ); + sb.append( ", off=" ); + sb.append( m_fOffset ); + sb.append( ", len=" ); + sb.append( m_fLength ); + sb.append( ", pos=" ); + sb.append( m_fPosition ); + sb.append( ", mode=" ); + sb.append( m_fMode ); + sb.append( "]" ); + return sb.toString(); + } +} Index: StorageBuffer.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/io/StorageBuffer.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- StorageBuffer.java 10 Feb 2004 21:46:22 -0000 1.5 +++ StorageBuffer.java 12 Aug 2004 12:54:24 -0000 1.6 @@ -17,33 +17,33 @@ import org.omg.CORBA.IntHolder; import org.omg.CORBA.OctetSeqHolder; +import org.openorb.orb.util.Trace; + /** * A storage buffer holds binary data for further processing. MarshalBuffers * and BufferSource objects output a stream of StorageBuffers. + * The SocketQueue class uses StorageBuffer parameters when sending data. + * CDRInpuStream uses StorageBuffer instance to unmarshal GIOP data from. + * This class always represents a full IIOP message and it is used to + * the client side for unmarshalling and on the server side for marshalling + * GIOP into the IIOP. * * @author Unknown */ public class StorageBuffer { - /** */ private int m_avail; - /** */ private Scrap m_mark; - /** */ private int m_markavail; - /** */ private Scrap m_head; - /** */ private Scrap m_temp_head = new Scrap(); - /** */ private Scrap m_tail; - /** */ private boolean m_read_write_mode; /** @@ -68,7 +68,7 @@ m_head.m_fPosition = len; - m_head.m_fMode = Scrap.MODE_READONLY; + m_head.m_fMode = Scrap.SCRAP_MODE_READONLY; } /** @@ -83,7 +83,7 @@ /** * Public constructor, read part from buffer and remainder from stream. * A whole buffer is always read. If the reading thread is interrupted - * the buffer will be completley read and the interrupted status reset. + * the buffer will be completely read and the interrupted status reset. * * @param buf Prefix bytes. Copied. * @param off Offset into prefix buffer. @@ -121,7 +121,7 @@ t.m_fOffset = 0; t.m_fLength = len; t.m_fPosition = len; - t.m_fMode = Scrap.MODE_NORMAL; + t.m_fMode = Scrap.SCRAP_MODE_NORMAL; System.arraycopy( buf, off, t.m_fBuffer, 0, len ); @@ -131,14 +131,14 @@ } else { - int alloc = ( total_len > Scrap.DEFAULT_SCRAP ) - ? Scrap.DEFAULT_SCRAP : total_len; + int alloc = ( total_len > Scrap.SCRAP_SIZE_DEFAULT ) + ? Scrap.SCRAP_SIZE_DEFAULT : total_len; t.m_fBuffer = new byte[ alloc ]; t.m_fOffset = 0; t.m_fLength = alloc; t.m_fPosition = alloc; - t.m_fMode = Scrap.MODE_NORMAL; + t.m_fMode = Scrap.SCRAP_MODE_NORMAL; System.arraycopy( buf, off, t.m_fBuffer, 0, len ); alloc -= len; @@ -179,14 +179,14 @@ // when we have more fragments... while ( total_len > 0 ) { - int alloc = ( total_len > Scrap.DEFAULT_SCRAP ) - ? Scrap.DEFAULT_SCRAP : total_len; + int alloc = ( total_len > Scrap.SCRAP_SIZE_DEFAULT ) + ? Scrap.SCRAP_SIZE_DEFAULT : total_len; Scrap nex = new Scrap(); nex.m_fBuffer = new byte[ alloc ]; nex.m_fOffset = 0; nex.m_fLength = alloc; nex.m_fPosition = t.m_fPosition + alloc; - nex.m_fMode = Scrap.MODE_NORMAL; + nex.m_fMode = Scrap.SCRAP_MODE_NORMAL; int pos = 0; @@ -277,20 +277,24 @@ { throw new EOFException( "Buffer is empty" ); } + boolean interrupt = Thread.interrupted(); + // for debugging + Trace.isGIOPHeaderOK( m_head.m_fBuffer, 0 ); + if ( m_read_write_mode ) { while ( m_head != m_tail ) { - if ( m_head.m_fMode == Scrap.MODE_READONLY ) + if ( m_head.m_fMode == Scrap.SCRAP_MODE_READONLY ) { byte [] tmp = new byte[ m_head.m_fLength ]; System.arraycopy( m_head.m_fBuffer, m_head.m_fOffset, tmp, 0, m_head.m_fLength ); m_head.m_fBuffer = tmp; m_head.m_fOffset = 0; - m_head.m_fMode = Scrap.MODE_NORMAL; + m_head.m_fMode = Scrap.SCRAP_MODE_NORMAL; } int d = 0; @@ -368,13 +372,13 @@ { throw new IndexOutOfBoundsException(); } - if ( m_read_write_mode && m_head.m_fMode == Scrap.MODE_READONLY ) + if ( m_read_write_mode && m_head.m_fMode == Scrap.SCRAP_MODE_READONLY ) { byte [] copy = new byte[ m_head.m_fLength ]; System.arraycopy( m_head.m_fBuffer, m_head.m_fOffset, copy, 0, m_head.m_fLength ); m_head.m_fBuffer = copy; m_head.m_fOffset = 0; - m_head.m_fMode = Scrap.MODE_NORMAL; + m_head.m_fMode = Scrap.SCRAP_MODE_NORMAL; } buf.value = m_head.m_fBuffer; @@ -396,7 +400,7 @@ m_temp_head.m_fBuffer = m_head.m_fBuffer; m_temp_head.m_fOffset = m_head.m_fOffset + olen; m_temp_head.m_fLength = m_head.m_fLength - olen; - m_temp_head.m_fMode = m_head.m_fMode | Scrap.MODE_SHARED; + m_temp_head.m_fMode = m_head.m_fMode | Scrap.SCRAP_MODE_SHARED; m_temp_head.m_fPosition = m_head.m_fPosition; m_temp_head.m_fNext = m_head.m_fNext; m_head = m_temp_head; @@ -462,7 +466,7 @@ m_temp_head.m_fBuffer = m_head.m_fBuffer; m_temp_head.m_fOffset = m_head.m_fOffset + len.value; m_temp_head.m_fLength = m_head.m_fLength - len.value; - m_temp_head.m_fMode = m_head.m_fMode | Scrap.MODE_SHARED; + m_temp_head.m_fMode = m_head.m_fMode | Scrap.SCRAP_MODE_SHARED; m_temp_head.m_fPosition = m_head.m_fPosition; m_temp_head.m_fNext = m_head.m_fNext; m_head = m_temp_head; @@ -491,36 +495,38 @@ return new byte[ 0 ]; } if ( m_head.m_fLength != m_head.m_fBuffer.length || m_head.m_fNext != m_tail - || m_head.m_fMode != Scrap.MODE_NORMAL || m_head.m_fOffset != 0 ) + || m_head.m_fMode != Scrap.SCRAP_MODE_NORMAL || m_head.m_fOffset != 0 ) { byte [] buf = new byte[ m_avail ]; Scrap nex = m_head; - int disp = m_head.m_fPosition - m_head.m_fLength; + int dest = 0; while ( nex != m_tail ) { try { - System.arraycopy( nex.m_fBuffer, nex.m_fOffset, buf, disp, nex.m_fLength ); + System.arraycopy( nex.m_fBuffer, nex.m_fOffset, buf, dest, nex.m_fLength ); } catch ( Exception ex ) { + Trace.signalIllegalCondition( null, + "An exception occured during linearization!" ); // This may fail with the following exceptions: // IndexOutOfBoundsException, NullPointerException, ArrayStoreException // in either case copy was not successful, so return null; return null; } - disp += nex.m_fLength; + dest += nex.m_fLength; nex = nex.m_fNext; } m_head.m_fBuffer = buf; m_head.m_fOffset = 0; - m_head.m_fLength = m_avail; - m_head.m_fMode = Scrap.MODE_NORMAL; + m_head.m_fMode = Scrap.SCRAP_MODE_NORMAL; m_head.m_fPosition = m_head.m_fPosition - m_head.m_fLength + m_avail; + m_head.m_fLength = m_avail; m_head.m_fNext = m_tail; } |
|
From: Michael R. <mr...@us...> - 2004-08-12 12:54:32
|
Update of /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6600/OpenORB/src/main/org/openorb/orb/util Modified Files: Trace.java Log Message: Various improvements, see WHATSNEW for details Index: Trace.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/util/Trace.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Trace.java 16 Feb 2004 09:41:59 -0000 1.8 +++ Trace.java 12 Aug 2004 12:54:24 -0000 1.9 @@ -518,6 +518,34 @@ } /** + * This method performs a sanity check of a GIOP header at the + * specified offset. It prints a stack trace and the corrupted buffer + * to stderr. + * + * @param buf The message buffer. + * @param off The offset at which to check for the GIOP header. + * @return True when the header is OK, false otherwise. + */ + public static boolean isGIOPHeaderOK( byte[] buf, int off ) + { + boolean result = true; + if ( buf[ off + 0 ] != 'G' || buf[ off + 1 ] != 'I' + || buf[ off + 2 ] != 'O' || buf[ off + 3 ] != 'P' + || buf[ off + 4 ] != 1 || buf[ off + 5 ] > 2 ) + { + System.err.println( "###############################################" ); + System.err.println( "!!Trying to send/receive corrupt GIOP message!!" ); + System.err.println( "###############################################" ); + Thread.dumpStack(); + System.err.println( "###############################################" ); + System.err.println( bufferToString( "The corrupted buffer (off=" + off + ")", buf ) ); + System.err.println( "###############################################" ); + result = false; + } + return result; + } + + /** * Helper method for signalIllegalCondition. * Returns the default assertion logger. * |
|
From: Michael R. <mr...@us...> - 2004-08-12 12:54:32
|
Update of /cvsroot/openorb/OpenORB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6600/OpenORB Modified Files: WHATSNEW Log Message: Various improvements, see WHATSNEW for details Index: WHATSNEW =================================================================== RCS file: /cvsroot/openorb/OpenORB/WHATSNEW,v retrieving revision 1.227 retrieving revision 1.228 diff -u -d -r1.227 -r1.228 --- WHATSNEW 29 Jul 2004 09:48:12 -0000 1.227 +++ WHATSNEW 12 Aug 2004 12:54:23 -0000 1.228 @@ -1,6 +1,73 @@ OpenORB ------- +- Fixed some typos and improved some exception messages. + +- Added general method isGIOPHeaderOK to the Trace class. + This method gets called from StorageBuffer.writeTo() + method to make sure that we do not send buffers that + will be rejected by the client. + +- Added documentation to the Scrap class to clarify its pupose. + +- Calls to MarshalBuffer.Listener instances have been wrapped + with try-finally blocks in order to get the flags reset + correctly in case of a problem in the listener code. + +- Fixed a bug in StorageBuffer.linearize() that seems to have + existed for quite some time now. At least the file has not + been changed since our code takeover of the Exolab codebase. + The linearize() method is called from the Trace class only + when debugging has been enabled. A call to linearize() was + creating one huge buffer in the head Scrap element instead + of having a lot of smaller buffers distributed over many + Scrap instances in the singly linked Scrap list. + When the last fragment was sent the buffer created had the + size of the whole message, because the call to + MarshalBuffer.lastFragment() was passing a wrong length + to the StorageBuffer instance created by this method. + The linearize() method was using the wrong offset for + consolidating the small arrays into the large so that + the 'GIOP' started at the overall position of all fragments. + The client receives the message and sees that the first four + do not have the 'GIOP' pattern and thus was throwing a + "Bad Magic" MARSHAL exception. + In most of the cases when debugging was enabled the linearize() + method was just returning null because of an internal + ArrayIndexOutOfBoundsException that had not been shown. + The problem in this case was that the IIOP message buffer was + not shown in debug output. + +- Improved logging and exception messages for the MarshalBuffer + and some related classes. + The problem is that the MarshalBuffer class is a critical + component and no logging should slow down its operation. + Therefore I added a new flag: 'openorb.debug.enabled' + It can be used by performance critical classes to make the JIT + completely remove the logging statements at runtime. + The flag must be set like this: + + private static final boolean DEBUG_ENABLED = + Boolean.getBoolean( System.getProperty( + "openorb.debug.enabled" ) ); + + A logger statement can then be wrapped like this: + + if ( DEBUG_ENABLED + && getLogger().isDebugEnabled() && Trace.isMedium() ) + { + getLogger().debug( "Blablabla" ); + } + + The consequence of this mechanism is that the JIT can completely + remove the logging statement as it is clear that the if statement + can never become true. + The downside is that we have another debug flag that must be set + in order to see the debug messages. + +- Added a test case for a fragmentation bug. Contributed by + Michael C. Macaluso (michael _dot_ macaluso _at_ wavecorp _dot_ com) + Version 1.4.0 BETA2 - July, 29 2004 - OpenORB_1_4_0_BETA2 - Fixed bug #955143. The problem of marshaling the array type |
|
From: Michael R. <mr...@us...> - 2004-08-11 11:02:55
|
Update of /cvsroot/openorb/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31162 Modified Files: WHATSNEW Log Message: Added debugger suspend variable Index: WHATSNEW =================================================================== RCS file: /cvsroot/openorb/tools/WHATSNEW,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- WHATSNEW 29 Jul 2004 10:37:29 -0000 1.78 +++ WHATSNEW 11 Aug 2004 11:02:46 -0000 1.79 @@ -1,6 +1,11 @@ OpenORB tools ------------- +- Added a variable DEBUGGER_SUSPEND to the launchdbg script to allow + the user to influence the debugger suspend behaviour. + Setting 'export DEBUGGER_SUSPEND=y' makes the application wait + for a debugger to connect. + Version 1.4.0 BETA2 - July, 29 2004 - tools_1_4_0_BETA2 - Added support for CYGWIN to setenv. |
|
From: Michael R. <mr...@us...> - 2004-08-11 11:02:55
|
Update of /cvsroot/openorb/tools/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31162/bin Modified Files: launchdbg Log Message: Added debugger suspend variable Index: launchdbg =================================================================== RCS file: /cvsroot/openorb/tools/bin/launchdbg,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- launchdbg 27 Jul 2004 06:27:37 -0000 1.9 +++ launchdbg 11 Aug 2004 11:02:46 -0000 1.10 @@ -73,9 +73,18 @@ # +# Allow the user to overwrite the application's suspend behaviour +# +if [ -z "$DEBUGGER_SUSPEND" ] +then + DEBUGGER_SUSPEND=n +fi + + +# # Launch the application # -DEBUGGER="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n -Djava.compiler=NONE" +DEBUGGER="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=$DEBUGGER_SUSPEND -Djava.compiler=NONE" VM_ARGS="-Xbootclasspath/p:$BOOTCLASSPATH $DEBUGGER -Dopenorb.home.path=$TCOO_HOME -Dopenorb.debug.trace=DEBUG -Dopenorb.debug.level=HIGH" $JAVA $VM_ARGS -jar $TCOO_HOME/tools/lib/launcher.jar "$@" |
|
From: Michael R. <mr...@us...> - 2004-08-11 10:27:00
|
Update of /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25188/src/main/org/openorb/orb/io Modified Files: BufferSource.java Log Message: Fixed documentation Index: BufferSource.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/io/BufferSource.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- BufferSource.java 22 Jul 2004 08:06:07 -0000 1.8 +++ BufferSource.java 11 Aug 2004 10:26:51 -0000 1.9 @@ -134,23 +134,25 @@ } return null; } - // indicate last listener has been notified + // indicate last listener has been notified m_last_notified = true; - // setup local version of listener object + // setup local version of listener object listenerObj = m_last_msg_processed_listener; - // setup local version of exception object (if any) + // setup local version of exception object (if any) exceptionObj = ( m_exception != null ) ? m_exception : null; } - // call listener from outside of thread-sync block to prevent - // any chance of deadlock from listener needing 'm_sync_state' - // lock while holding the thread lock for this object + // call listener from outside of thread-sync block to prevent + // any chance of deadlock from listener needing 'm_sync_state' + // lock while holding the thread lock for this object if ( listenerObj != null ) - { // listener object is setup; call its method + { + // listener object is setup; call its method listenerObj.lastMessageProcessed( this ); } if ( exceptionObj != null ) - { // exception was setup; throw it now + { + // exception was setup; throw it now throw exceptionObj; } return null; |
|
From: Michael R. <mr...@us...> - 2004-08-11 10:26:04
|
Update of /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/iiop In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25009/src/main/org/openorb/orb/iiop Modified Files: CDRInputStream.java Log Message: Improved exception message Index: CDRInputStream.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/main/org/openorb/orb/iiop/CDRInputStream.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- CDRInputStream.java 28 Jul 2004 12:07:51 -0000 1.20 +++ CDRInputStream.java 11 Aug 2004 10:25:55 -0000 1.21 @@ -2591,7 +2591,7 @@ catch ( Exception ex ) { getLogger().error( "Unable to load or instantiate value-box helper class '" - + boxname + "'!", ex ); + + boxname + "' (TypeId: '" + repo_id + "')!", ex ); } if ( boxhelp != null ) |
|
From: Michael R. <mr...@us...> - 2004-08-11 10:25:00
|
Update of /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/rmi/complex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24852/org/openorb/orb/test/rmi/complex Modified Files: IDLStructHelper.java Log Message: Fixed DCL Index: IDLStructHelper.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/rmi/complex/IDLStructHelper.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- IDLStructHelper.java 19 Feb 2004 07:21:32 -0000 1.4 +++ IDLStructHelper.java 11 Aug 2004 10:24:45 -0000 1.5 @@ -49,23 +49,17 @@ { if ( s_typeCode == null ) { - synchronized ( org.omg.CORBA.TypeCode.class ) + if ( s_active ) { - if ( s_typeCode == null ) - { - if ( s_active ) - { - TypeCode typecode = ORB.init().create_recursive_tc( s_id ); - return typecode; - } - s_active = true; - StructMember[] members = new StructMember[ 1 ]; - TypeCode tcmember = ORB.init().get_primitive_tc( TCKind.tk_short ); - members[ 0 ] = new StructMember( "x", tcmember, null ); - s_typeCode = ORB.init().create_struct_tc( id(), "IDLStruct", members ); - s_active = false; - } + TypeCode typecode = ORB.init().create_recursive_tc( s_id ); + return typecode; } + s_active = true; + StructMember[] members = new StructMember[ 1 ]; + TypeCode tcmember = ORB.init().get_primitive_tc( TCKind.tk_short ); + members[ 0 ] = new StructMember( "x", tcmember, null ); + s_typeCode = ORB.init().create_struct_tc( id(), "IDLStruct", members ); + s_active = false; } return s_typeCode; } |
|
From: Michael R. <mr...@us...> - 2004-08-11 10:24:19
|
Update of /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/iiop/fragmentedmessage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24617 Modified Files: AttributeData.xml FragmentedMessageTest.java ObjectIdImpl.java package.html Log Message: Added standalone mode Index: AttributeData.xml =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/iiop/fragmentedmessage/AttributeData.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AttributeData.xml 9 Aug 2004 10:06:09 -0000 1.1 +++ AttributeData.xml 11 Aug 2004 10:23:47 -0000 1.2 @@ -1,20008 +1,20008 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- This is the test data for the fragmented message test. --> - -<AttributeData> - <AttributeDefinition ID="28" Name="Outline" TSCounter="2"> - <AttributeType ID="1" Code="Ab" Name="Boolean" TSCounter="0" /> - </AttributeDefinition> - <AttributeDefinition ID="135" Name="UPSable" TSCounter="0"> - <AttributeType ID="1" Code="Ab" Name="Boolean" TSCounter="0" /> - </AttributeDefinition> [...39985 lines suppressed...] + <AttributeDefinition ID="6890" Name="Olympic Uniforms Cost Source" TSCounter="0"> + <AttributeType ID="783" Code="Ae" Name="Ae" TSCounter="1" /> + </AttributeDefinition> + <AttributeDefinition ID="6891" Name="Waddell Co Inc Cost Source" TSCounter="0"> + <AttributeType ID="784" Code="Ae" Name="Ae" TSCounter="1" /> + </AttributeDefinition> + <AttributeDefinition ID="6892" Name="Royal Seating Corp Cost Source" TSCounter="0"> + <AttributeType ID="785" Code="Ae" Name="Ae" TSCounter="1" /> + </AttributeDefinition> + <AttributeDefinition ID="6903" Name="Tee Jay's Apperal Inc Cost Source" TSCounter="0"> + <AttributeType ID="786" Code="Ae" Name="Ae" TSCounter="1" /> + </AttributeDefinition> + <AttributeDefinition ID="6914" Name="Installnet Int'l Inc Cost Source" TSCounter="0"> + <AttributeType ID="787" Code="Ae" Name="Ae" TSCounter="1" /> + </AttributeDefinition> + <AttributeDefinition ID="6925" Name="Mirow Int'l Cost Source" TSCounter="0"> + <AttributeType ID="788" Code="Ae" Name="Ae" TSCounter="1" /> + </AttributeDefinition> +</AttributeData> + Index: FragmentedMessageTest.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/iiop/fragmentedmessage/FragmentedMessageTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- FragmentedMessageTest.java 9 Aug 2004 10:06:09 -0000 1.1 +++ FragmentedMessageTest.java 11 Aug 2004 10:23:47 -0000 1.2 @@ -1,90 +1,150 @@ -/* -* Copyright (C) The Community OpenORB Project. All rights reserved. -* -* This software is published under the terms of The OpenORB Community Software -* License version 1.0, a copy of which has been included with this distribution -* in the LICENSE.txt file. -*/ - -package org.openorb.orb.test.iiop.fragmentedmessage; - -import junit.framework.TestSuite; - -import org.omg.PortableServer.POA; -import org.openorb.orb.test.ORBTestCase; - -import org.omg.CORBA.ORB; - -import java.util.Properties; - -/** - * Tests marshaling and unmarshaling of various iiop types. - * - * @author Michael Macaluso - */ -public class FragmentedMessageTest - extends ORBTestCase -{ - private AttributeManager m_serverReference; - private AttributeManager m_clientReference; - - /** - * Constructor. - * - * @param name The name of the test case. - */ - public FragmentedMessageTest( String name ) - { - super( name ); - } - - /** - * Set up the test case. - */ - protected void setUp() - { - Properties aProperties = new Properties(); - aProperties.put( "org.omg.CORBA.ORBClass", "org.openorb.orb.core.ORB" ); - aProperties.put( "org.omg.CORBA.ORBSingletonClass", "org.openorb.orb.core.ORBSingleton" ); - - super.setUp( aProperties ); - - try - { - ORB anORB = getORB(); - POA rootPOA = ( POA ) anORB.resolve_initial_references( "RootPOA" ); - AttributeManager m_ServerReference = ( new AttributeManagerImpl( rootPOA ) )._this( - anORB ); - rootPOA.the_POAManager().activate(); - m_clientReference = AttributeManagerHelper.narrow( - forceMarshal( m_ServerReference ) ); - } - catch ( org.omg.CORBA.UserException ex ) - { - fail( "exception during setup:" + ex.toString() ); - } - } - - /** - * Simple struct echo. - */ - public void testGetAttributeDefinitions() - { - System.out.println( "Test: " + this.getClass().getName() - + ".testGetAttributeDefinitions" ); - AttributeDefinition[] anAttributeDefinitionArray = - m_clientReference.getAttributeDefinitions(); - } - - /** - * The entry point of the test case. - * - * @param args The command line arguments. - */ - public static void main( String[] args ) - { - System.out.println( "Executing the " + FragmentedMessageTest.class.getName() + "..." ); - junit.textui.TestRunner.run( new TestSuite( FragmentedMessageTest.class ) ); - } -} - +/* +* Copyright (C) The Community OpenORB Project. All rights reserved. +* +* This software is published under the terms of The OpenORB Community Software +* License version 1.0, a copy of which has been included with this distribution +* in the LICENSE.txt file. +*/ + +package org.openorb.orb.test.iiop.fragmentedmessage; + +import junit.framework.TestSuite; + +import org.omg.PortableServer.POA; +import org.openorb.orb.test.ORBTestCase; + +import org.omg.CORBA.ORB; + +import java.util.Properties; + +/** + * Tests marshaling and unmarshaling of various iiop types. + * + * @author Michael Macaluso + */ +public class FragmentedMessageTest + extends ORBTestCase +{ + private AttributeManager m_serverReference; + private AttributeManager m_clientReference; + + /** + * Constructor. + * + * @param name The name of the test case. + */ + public FragmentedMessageTest( String name ) + { + super( name ); + } + + /** + * Return the activated server reference. + * + * @return The server reference. + */ + public AttributeManager getReference() + { + return m_serverReference; + } + + /** + * Set up the test case. + */ + protected void setUp() + { + Properties aProperties = new Properties(); + aProperties.put( "org.omg.CORBA.ORBClass", "org.openorb.orb.core.ORB" ); + aProperties.put( "org.omg.CORBA.ORBSingletonClass", "org.openorb.orb.core.ORBSingleton" ); + + super.setUp( aProperties ); + + try + { + ORB anORB = getORB(); + POA rootPOA = ( POA ) anORB.resolve_initial_references( "RootPOA" ); + m_serverReference = ( new AttributeManagerImpl( rootPOA ) )._this( + anORB ); + rootPOA.the_POAManager().activate(); + m_clientReference = AttributeManagerHelper.narrow( + forceMarshal( m_serverReference ) ); + } + catch ( org.omg.CORBA.UserException ex ) + { + fail( "exception during setup:" + ex.toString() ); + } + } + + /** + * Simple struct echo. + */ + public void testGetAttributeDefinitions() + { + System.out.println( "Test: " + this.getClass().getName() + + ".testGetAttributeDefinitions" ); + AttributeDefinition[] anAttributeDefinitionArray = + m_clientReference.getAttributeDefinitions(); + } + + /** + * The entry point of the test case. + * + * @param args The command line arguments. + */ + public static void main( String[] args ) + { + if ( args.length > 0 && args[ 0 ].equals( "server" ) ) + { + FragmentedMessageTest test = new FragmentedMessageTest( "standalone" ); + test.setUp(); + String reference = test.getORB().object_to_string( test.getReference() ); + try + { + java.io.FileOutputStream file = new java.io.FileOutputStream( "ObjectId" ); + java.io.PrintStream pfile = new java.io.PrintStream( file ); + pfile.println( reference ); + file.close(); + } + catch ( java.io.IOException ex ) + { + System.out.println( "File error" ); + } + test.getORB().run(); + } + else if ( args.length > 0 && args[ 0 ].equals( "client" ) ) + { + org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init( args, null ); + org.omg.CORBA.Object obj = null; + try + { + java.io.FileInputStream file = new java.io.FileInputStream( "ObjectId" ); + java.io.InputStreamReader myInput = new java.io.InputStreamReader( file ); + java.io.BufferedReader reader = new java.io.BufferedReader( myInput ); + String ref = reader.readLine(); + obj = orb.string_to_object( ref ); + } + catch ( java.io.IOException ex ) + { + ex.printStackTrace(); + } + + try + { + AttributeManager mgr = AttributeManagerHelper.narrow( obj ); + System.out.println( "Test: AttributeManager.getAttributeDefinitions" ); + AttributeDefinition[] anAttributeDefinitionArray = + mgr.getAttributeDefinitions(); + } + catch ( Exception ex ) + { + System.out.println( "An unknown exception occured!" ); + ex.printStackTrace(); + } + } + else + { + System.out.println( "Executing the " + FragmentedMessageTest.class.getName() + "..." ); + junit.textui.TestRunner.run( new TestSuite( FragmentedMessageTest.class ) ); + } + } +} Index: ObjectIdImpl.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/iiop/fragmentedmessage/ObjectIdImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ObjectIdImpl.java 9 Aug 2004 10:06:09 -0000 1.1 +++ ObjectIdImpl.java 11 Aug 2004 10:23:47 -0000 1.2 @@ -1,174 +1,176 @@ -/* -* Copyright (C) The Community OpenORB Project. All rights reserved. -* -* This software is published under the terms of The OpenORB Community Software -* License version 1.0, a copy of which has been included with this distribution -* in the LICENSE.txt file. -*/ - -package org.openorb.orb.test.iiop.fragmentedmessage; - -/** - * @author Michael Macaluso - */ -public final class ObjectIdImpl - extends ObjectId - implements Comparable -{ - public static final int NULL_HASHCODE = -1; - - public ObjectIdImpl() - { - } - - public ObjectIdImpl( String id ) - { - objectid = id; - } - - public void marshal( org.omg.CORBA.DataOutputStream os ) - { - boolean isNull = ( null == objectid ); - - os.write_boolean( isNull ); - - if ( !isNull ) - { - os.write_wstring( objectid ); - } - } - - public void unmarshal( org.omg.CORBA.DataInputStream is ) - { - boolean isNull = is.read_boolean(); - - if ( isNull ) - { - objectid = null; - } - else - { - objectid = is.read_wstring(); - } - } - - public boolean equals( Object anObject ) - { - if ( null == anObject ) - { - return false; - } - - Class aClass = anObject.getClass(); - - if ( aClass == ObjectIdImpl.class ) - { - return equals( ( ObjectIdImpl ) anObject ); - } - else if ( aClass == String.class ) - { - return equals( ( String ) anObject ); - } - - return false; - } - - public boolean equals( ObjectIdImpl anObject ) - { - if ( null == anObject ) - { - return false; - } - - return equals( anObject.objectid ); - } - - public boolean equals( String anObject ) - { - if ( null == anObject ) - { - return ( objectid == null ); - } - - return anObject.equals( objectid ); - } - - public int hashCode() - { - if ( null == objectid ) - { - return NULL_HASHCODE; - } - else - { - return objectid.hashCode(); - } - } - - public int compare( Object anObject ) - { - return compareTo( anObject ); - } - - public int compareTo( Object anObject ) - { - if ( null == anObject ) - { - return -1; - } - - Class aClass = anObject.getClass(); - - if ( aClass == ObjectIdImpl.class ) - { - return compareTo( ( ObjectIdImpl ) anObject ); - } - else if ( aClass == String.class ) - { - return compareTo( ( String ) anObject ); - } - - return -1; - } - - public int compareTo( ObjectIdImpl anObject ) - { - if ( null == anObject ) - { - return -1; - } - - return compareTo( anObject.objectid ); - } - - public int compareTo( String anObject ) - { - if ( null == anObject ) - { - if ( null == objectid ) - { - return 0; - } - else - { - return -1; - } - } - else - { - if ( null == objectid ) - { - return 1; - } - else - { - return objectid.compareTo( anObject ); - } - } - } - - public String toString() - { - return objectid; - } -} +/* +* Copyright (C) The Community OpenORB Project. All rights reserved. +* +* This software is published under the terms of The OpenORB Community Software +* License version 1.0, a copy of which has been included with this distribution +* in the LICENSE.txt file. +*/ + +package org.openorb.orb.test.iiop.fragmentedmessage; + +/** + * This is the implementation of the custom valuetype ObjectId. + * + * @author Michael Macaluso + */ +public final class ObjectIdImpl + extends ObjectId + implements Comparable +{ + public static final int NULL_HASHCODE = -1; + + public ObjectIdImpl() + { + } + + public ObjectIdImpl( String id ) + { + objectid = id; + } + + public void marshal( org.omg.CORBA.DataOutputStream os ) + { + boolean isNull = ( null == objectid ); + + os.write_boolean( isNull ); + + if ( !isNull ) + { + os.write_wstring( objectid ); + } + } + + public void unmarshal( org.omg.CORBA.DataInputStream is ) + { + boolean isNull = is.read_boolean(); + + if ( isNull ) + { + objectid = null; + } + else + { + objectid = is.read_wstring(); + } + } + + public boolean equals( Object anObject ) + { + if ( null == anObject ) + { + return false; + } + + Class aClass = anObject.getClass(); + + if ( aClass == ObjectIdImpl.class ) + { + return equals( ( ObjectIdImpl ) anObject ); + } + else if ( aClass == String.class ) + { + return equals( ( String ) anObject ); + } + + return false; + } + + public boolean equals( ObjectIdImpl anObject ) + { + if ( null == anObject ) + { + return false; + } + + return equals( anObject.objectid ); + } + + public boolean equals( String anObject ) + { + if ( null == anObject ) + { + return ( objectid == null ); + } + + return anObject.equals( objectid ); + } + + public int hashCode() + { + if ( null == objectid ) + { + return NULL_HASHCODE; + } + else + { + return objectid.hashCode(); + } + } + + public int compare( Object anObject ) + { + return compareTo( anObject ); + } + + public int compareTo( Object anObject ) + { + if ( null == anObject ) + { + return -1; + } + + Class aClass = anObject.getClass(); + + if ( aClass == ObjectIdImpl.class ) + { + return compareTo( ( ObjectIdImpl ) anObject ); + } + else if ( aClass == String.class ) + { + return compareTo( ( String ) anObject ); + } + + return -1; + } + + public int compareTo( ObjectIdImpl anObject ) + { + if ( null == anObject ) + { + return -1; + } + + return compareTo( anObject.objectid ); + } + + public int compareTo( String anObject ) + { + if ( null == anObject ) + { + if ( null == objectid ) + { + return 0; + } + else + { + return -1; + } + } + else + { + if ( null == objectid ) + { + return 1; + } + else + { + return objectid.compareTo( anObject ); + } + } + } + + public String toString() + { + return objectid; + } +} Index: package.html =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/test/org/openorb/orb/test/iiop/fragmentedmessage/package.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- package.html 9 Aug 2004 10:06:09 -0000 1.1 +++ package.html 11 Aug 2004 10:23:47 -0000 1.2 @@ -1,5 +1,5 @@ -<body> -<p> -IIOP test case to create multiple large fragments. -</p> -</body> +<body> +<p> +IIOP test case to create multiple large fragments. +</p> +</body> |
|
From: <lk...@us...> - 2004-08-10 19:00:14
|
Update of /cvsroot/openorb/PersistentStateService/src/main/org/openorb/pss/connector/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7930/src/main/org/openorb/pss/connector/database Modified Files: DatabaseSession.java Log Message: Fixed memory leak in Database connector that occured when DB went down. Patch provided by Thomas Haug and Matthias Grosam (Siemens) After an SQL Exception the DB Connection is now tested. Index: DatabaseSession.java =================================================================== RCS file: /cvsroot/openorb/PersistentStateService/src/main/org/openorb/pss/connector/database/DatabaseSession.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- DatabaseSession.java 10 Feb 2004 21:19:15 -0000 1.11 +++ DatabaseSession.java 10 Aug 2004 19:00:05 -0000 1.12 @@ -17,6 +17,12 @@ public class DatabaseSession extends org.openorb.pss.connector.database.DatabaseCatalog implements org.omg.CosPersistentState.Session, org.openorb.pss.connector.database.DatabaseCatalogBase { + + /** + * time to wait until next check of database connection. + */ + private static final long CHECK_CONNECTION_RETRY_TIME = 5000; + /** * Tables list */ @@ -110,14 +116,14 @@ { String sql_type = getParameter( "sql_type" ); - org.openorb.pss.util.debug.print( "sql_type in configuration is " + sql_type ); + org.openorb.pss.util.debug.print( "sql_type in configuration is " + sql_type ); if ( sql_type != null ) _binary_type = sql_type; } catch ( Throwable throwable ) { - throwable.printStackTrace(); + throwable.printStackTrace(); } // Here we have to open a simple connection to a database @@ -312,8 +318,8 @@ org.omg.CosPersistentState.Parameter [] params = parameters(); // Is the parameter provided from the source code ? - if ( null != params ) - { + if ( null != params ) + { for ( int i = 0; i < params.length; i++ ) { if ( params[ i ].name.equalsIgnoreCase( parameter_name ) ) @@ -321,11 +327,11 @@ return params[ i ].val.extract_string(); } } - } - else - { - org.openorb.pss.util.debug.print( "Params is null." ); - } + } + else + { + org.openorb.pss.util.debug.print( "Params is null." ); + } // In this case, the parameter must be found in the configuration file org.openorb.orb.config.ORBLoader cfg = ( ( org.openorb.orb.core.ORB ) ( ( ( org.openorb.orb.pi.OpenORBInitInfo ) _info ).orb() ) ).getLoader(); @@ -348,25 +354,26 @@ private boolean tableExist( String table_name ) { org.openorb.pss.util.debug.print( "Check if a table exist [ " + table_name + " ]" ); - + java.sql.ResultSet result = null; + boolean returnValue = false; try { - java.sql.DatabaseMetaData meta_data = _datastore.getMetaData(); - java.sql.ResultSet result = meta_data.getTables( null, null, table_name, null ); - - if ( result.next() == false ) - return false; - - return true; + result = meta_data.getTables( null, null, table_name, null ); + returnValue = result.next(); } catch ( java.sql.SQLException ex ) { // TODO: change this to an exception or log as a warning System.out.println( "OpenORB CosPSS error : Unable to get information about tables... : " + ex.toString() ); + this.checkConnection(); + } + finally + { + this.closeResources( result, null ); } - return false; + return returnValue; } /** @@ -390,10 +397,10 @@ private void createTable( String table_name, org.openorb.pss.connector.database.PersistentObjectHome home ) { org.openorb.pss.util.debug.print( "Create a new table [ " + table_name + " ]" ); - + java.sql.Statement stmt = null; try { - java.sql.Statement stmt = _datastore.createStatement(); + stmt = _datastore.createStatement(); String [] members = home.getHomeMembers(); @@ -405,13 +412,16 @@ order = order + " )"; stmt.executeUpdate( order ); - - stmt.close(); } catch ( java.sql.SQLException ex ) { ex.printStackTrace(); System.out.println( "openORB CosPSS error : Unable to create a table..." ); + this.checkConnection(); + } + finally + { + this.closeResources( null, stmt ); } } @@ -428,20 +438,24 @@ org.openorb.pss.util.debug.print( "Remove a table [ " + table_name + " ]" ); + java.sql.Statement stmt = null; try { - java.sql.Statement stmt = _datastore.createStatement(); + stmt = _datastore.createStatement(); String order = "DROP TABLE " + table_name; stmt.executeUpdate( order ); - - stmt.close(); } catch ( java.sql.SQLException ex ) { ex.printStackTrace(); System.out.println( "OpenORB CosPSS error : Unable to delete a table..." ); + this.checkConnection(); + } + finally + { + this.closeResources( null, stmt ); } } @@ -455,20 +469,22 @@ String table = ( String ) _tables.get( home_pid.catalog_value_str() ); java.sql.ResultSet res = getLine( table, type_pid ); - + boolean returnValue = false; try { - if ( res.next() == false ) - return false; - - return true; + returnValue = res.next(); } catch ( java.sql.SQLException ex ) { ex.printStackTrace(); + this.checkConnection(); + } + finally + { + this.closeResources( res, null ); } - return false; + return returnValue; } /** @@ -635,7 +651,7 @@ } catch ( java.lang.Exception ex ) { - ex.printStackTrace(); + ex.printStackTrace(); } } @@ -646,13 +662,16 @@ pstmt.executeUpdate(); - pstmt.close(); } catch ( java.sql.SQLException ex ) { - ex.printStackTrace(); + ex.printStackTrace(); + this.checkConnection(); + } + finally + { + this.closeResources( null, pstmt ); } - } /** @@ -684,10 +703,15 @@ pstmt.executeUpdate(); - pstmt.close(); } catch ( java.sql.SQLException ex ) - {} + { + this.checkConnection(); + } + finally + { + this.closeResources( null, pstmt ); + } } @@ -734,18 +758,24 @@ res = pstmt.executeQuery(); - if ( res.next() == false ) + if ( !res.next() ) + { + this.closeResources( res, pstmt ); throw new org.openorb.pss.connector.database.NotFoundException(); - + } byte [] pid = res.getBytes( 1 ); - pstmt.close(); - _pid = org.openorb.pss.connector.database.PIDFactory.pid_byte_to_pid( pid ); } catch ( java.lang.Exception ex ) - { } + { + this.checkConnection(); + } + finally + { + this.closeResources( res, pstmt ); + } if ( _pid == null ) throw new org.openorb.pss.connector.database.NotFoundException(); @@ -780,11 +810,16 @@ list.addElement( org.openorb.pss.connector.database.PIDFactory.pid_byte_to_pid( pid ) ); } - pstmt.close(); } catch ( java.lang.Exception ex ) - { } + { + this.checkConnection(); + } + finally + { + this.closeResources( res, pstmt ); + } org.openorb.pss.connector.PID [] pids = new org.openorb.pss.connector.PID[ list.size() ]; @@ -920,10 +955,10 @@ private java.sql.ResultSet getLine( String table_name, org.openorb.pss.connector.PID pid ) { java.sql.ResultSet res = null; - + java.sql.PreparedStatement pstmt = null; try { - java.sql.PreparedStatement pstmt = _datastore.prepareStatement( "SELECT * from " + table_name + " WHERE pid=?" ); + pstmt = _datastore.prepareStatement( "SELECT * from " + table_name + " WHERE pid=?" ); pstmt.setBytes( 1, pid.value() ); @@ -935,6 +970,11 @@ catch ( java.sql.SQLException ex ) { System.out.println( "openORB CosPSS error : Unable to get a table entry !" ); + this.checkConnection(); + } + finally + { + this.closeResources( res, pstmt ); } return res; @@ -948,6 +988,112 @@ return ( System.currentTimeMillis() * 32 ); //+ org.openorb.orb.core.ORBSingleton.oa.get_listener()._get_port(); } + /** + * Helper method for closing resources (result set, sql statement). + * This method is called from finally clauses and is necessary for + * avoiding memory leaks. + * + * @param result The result set of sql query. + * @param statement The sql statement. + */ + private void closeResources( java.sql.ResultSet result, java.sql.Statement statement ) + { + if ( result != null ) + { + try + { + result.close(); + } + catch ( java.sql.SQLException e ) + { + e.printStackTrace(); + System.out.println( "Error while closing SQL result." ); + } + } + if ( statement != null ) + { + try + { + statement.close(); + } + catch( java.sql.SQLException e ) + { + e.printStackTrace(); + System.out.println("Error while closing SQL statement." ); + } + } + } + + /** + * If a <code>SQLException</code> has occured this method is called for + * checking the connection to the database. If the connection is broken, this + * method tries to create a new connection till it succeeds. + */ + private void checkConnection() + { + // TODO: Prevent executing this code from multiple threads simultaniously + while( !executeCheckQuery() ) + { + try + { + Thread.sleep( CHECK_CONNECTION_RETRY_TIME ); + } + catch( InterruptedException e ) + { + e.printStackTrace(); + } + } + } + + /** + * Executes a simple query for checking database connection. If + * it fails a new connection is created. + * + * @return true, if connection works + * false, if connection is broken + */ + private boolean executeCheckQuery() + { + org.openorb.pss.util.debug.print( "Checking database connection" ); + String testStatement = getParameter( "ConnectionTestSQL" ); + if ( testStatement == null ) + { + // select without from clause, works with MySql, Sybase and maybe others. + // Oracle requires a from clause, so Oracle users should provide + // a statement in ConnectionTestSQL that refers to an existing table. + testStatement = "SELECT 1 + 1"; + } + + java.sql.Statement stmt = null; + boolean isOK = false; + try + { + stmt = this._datastore.createStatement(); + stmt.execute( testStatement ); + isOK = true; + } + catch( Exception e ) + { + e.printStackTrace(); + System.out.println("Database connection is broken. Try to create a new connection..."); + try + { + this._datastore = this.connectToDatabase(); + } + catch ( Exception exc ) + { + exc.printStackTrace(); + System.out.println("Error while creating a new database connection."); + } + } + finally + { + this.closeResources( null, stmt ); + } + return isOK; + } + + /*private org.openorb.orb.iiop.CDROutputStream getCDROutputStream() { org.openorb.orb.io.MarshalBuffer marshal = new org.openorb.orb.io.MarshalBuffer(); |
|
From: <lk...@us...> - 2004-08-10 19:00:13
|
Update of /cvsroot/openorb/PersistentStateService In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7930 Modified Files: WHATSNEW Log Message: Fixed memory leak in Database connector that occured when DB went down. Patch provided by Thomas Haug and Matthias Grosam (Siemens) After an SQL Exception the DB Connection is now tested. Index: WHATSNEW =================================================================== RCS file: /cvsroot/openorb/PersistentStateService/WHATSNEW,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- WHATSNEW 29 Jul 2004 09:48:12 -0000 1.39 +++ WHATSNEW 10 Aug 2004 19:00:04 -0000 1.40 @@ -1,6 +1,16 @@ OpenORB PersistentStateService ------------------------------ +- After an SQL Exception the DB Connection is now tested by executing + a select statement. By default that statement is "SELECT 1 + 1" but + can be overwritten for Database engines (e.g. Oracle) that do not + allow select statements without a from clause. The property to set + is "pss.Database.ConnectionTestSQL". + +- Fixed memory leak in Database connector that occured when DB went down. + Patch provided by Thomas Haug and Matthias Grosam (Siemens) + + Version 1.4.0 BETA2 - July, 29 2004 - PersistentStateService_1_4_0_BETA2 - Fixed examples: org.openorb.pss.examples. |
|
From: Michael R. <mr...@us...> - 2004-08-10 13:29:18
|
Update of /cvsroot/openorb/OpenORB/src/examples/org/openorb/orb/examples/dynany In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7788/src/examples/org/openorb/orb/examples/dynany Modified Files: Client.java Server.java Log Message: Fixed the remaining checkstyle warnings Index: Client.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/examples/org/openorb/orb/examples/dynany/Client.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Client.java 19 Feb 2004 07:21:30 -0000 1.4 +++ Client.java 10 Aug 2004 13:28:38 -0000 1.5 @@ -8,8 +8,9 @@ package org.openorb.orb.examples.dynany; -public class Client +public final class Client { + // do not instantiate private Client() { } Index: Server.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/examples/org/openorb/orb/examples/dynany/Server.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Server.java 19 Feb 2004 07:21:30 -0000 1.3 +++ Server.java 10 Aug 2004 13:28:38 -0000 1.4 @@ -8,8 +8,9 @@ package org.openorb.orb.examples.dynany; -public class Server +public final class Server { + // do not instantiate private Server() { } |
|
From: Michael R. <mr...@us...> - 2004-08-10 13:29:17
|
Update of /cvsroot/openorb/OpenORB/src/examples/org/openorb/orb/examples/any In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7788/src/examples/org/openorb/orb/examples/any Modified Files: Client.java Server.java Log Message: Fixed the remaining checkstyle warnings Index: Client.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/examples/org/openorb/orb/examples/any/Client.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Client.java 19 Feb 2004 07:21:29 -0000 1.4 +++ Client.java 10 Aug 2004 13:28:38 -0000 1.5 @@ -8,8 +8,9 @@ package org.openorb.orb.examples.any; -public class Client +public final class Client { + // do not instantiate private Client() { } Index: Server.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/examples/org/openorb/orb/examples/any/Server.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Server.java 19 Feb 2004 07:21:29 -0000 1.5 +++ Server.java 10 Aug 2004 13:28:38 -0000 1.6 @@ -8,8 +8,9 @@ package org.openorb.orb.examples.any; -public class Server +public final class Server { + // do not instantiate private Server() { } |
|
From: Michael R. <mr...@us...> - 2004-08-10 13:29:17
|
Update of /cvsroot/openorb/OpenORB/src/examples/org/openorb/orb/examples/dsi/boa In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7788/src/examples/org/openorb/orb/examples/dsi/boa Modified Files: Client.java Added Files: Server.java Removed Files: DynServer.java Log Message: Fixed the remaining checkstyle warnings --- NEW FILE: Server.java --- /* * Copyright (C) The Community OpenORB Project. All rights reserved. * * This software is published under the terms of The OpenORB Community Software * License version 1.0, a copy of which has been included with this distribution * in the LICENSE.txt file. */ package org.openorb.orb.examples.dsi.boa; public final class Server { // do not instantiate private Server() { } public static void main( String[] args ) { java.util.Properties props = new java.util.Properties(); props.setProperty( "ImportModule.BOA", "${openorb.home}config/default.xml#BOA" ); org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init( args, props ); org.omg.CORBA.BOA boa = org.omg.CORBA.BOA.init( orb, args ); DynSkeleton skeleton = new DynSkeleton( orb ); boa.connect( skeleton ); boa.obj_is_ready( skeleton ); try { String ref = orb.object_to_string( skeleton ); java.io.FileOutputStream file = new java.io.FileOutputStream( "ObjectId" ); java.io.PrintStream pfile = new java.io.PrintStream( file ); pfile.println( ref ); pfile.close(); } catch ( java.io.IOException ex ) { ex.printStackTrace(); System.exit( 0 ); } try { System.out.println( " The server is ready..." ); boa.impl_is_ready(); } catch ( org.omg.CORBA.SystemException ex ) { ex.printStackTrace(); } } } Index: Client.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/examples/org/openorb/orb/examples/dsi/boa/Client.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Client.java 19 Feb 2004 07:21:29 -0000 1.3 +++ Client.java 10 Aug 2004 13:28:38 -0000 1.4 @@ -8,8 +8,9 @@ package org.openorb.orb.examples.dsi.boa; -public class Client +public final class Client { + // do not instantiate private Client() { } --- DynServer.java DELETED --- |