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

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


    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 );

    mt_response = new Type( "_Etch_KeepAliveResp" );
    vf.addType( mt_response );
   
    mt_request.setResult( mt_response );
  }
View Full Code Here


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

    mt_request = new Type( "_Etch_PwAuthReq" );
    mt_response = new Type( "_Etch_PwAuthResp" );
   
    vf.addType( mt_request );
    vf.addType( mt_response );
   
    mf_user = new Field( "user" );
View Full Code Here

      types.get( ETCH_AUTH_EXCEPTION_TYPE_NAME ), class2type );

    // ------------------ _mt__Etch_AuthException ------------------
   
    {
      final Type t = types.get( ETCH_EXCEPTION_MESSAGE_NAME );
      t.putValidator( _mf_result, Validator_RuntimeException.get() );
      t.putValidator( _mf__messageId, Validator_long.get( 0 ) );
      t.putValidator( _mf__inReplyTo, Validator_long.get( 0 ) );
    }
  }
View Full Code Here

 
  private ValueFactory[] mixins = {};
 
  public final Type getType( Integer id )
  {
    Type type = types.get( id );
    if (type != null)
      return type;
   
    for (ValueFactory vf: mixins)
      if ((type = vf.getType( id )) != null)
View Full Code Here

    }
  }

  public final Type getType( String name )
  {
    Type type = types.get( name );
    if (type != null)
      return type;
   
    for (ValueFactory vf: mixins)
      if ((type = vf.getType( name )) != null)
View Full Code Here

  public final StructValue exportCustomValue( Object value )
  {
    Class<?> clss = value.getClass();
   
    Type type = getCustomStructType( clss );
   
    if (type == null && clss == StructValue.class)
    {
      StructValue struct = (StructValue) value;
      type = struct.type();
    }
   
    if (type == null)
    {
      if (Throwable.class.isAssignableFrom( clss ))
        type = _mt__Etch_RuntimeException;
      else if (List.class.isAssignableFrom( clss ))
        type = _mt__Etch_List;
      else if (Map.class.isAssignableFrom( clss ))
        type = _mt__Etch_Map;
      else if (Set.class.isAssignableFrom( clss ))
        type = _mt__Etch_Set;
      else
        return null;
    }
   
    ImportExportHelper helper = type.getImportExportHelper();
   
    if (helper == null)
      return null;
   
    return helper.exportValue( this, value );
View Full Code Here

    return helper.importValue( struct );
  }

  public final Type getCustomStructType( Class<?> c )
  {
    Type type = class2type.get( c );
    if (type != null)
      return type;
   
    for (ValueFactory vf: mixins)
      if ((type = vf.getCustomStructType( c )) != null)
View Full Code Here

  }

  private void readKeysAndValues( StructValue sv )
    throws IOException
  {
    Type t = sv.type();
    while (true)
    {
      Field key = readField( t );
      if (key == null)
        break;
     
      Validator v = t.getValidator( key );
      if (v != null)
      {
        sv.put( key, readValue( v ) );
      }
      else
View Full Code Here

      throw new IOException(
        String.format(
          "binary tagged data version mismatch: got %d expected %d",
          version, VERSION ) );
   
    Type t = readType();
    int length = readLength();
   
    return new Message( t, vf, length );
  }
View Full Code Here

    // nothing to do, readKeysAndValues swallowed the NONE.
  }

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

TOP

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

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.