Package org.apache.etch.bindings.java.msg

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


//    Log.report( "KeepAliveInstalled",
//      "delay", delay, "count", count, "server", server );
   
    vf = (ValueFactory) resources.get( Transport.VALUE_FACTORY );

    mf_delay = new Field( "delay" );
    mf_count = new Field( "count" );
   
    mt_request = new Type( "_Etch_KeepAliveReq" );
    mt_request.putValidator( mf_delay, Validator_int.get( 0 ) );
    mt_request.putValidator( mf_count, Validator_int.get( 0 ) );
    vf.addType( mt_request );
View Full Code Here


    mt_response = new Type( "_Etch_PwAuthResp" );
   
    vf.addType( mt_request );
    vf.addType( mt_response );
   
    mf_user = new Field( "user" );
    mf_password = new Field( "password" );
    mf_ok = new Field( "ok" );
    mf_status = new Field( "status" );
   
    mt_request.putValidator( mf_user, Validator_string.get( 0 ) );
    mt_request.putValidator( mf_password, Validator_string.get( 0 ) );
    mt_request.setResult( mt_response );
    mt_request.lock();
View Full Code Here

   * @param type
   * @param class2type
   */
  public static void init( Type type, Class2TypeMap class2type )
  {
    Field field = type.getField( FIELD_NAME );
    class2type.put( _Etch_AuthException.class, type );
    type.setComponentType( _Etch_AuthException.class );
    type.setImportExportHelper( new AuthExceptionSerializer( type, field ) );
    type.putValidator( field, Validator_string.get( 0 ) );
    type.lock();
View Full Code Here

   * @param type
   * @param class2type
   */
  public static void init( Type type, Class2TypeMap class2type )
  {
    Field field = type.getField( FIELD_NAME );
    class2type.put( _Etch_RuntimeException.class, type );
    type.setComponentType( _Etch_RuntimeException.class );
    type.setImportExportHelper( new RuntimeExceptionSerializer( type, field ) );
    type.putValidator( field, Validator_string.get( 0 ) );
    type.lock();
View Full Code Here

    throws IOException
  {
    Type t = sv.type();
    while (true)
    {
      Field key = readField( t );
      if (key == null)
        break;
     
      Validator v = t.getValidator( key );
      if (v != null)
View Full Code Here

      return null;
   
    if (obj instanceof Integer)
    {
      Integer id = (Integer) obj;
      Field field = type.getField( id );
     
      if (field == null)
        field = new Field( id, id.toString() );
     
      return field;
    }
   
    Assertion.check( obj instanceof String, "obj instanceof String" );
    String name = (String) obj;
    Field field = type.getField( name );
   
    if (field == null)
      field = new Field( name );
   
    return field;
  }
View Full Code Here

  private void writeKeysAndValues( StructValue sv ) throws IOException
  {
    Type t = sv.type();
    for (Map.Entry<Field, Object> me: sv)
    {
      Field f = me.getKey();
      writeField( f );
      writeValue( t.getValidator( f ), me.getValue() );
    }
  }
View Full Code Here

    assertEquals( "msg.size", n, svc.xmsg.size() );
//    System.out.println("size = " + svc.xmsg.size());
   
    for (int i = 0; i < n; i++)
    {
      Field f = fields[i];
      assertEquals( "object_"+i, objects[i], svc.xmsg.get( f ) );
    }
   
    assertSame( "resultType", resultType, svc.xresponseType );
    assertSame( "responseField", ValueFactoryTest1._mf_result, svc.xresponseField );
View Full Code Here

    assertTrue( session.up );
   
    assertSame( What.TRANSPORT_MESSAGE, transport.what );
    Message msg = transport.msg;
    assertEquals( "_Etch_PwAuthReq", msg.type().getName() );
    assertEquals( "fred", msg.get( new Field( "user" ) ) );
    assertEquals( "1234", msg.get( new Field( "password" ) ) );
  }
View Full Code Here

    assertTrue( session.up );
   
    assertSame( What.TRANSPORT_MESSAGE, transport.what );
    Message msg = transport.msg;
    assertEquals( "_Etch_PwAuthReq", msg.type().getName() );
    assertEquals( "fred", msg.get( new Field( "user" ) ) );
    assertEquals( "2345", msg.get( new Field( "password" ) ) );
  }
View Full Code Here

TOP

Related Classes of org.apache.etch.bindings.java.msg.Field

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.