Examples of MARSHAL


Examples of com.caucho.quercus.marshal.Marshal

    int size = getSize();

    T[] array = T[].class.cast(Array.newInstance(elementType, size));

    MarshalFactory factory = env.getModuleContext().getMarshalFactory();
    Marshal elementMarshal = factory.create(elementType);

    int i = 0;

    for (Entry ptr = getHead(); ptr != null; ptr = ptr.getNext()) {
      Array.set(array, i++, elementMarshal.marshal(env,
                                                   ptr.getValue(),
                                                   elementType));
    }

    return array;
View Full Code Here

Examples of com.sun.star.lib.iiopbridge.Marshal

        try
        {
        // structure marshaling
        StructTest aS = new StructTest( 2 );
       
        Marshal aM = new Marshal( false, null );
        aM.write_struct( aS );
        Unmarshal aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        StructTest aS2 = (StructTest)aUM.read_struct( StructTest.class );
       
        if( !aS.equals( aS2 ) )
            System.err.println( "error: Struct marshal" );
           
        // exception marshaling
        ExceptionTest aE = new ExceptionTest( "Exception" );
        aE.nByte = 1;
        aE.nShort = 300;
        aE.nInt = 100000;
        aE.nLong = 10000000;
        aE.nFloat = (float)0.111;
        aE.nDouble = 111.111;
        aE.cChar = 'a';
        aE.bBoolean = true;
        aE.aString = "hallo";
        aE.aAscii = new Ascii( 'a' );
        aE.aAsciiString = new AsciiString( "asciistring" );
       
        aM = new Marshal( false, null );
        aM.write_exception( aE );
        aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        ExceptionTest aE2 = (ExceptionTest)aUM.read_exception( ExceptionTest.class );
       
        if( !aE2.getMessage().equals( "Exception")
          || aE2.nByte != 1
          || aE2.nByte != 1
          || aE2.nShort != 300
          || aE2.nInt != 100000
          || aE2.nLong != 10000000
          || aE2.nFloat != (float)0.111
          || aE2.nDouble != 111.111
          || aE2.cChar != 'a'
          || aE2.bBoolean != true
          || !aE2.aString.equals( "hallo" )
          || aE2.aAscii.ascii != 'a'
          || !aE2.aAsciiString.asciistring.equals( "asciistring" ) )
            System.err.println( "error: Exception marshal" );

        // byte sequence marshaling
        byte szB[] = { 3, 5 };
        aM = new Marshal( false, null );
        aM.write_sequence( szB );
        aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        byte szB2 [] = (byte [])aUM.read_sequence( szB.getClass() );
       
        if( szB2[0] != 3
          || szB2[1] != 5 )
            System.err.println( "error: byte sequence marshal" );
           
        // enum sequence marshaling
        TCKind szE[] = { TCKind.tk_ulonglong, TCKind.tk_longlong };
        aM = new Marshal( false, null );
        aM.write_sequence( szE );
        aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        TCKind szE2 [] = (TCKind [])aUM.read_sequence( szE.getClass() );
       
        if( szE2[0] != TCKind.tk_ulonglong
          || szE2[1] != TCKind.tk_longlong )
            System.err.println( "error: byte sequence marshal" );
           
        // struct sequence marshaling
        StructTest szST[] = { aS };
        aM = new Marshal( false, null );
        aM.write_sequence( szST );
        aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        szST = (StructTest [])aUM.read_sequence( szST.getClass() );
       
        if( szST[0].nByte != 1
          || szST[0].nByte != 1
          || szST[0].nShort != 300
          || szST[0].nInt != 100000
          || szST[0].nLong != 10000000
          || szST[0].nFloat != (float)0.111
          || szST[0].nDouble != 111.111
          || szST[0].cChar != 'a'
          || szST[0].bBoolean != true
          || !szST[0].aString.equals( "hallo" )
          || szST[0].aAscii.ascii != 'a'
          || !szST[0].aAsciiString.asciistring.equals( "asciistring" )
          || aS.eEnum != TCKind.tk_ulonglong )
            System.err.println( "error: Struct marshal" );
           
        {
        // any byte marshaling
        Byte any = new Byte( (byte)1 );
        aM = new Marshal( false, null );
        aM.write_any( any );
        aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        any = (Byte)aUM.read_any();
        if( any.byteValue() != 1 )
            System.err.println( "error: byte any marshal" );
        }

        {
        // any short marshaling
        Short any = new Short( (byte)1 );
        aM = new Marshal( false, null );
        aM.write_any( any );
        aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        any = (Short)aUM.read_any();
        if( any.shortValue() != 1 )
            System.err.println( "error: short any marshal" );
        }

        {
        // any int marshaling
        Integer any = new Integer( (byte)1 );
        aM = new Marshal( false, null );
        aM.write_any( any );
        aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        any = (Integer)aUM.read_any();
        if( any.intValue() != 1 )
            System.err.println( "error: int any marshal" );
        }

        {
        // any long marshaling
        Long any = new Long( (byte)1 );
        aM = new Marshal( false, null );
        aM.write_any( any );
        aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        any = (Long)aUM.read_any();
        if( any.longValue() != 1 )
            System.err.println( "error: long any marshal" );
        }

        {
        // any float marshaling
        Float any = new Float( (byte)1 );
        aM = new Marshal( false, null );
        aM.write_any( any );
        aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        any = (Float)aUM.read_any();
        if( any.intValue() != 1 )
            System.err.println( "error: float any marshal" );
        }

        {
        // any double marshaling
        Double any = new Double( (byte)1 );
        aM = new Marshal( false, null );
        aM.write_any( any );
        aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        any = (Double)aUM.read_any();
        if( any.intValue() != 1 )
            System.err.println( "error: double any marshal" );
        }

        {
        // any boolean marshaling
        Boolean any = new Boolean( true );
        aM = new Marshal( false, null );
        aM.write_any( any );
        aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        any = (Boolean)aUM.read_any();
        if( !any.booleanValue() )
            System.err.println( "error: bool any marshal" );
        }

        {
        // any char marshaling
        Character any = new Character( 'a' );
        aM = new Marshal( false, null );
        aM.write_any( any );
        aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        any = (Character)aUM.read_any();
        if( 'a' != any.charValue() )
            System.err.println( "error: char any marshal" );
        }

        {
        // any char marshaling
        String any = new String( "a" );
        aM = new Marshal( false, null );
        aM.write_any( any );
        aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        any = (String)aUM.read_any();
        if( !any.equals( "a") )
            System.err.println( "error: char any marshal" );
        }

        {
        // any structure marshaling
        StructTest any = new StructTest( 2 );
       
        aM = new Marshal( false, null );
        aM.write_any( aS );
        aUM = new Unmarshal( aM.getByteArray(), aM.getSize(), false, null );
        any = (StructTest)aUM.read_any();
        if( !any.equals( new StructTest( 2 ) ) )
            System.err.println( "error: struct any marshal" );
        }
       
View Full Code Here

Examples of org.fusesource.ide.camel.model.generated.Marshal

        imageProvider.addIconsForClass(new InterceptFrom());
        imageProvider.addIconsForClass(new InterceptSendToEndpoint());
        imageProvider.addIconsForClass(new LoadBalance());
        imageProvider.addIconsForClass(new Log());
        imageProvider.addIconsForClass(new Loop());
        imageProvider.addIconsForClass(new Marshal());
        imageProvider.addIconsForClass(new Multicast());
        imageProvider.addIconsForClass(new OnCompletion());
        imageProvider.addIconsForClass(new OnException());
        imageProvider.addIconsForClass(new Otherwise());
        imageProvider.addIconsForClass(new Pipeline());
View Full Code Here

Examples of org.omg.CORBA.MARSHAL

            try {
                // register mapping from old value to new
                put(object, val);
                return new Reader((Serializable) val, contents);
            } catch (IOException ex) {
                throw new MARSHAL(ex.getMessage());
            }

        }
