Examples of StructValue


Examples of org.apache.etch.bindings.java.msg.StructValue

      {
        TodoManager.addTodo( new Todo()
        {
          public void doit( TodoManager mgr ) throws Exception
          {
            StructValue req = new StructValue( MyValueFactoryCuae._mt_etch_examples_cuae_Cuae_Request, vf );
            req.put( MyValueFactoryCuae._mf_code, code );
           
            Message msg = new Message( MyValueFactoryCuae._mt_etch_examples_cuae_CuaeClient_doit2, vf );
            msg.put( MyValueFactoryCuae._mf_req, req );
           
            Mailbox mb = svc.begincall( msg );
            Object value = svc.endcall( mb, MyValueFactoryCuae._mt_etch_examples_cuae_CuaeServer__result_doit2 );
           
            if (value instanceof Exception)
            {
              Exception e = (Exception) value;
              e.fillInStackTrace();
              throw e;
            }
           
            StructValue resp = (StructValue) value;
            MyValueFactoryCuae._mt_etch_examples_cuae_Cuae_Response.checkIsAssignableFrom( resp.type() );
            System.out.printf( "**** delayDoit2a: req %d response %s\n", code, resp );
          }

          public void exception( TodoManager mgr, Exception e )
          {
View Full Code Here

Examples of org.apache.etch.bindings.java.msg.StructValue

      {
        TodoManager.addTodo( new Todo()
        {
          public void doit( TodoManager mgr ) throws Exception
          {
            StructValue req = new StructValue( MyValueFactoryCuae._mt_etch_examples_cuae_Cuae_ReqWithMessage, vf );
            req.put( MyValueFactoryCuae._mf_code, code );
            req.put( MyValueFactoryCuae._mf_msg, message );
           
            Message msg = new Message( MyValueFactoryCuae._mt_etch_examples_cuae_CuaeClient_doit2, vf );
            msg.put( MyValueFactoryCuae._mf_req, req );
           
            Mailbox mb = svc.begincall( msg );
            Object value = svc.endcall( mb, MyValueFactoryCuae._mt_etch_examples_cuae_CuaeServer__result_doit2 );
           
            if (value instanceof Exception)
            {
              Exception e = (Exception) value;
              e.fillInStackTrace();
              throw e;
            }
           
            StructValue resp = (StructValue) value;
            MyValueFactoryCuae._mt_etch_examples_cuae_Cuae_Response.checkIsAssignableFrom( resp.type() );
            System.out.printf( "**** delayDoit2b: req %d response %s\n", code, resp );
          }

          public void exception( TodoManager mgr, Exception e )
          {
View Full Code Here

Examples of org.apache.etch.bindings.java.msg.StructValue

    }
  }

  private StructValue readStruct() throws IOException
  {
    StructValue sv = startStruct();
    readKeysAndValues( sv );
    endStruct( sv );
    return sv;
  }
View Full Code Here

Examples of org.apache.etch.bindings.java.msg.StructValue

  private StructValue startStruct() throws IOException
  {
    Type t = readType();
    int length = readLength();
   
    return new StructValue( t, vf, length );
  }
View Full Code Here

Examples of org.apache.etch.bindings.java.msg.StructValue

        break;
       
      case TypeCode.STRUCT:
      case TypeCode.CUSTOM:
      {
        StructValue struct = vf.exportCustomValue( value );
       
        if (struct == null)
          throw new UnsupportedOperationException( "unsupported type "+value.getClass() );
       
        te.setAttr( null, ELEMENT_TYPE_ATTR, CUSTOM_TYPE );
View Full Code Here

Examples of org.apache.etch.bindings.java.msg.StructValue

        writeBytes( ((String) value).getBytes( vf.getStringEncoding() ) );
        return;
     
      case TypeCode.CUSTOM:
      {
        StructValue struct = vf.exportCustomValue( value );
       
        if (struct == null)
          throw new UnsupportedOperationException( "unsupported type "+value.getClass() );
       
        writeStruct( struct );
View Full Code Here

Examples of org.apache.etch.bindings.java.msg.StructValue

 
  /** */
  @org.junit.Test
  public void test_S1_export()
  {
    StructValue sv = vf.exportCustomValue( new S1( 19, 23, 29 ) );
    sv.checkType( ValueFactoryTest1._mt_org_apache_etch_tests_Test1_S1 );
    assertEquals( 3, sv.size() );
    assertEquals( 19, sv.get( ValueFactoryTest1._mf_x ) );
    assertEquals( 23, sv.get( ValueFactoryTest1._mf_y ) );
    assertEquals( 29, sv.get( ValueFactoryTest1._mf_z ) );
  }
View Full Code Here

Examples of org.apache.etch.bindings.java.msg.StructValue

 
  /** */
  @org.junit.Test
  public void test_S1_import()
  {
    StructValue sv = new StructValue( ValueFactoryTest1._mt_org_apache_etch_tests_Test1_S1, vf );
    sv.put( ValueFactoryTest1._mf_x, 101 );
    sv.put( ValueFactoryTest1._mf_y, 103 );
    sv.put( ValueFactoryTest1._mf_z, 107 );
    S1 s = (S1) vf.importCustomValue( sv );
    assertEquals( 101, s.x );
    assertEquals( 103, s.y );
    assertEquals( 107, s.z );
  }
View Full Code Here

Examples of org.apache.etch.bindings.java.msg.StructValue

  {
    S1 a = new S1( 21, 22, 23 );
    S1 b = new S1( 31, 32, 33 );
    E1 c = E1.A;
   
    StructValue sv = vf.exportCustomValue( new S2( a, b, c ) );
    sv.checkType( ValueFactoryTest1._mt_org_apache_etch_tests_Test1_S2 );
    assertEquals( 3, sv.size() );
   
    assertSame( a, sv.get( ValueFactoryTest1._mf_a ) );
    assertSame( b, sv.get( ValueFactoryTest1._mf_b ) );
    assertSame( c, sv.get( ValueFactoryTest1._mf_c ) );
  }
View Full Code Here

Examples of org.apache.etch.bindings.java.msg.StructValue

 
  /** */
  @org.junit.Test
  public void test_S2_import()
  {
    StructValue sv = new StructValue( ValueFactoryTest1._mt_org_apache_etch_tests_Test1_S2, vf );
   
    sv.put( ValueFactoryTest1._mf_a, new S1( 21, 22, 23 ) );
    sv.put( ValueFactoryTest1._mf_b, new S1( 31, 32, 33 ) );
    sv.put( ValueFactoryTest1._mf_c, E1.A );
   
    S2 s = (S2) vf.importCustomValue( sv );
    assertEquals( 21, s.a.x );
    assertEquals( 22, s.a.y );
    assertEquals( 23, s.a.z );
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.