Package org.gudy.azureus2.pluginsimpl.local.utils

Examples of org.gudy.azureus2.pluginsimpl.local.utils.PooledByteBufferImpl


    props         = new propertyWrapper(_props );
    pluginDir       = _pluginDir;
    config         = new PluginConfigImpl(this,pluginConfigKey);
    given_plugin_id      = _plugin_id;
    plugin_version    = _plugin_version;
    ipc_interface      = new IPCInterfaceImpl( initialiser, plugin );
    state                 = new PluginStateImpl(this, initialiser);
   
    boolean verified   = false;
    boolean bad    = false;
   
View Full Code Here


  }
 
  public IPFilter
  getIPFilter()
  {
    return( new IPFilterImpl());
  }
View Full Code Here

 
  public Logger getLogger()
  {
    if ( logger == null ){
     
      logger = new LoggerImpl( this );
    }
   
    return( logger );
  }
View Full Code Here

    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 )};
  }
View Full Code Here

    return config;
  }


  public PluginConfigUIFactory getPluginConfigUIFactory() {
    return new PluginConfigUIFactoryImpl(config,pluginConfigKey);
  }
View Full Code Here

  {
    boolean  handled = false;
   
    for (int i=0;i<listeners.size();i++){
     
      PooledByteBuffer  buffer = new PooledByteBufferImpl(message.getPayload());
     
      try{
        ((GenericMessageConnectionListener)listeners.get(i)).receive( this, buffer );
       
        handled = true;
       
      }catch( Throwable f ){
       
        buffer.returnToPool();
       
        if ( !( f instanceof MessageException )){
       
          Debug.printStackTrace(f);
        }
View Full Code Here

    if ( !connected ){
     
      throw( new MessageException( "not connected" ));
    }
   
    PooledByteBufferImpl  impl = (PooledByteBufferImpl)data;
   
    try{
      connection.getOutgoingMessageQueue().addMessage(
          new GenericMessage( msg_id, msg_desc, impl.getBuffer(), false ), false );
     
    }catch( Throwable e ){
     
      throw( new MessageException( "send failed", e ));
    }
View Full Code Here

           
              // pick up any remaining data for delivery
           
            if ( in_buffer.hasRemaining()){
             
              message = new PooledByteBufferImpl( new DirectByteBuffer( in_buffer.slice()));
             
              forward  = true;
            }
          }
        }
      }
       
      if ( out_buffer != null ){
       
        out_buffer.flip();
       
        connection.send( new PooledByteBufferImpl( new DirectByteBuffer( out_buffer )));
      }
     
      if ( crypto_completed ){
       
        cryptoComplete();
View Full Code Here

     
      try{
        byte[]  plain  =  message.toByteArray();
        byte[]  enc    = outgoing_cipher.doFinal( plain );
     
        PooledByteBuffer  temp = new PooledByteBufferImpl( enc );
       
        try{
          connection.send( temp );
         
            // successfull send -> release caller's buffer
         
          message.returnToPool();
         
        }catch( Throwable e ){
         
            // failed semantics are to not release the caller's buffer
         
          temp.returnToPool();
         
          throw( e );
        }
       
      }catch( Throwable e ){
View Full Code Here

     
        try{
          byte[]  enc   = message.toByteArray();
          byte[]  plain   = incoming_cipher.doFinal( enc );
 
          PooledByteBuffer  temp = new PooledByteBufferImpl( plain );
 
          message.returnToPool();
         
          buffer_handled  = true;
         
          message  = temp;
         
        }catch( Throwable e ){
         
          throw( new MessageException( "Failed to decrypt data", e ));
        }
       
      }else if ( block_crypto != SESecurityManager.BLOCK_ENCRYPTION_NONE ){
       
        throw( new MessageException( "Crypto isn't setup" ));
      }
     
      List listeners_ref = listeners.getList();
     
      MessageException  last_error = null;
     
      for (int i=0;i<listeners_ref.size();i++){
       
        PooledByteBuffer  message_to_deliver;
       
        if ( i == 0 ){
         
          message_to_deliver  = message;
         
        }else{
       
            // unlikely we'll ever have > 1 receiver....
         
          message_to_deliver = new PooledByteBufferImpl( message.toByteArray());
        }
       
        try{
          ((GenericMessageConnectionListener)listeners_ref.get(i)).receive( this, message_to_deliver );
         
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.pluginsimpl.local.utils.PooledByteBufferImpl

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.