View Full Code Here

Examples of org.omg.CORBA.MARSHAL

            try {
                return (java.io.Serializable) _write_replace_method.invoke(val,
                        NO_ARGS);

            } catch (java.lang.IllegalAccessException ex) {
                throw new MARSHAL("cannot call " + _write_replace_method);

            } catch (IllegalArgumentException ex) {
                throw new MARSHAL(ex.getMessage());

            } catch (InvocationTargetException ex) {
                throw new org.omg.CORBA.portable.UnknownException(ex
                        .getTargetException());
            }
View Full Code Here

Examples of org.omg.CORBA.MARSHAL

            try {
                return (java.io.Serializable) _read_resolve_method.invoke(val,
                        NO_ARGS);

            } catch (java.lang.IllegalAccessException ex) {
                throw new MARSHAL("cannot call " + _read_resolve_method);

            } catch (IllegalArgumentException ex) {
                throw new MARSHAL(ex.getMessage());

            } catch (InvocationTargetException ex) {
                throw new org.omg.CORBA.portable.UnknownException(ex
                        .getTargetException());
            }
View Full Code Here

Examples of org.omg.CORBA.MARSHAL

                    .doPrivileged(new java.security.PrivilegedAction() {
                        public Object run() {
                            try {
                                return new CorbaObjectWriter(out, value);
                            } catch (java.io.IOException ex) {
                                throw new MARSHAL(ex.toString());
                            }
                        }
                    });

            writeValue(writer, value);

        } catch (java.io.IOException ex) {
            throw new MARSHAL(ex.getMessage());
        }
    }
View Full Code Here

Examples of org.omg.CORBA.MARSHAL

            try {
                writer.invokeWriteObject(this, val, _write_object_method);

            } catch (IllegalAccessException ex) {
                throw new MARSHAL(ex.getMessage());

            } catch (IllegalArgumentException ex) {
                throw new MARSHAL(ex.getMessage());

            } catch (InvocationTargetException ex) {

                throw new org.omg.CORBA.portable.UnknownException(ex
                        .getTargetException());
View Full Code Here

Examples of org.omg.CORBA.MARSHAL

            try {
                return (java.io.Serializable) _constructor
                        .newInstance(new Object[0]);

            } catch (java.lang.IllegalAccessException ex) {
                throw new MARSHAL("cannot call " + _constructor);

            } catch (IllegalArgumentException ex) {
                throw new MARSHAL(ex.getMessage());

            } catch (InstantiationException ex) {
                throw new MARSHAL(ex.getMessage());

            } catch (InvocationTargetException ex) {
                throw new org.omg.CORBA.portable.UnknownException(ex
                        .getTargetException());
View Full Code Here

Examples of org.omg.CORBA.MARSHAL

                        public Object run() {
                            try {
                                return new CorbaObjectReader(in, offsetMap,
                                        value);
                            } catch (java.io.IOException ex) {
                                throw new MARSHAL(ex.getMessage());
                            }
                        }
                    });

            readValue(reader, value);

            return readResolve(value);

        } catch (java.io.IOException ex) {
            throw new MARSHAL(ex.getMessage());
        }

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.