Package bm.core.io

Examples of bm.core.io.SerializationException


//            log.debug( "serialize: " + out );
            save( out );
        }
        catch( IOException e )
        {
            throw new SerializationException( CoreConstants.ERR_PRP_SERIALIZE, e );
        }
    }
View Full Code Here


//            log.debug( "deserialize: " + in );
            load( in );
        }
        catch( IOException e )
        {
            throw new SerializationException( CoreConstants.ERR_PRP_DESERIALIZE, e );
        }
    }
View Full Code Here

                {
                    argClasses.addElement( clazz.getClassLoader().load( name ) );
                }
                catch( ScriptingClassNotFoundException e )
                {
                    throw new SerializationException(
                            Constants.ERR_MET_CLASS_NOT_FOUND,
                            e
                    );
                }
            }
View Full Code Here

                    {
                        clazz = classLoader.load( className );
                    }
                    catch( ScriptingClassNotFoundException e )
                    {
                        throw new SerializationException(
                                Constants.ERR_SCL_CLASS_NOT_FOUND,
                                e
                        );
                    }
                }
                properties.put( name, clazz );
            }
        }
        else
        {
            properties = null;
        }
        final int methodCount = in.readInt();
        if( methodCount > 0 )
        {
            methods = new Hashtable( methodCount );
            for( int i = 0; i < methodCount; i++ )
            {
                final String name = in.readString();
                final Method method = new MethodImpl( this );
                method.deserialize( in );
                methods.put( name, method );
            }
        }
        else
        {
            methods = null;
        }
        final int ancestorCount = in.readInt();
        if( ancestorCount > 0 )
        {
            ancestors = new Vector( ancestorCount );
            for( int i = 0; i < ancestorCount; i++ )
            {
                final String name = in.readString();
                ScriptingClass clazz;
                try
                {
                    clazz = classLoader.load( name );
                }
                catch( ScriptingClassNotFoundException e )
                {
                    throw new SerializationException(
                            Constants.ERR_SCL_CLASS_NOT_FOUND,
                            e
                    );
                }
                ancestors.addElement( clazz );
View Full Code Here

                item = new ButtonDef();
                break;
        }
        if( item == null )
        {
            throw new SerializationException( 0, "Invalid item type" );
        }
        else
        {
            item.itemType = type;
            item.name = name;
View Full Code Here

                writeString( row.getParent().getParent().getName() );
                row.serialize( this );
            }
            catch( IOException e )
            {
                throw new SerializationException( CoreConstants.ERR_SOS, e );
            }
        }
        else
        {
            super.writeObject( o );
View Full Code Here

                    "serializeHeader",
                    null,
                    null,
                    e
            );
            throw new SerializationException( Constants.ERR_ROW_SERIALIZE_HEADER, e );
        }
    }
View Full Code Here

                        "deserializeHeader",
                        null,
                        null,
                        e
                );
                throw new SerializationException( Constants.ERR_ROW_DESERIALIZE_HEADER,  e );
            }
            for( int i = 0; i < count; i++ )
            {
                buffer[i] = in.readByte();
            }

            final ByteArrayInputStream bais = new ByteArrayInputStream( buffer );
            final DataInputStream dis = new DataInputStream( bais );

            version     = dis.readInt();
            id          = dis.readLong();
        }
        catch( IOException e )
        {
            ErrorLog.addError(
                    "Row",
                    "deserializeHeader",
                    null,
                    null,
                    e
            );
            throw new SerializationException( Constants.ERR_ROW_DESERIALIZE_HEADER, e );
        }
    }
View Full Code Here

                    "deserializeField",
                    new Object[] { new Integer( i ) },
                    "Invalid field index (" + toString() + "}",
                    null
            );
            throw new SerializationException( Constants.ERR_ROW_DESERIALIZE_FIELD, "Invalid field index: " + i );
        }
        try
        {
            // Local variables to improve speed on CDC
            final FieldInfo[] fieldInfo = parent.tableInfo.getFieldInfo();
            switch( fieldInfo[i].getType() )
            {
                case Constants.FT_BOOLEAN:
                    fields[i] = new Boolean( in.readBoolean() );
                    break;

                case Constants.FT_DATE:
                    fields[i] = in.readDate();
                    break;

                case Constants.FT_FIXED_POINT:
                    fields[i] = FixedPoint.deserialize( in, false );
                    break;

                case Constants.FT_INT:
                    fields[i] = new Integer( in.readInt() );
                    break;

                case Constants.FT_LONG:
                    fields[i] = new Long( in.readLong() );
                    break;

                case Constants.FT_SHORT:
                    fields[i] = new Short( in.readShort() );
                    break;

                case Constants.FT_STRING:
                    fields[i] = in.readString();
                    break;

                case Constants.FT_BVLOB:
                case Constants.FT_IMAGE:
                case Constants.FT_BLOB:
                    fields[i] = in.readBlob();
                    break;
            }
        }
        catch( Exception e )
        {
            throw new SerializationException(
                    Constants.ERR_ROW_DESERIALIZE_FIELD,
                    e
            );
        }
    }
View Full Code Here

                final String tableName = readString();
                final String dbName = readString();
                final Database db = Database.connect( dbName );
                if( db == null )
                {
                    throw new SerializationException(
                            CoreConstants.ERR_SOS,
                            "Invalid database: " + dbName
                    );
                }
                final Table table = db.getTable( tableName );
                if( table == null )
                {
                    throw new SerializationException(
                            CoreConstants.ERR_SOS,
                            "Invalid table: " + tableName
                    );
                }
                final Row row = table.createRow();
                row.deserialize( this );
                row.setRecordId( rid );
                return row;
            }
            else
            {
                return parseObject( type );
            }
        }
        catch( IOException e )
        {
            throw new SerializationException( CoreConstants.ERR_SOS, e );
        }
    }
View Full Code Here

TOP

Related Classes of bm.core.io.SerializationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.