FileDocCategorySizeDatePackage
MessageStreamEncoderAdapter.javaAPI DocAzureus 3.0.3.42164Fri Feb 16 16:30:44 GMT 2007org.gudy.azureus2.pluginsimpl.local.messaging

MessageStreamEncoderAdapter

public class MessageStreamEncoderAdapter extends Object implements com.aelitis.azureus.core.peermanager.messaging.MessageStreamEncoder

Fields Summary
private final org.gudy.azureus2.plugins.messaging.MessageStreamEncoder
plug_encoder
Constructors Summary
public MessageStreamEncoderAdapter(org.gudy.azureus2.plugins.messaging.MessageStreamEncoder plug_encoder)

    this.plug_encoder = plug_encoder;
  
Methods Summary
public com.aelitis.azureus.core.networkmanager.RawMessage[]encodeMessage(com.aelitis.azureus.core.peermanager.messaging.Message message)

    Message plug_msg;
    
    if( message instanceof MessageAdapter ) {  //original message created by plugin, unwrap
      plug_msg = ((MessageAdapter)message).getPluginMessage();
    }
    else {
      plug_msg = new MessageAdapter( message );  //core created
    }
    
    RawMessage raw_plug = plug_encoder.encodeMessage( plug_msg );
    return new com.aelitis.azureus.core.networkmanager.RawMessage[]{ new RawMessageAdapter( raw_plug )};