Package org.gudy.azureus2.plugins.logging

Examples of org.gudy.azureus2.plugins.logging.LoggerChannel


         
          Map  channel_map = getChannelMap( ci );

          final String  name = (String)args.get(1);
         
          LoggerChannel  channel = (LoggerChannel)channel_map.get(name);
         
          if ( channel == null ){
           
            ci.out.println( "> Channel '" + name + "' not found" );
           
          }else if ( channel_listener_map.get(name) != null ){
           
            ci.out.println( "> Channel '" + name + "' already being logged" );

          }else{
           
            LoggerChannelListener  l =
              new LoggerChannelListener()
              {
                public void
                messageLogged(
                  int    type,
                  String  content )
                {
                  ci.out.println( "["+name+"] "+ content );
                }
               
                public void
                messageLogged(
                  String    str,
                  Throwable  error )
                {
                  ci.out.println( "["+name+"] "+ str );
                 
                  error.printStackTrace( ci.out );
                }
              };
             
            channel.addListener( l );
           
            channel_listener_map.put( name, new Object[]{ channel, l });
           
            ci.out.println( "> Channel '" + name + "' on" );
          }
View Full Code Here


 
  public LoggerChannel
  getChannel(
    String    name )
  {
    LoggerChannel  channel = new LoggerChannelImpl( this, name, false, false );
   
    channels.add( channel );
   
    return( channel );
  }
View Full Code Here

 
  public LoggerChannel
  getTimeStampedChannel(
    String    name )
  {
    LoggerChannel  channel = new LoggerChannelImpl( this, name, true, false );
   
    channels.add( channel );
   
    return( channel );
  }
View Full Code Here

 
  public LoggerChannel
  getNullChannel(
    String    name )
  {
    LoggerChannel  channel = new LoggerChannelImpl( this, name, true, true );
   
    channels.add( channel );
   
    return( channel );
  }
View Full Code Here

                {
                   
           
                    try
                    {
                        LoggerChannel logger =View.getPluginInterface().getLogger().getTimeStampedChannel("AZCVSUpdater");
                       
                        UpdateManager um = View.getPluginInterface().getUpdateManager();
                        UpdateInstaller updateInstaller = um.createInstaller();   
                       
                                                
                            File from = new File (complete_file_from);
                            if(!from.isFile())
                            {
                                StatusBoxUtils.mainStatusAdd(" Could not update because " + from.getName() " is not a real file",2);
                            }
                            //System.out.println("AZCVSUpdater:  One File Restart/Exit Action");
                            //System.out.println("From: " + from.getPath() + " To: " + complete_file_to);
                           
                            //updateInstaller.addResource("azcvsupdater_restart_stream" , new FileInputStream (from));
                            updateInstaller.addMoveAction(complete_file_from , complete_file_to);
                           
       
                                                   
                        //System.out.println("AZCVSUpdater:  Sleeping for 5 seconds to ensure all has completed, because Tim says my plugin is lazy ;)");
                        logger.log("Sleeping for 5 seconds to ensure all has completed");
                        Thread.sleep(5000);
                        um.applyUpdates(restart);
                        logger.log("Still here.. even after um.applyUpdates :*(");       
                   
                    }
                    catch (Exception e)
                    {
                        StatusBoxUtils.mainStatusAdd(" Major Error Inserting/Restarting please report to omschaub@users.sourceforge.net",2);
View Full Code Here

  public MessageStreamEncoderAdapter( MessageStreamEncoder plug_encoder ) {
    this.plug_encoder = plug_encoder;
  }
 
  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 {
View Full Code Here

 
    throws MessageException
  {
    if ( incoming ){
     
      throw( new MessageException( "Already connected" ));
    }
   
    if ( connecting ){
     
      throw( new MessageException( "Connect already performed" ));
    }
   
    connecting  = true;
   
    if ( closed ){
     
      throw( new MessageException( "Connection has been closed" ));
    }
   
    InetSocketAddress  tcp_ep = endpoint.getTCP();
       
    if ( tcp_ep != null ){
     
      connectTCP( initial_data, tcp_ep );
     
    }else{
     
      InetSocketAddress  udp_ep = endpoint.getUDP();

      if ( udp_ep != null ){
       
        connectUDP( initial_data, udp_ep, false );
       
      }else{
       
        throw( new MessageException( "No protocols availabld" ));
      }
    }
  }
View Full Code Here

                delegate.close();
               
              }catch( Throwable e ){
              }
             
              reportFailed( new MessageException( "Connection has been closed" ));

            }else{
             
              reportConnected();
            }
View Full Code Here

              final InetSocketAddress  target,
              Map            reply )
            {
              if ( closed ){
                             
                reportFailed( new MessageException( "Connection has been closed" ));

              }else{
               
                connect_method_count++;

                if ( TEST_TUNNEL ){
                 
                  initial_data.rewind();
                 
                  connectTunnel( initial_data, gen_udp, rendezvous, target );
                 
                }else{
               
                  udp_delegate.connect(
                      initial_data,
                      new GenericMessageConnectionAdapter.ConnectionListener()
                      {
                        private boolean  connected;
                       
                        public void
                        connectSuccess()
                        {
                          connected  = true;
                         
                          setDelegate( udp_delegate );
                         
                          if ( closed ){
                           
                            try{
                              delegate.close();
                             
                            }catch( Throwable e ){                         
                            }
                           
                            reportFailed( new MessageException( "Connection has been closed" ));
                           
                          }else{
                           
                            reportConnected();
                          }                       
                        }
                       
                        public void
                        connectFailure(
                          Throwable failure_msg )
                        {
                          if ( connected ){
                           
                            reportFailed( failure_msg );
                           
                          }else{
                           
                            initial_data.rewind();
 
                            connectTunnel( initial_data, gen_udp, rendezvous, target );
                          }
                        }
                      });
                }
              }
            }
           
            public void
            failed(
              int      failure_type )
            {
              reportFailed( new MessageException( "UDP connection attempt failed - NAT traversal failed (" + NATTraversalObserver.FT_STRINGS[ failure_type ] + ")"));
            }
           
            public void
            failed(
              Throwable   cause )
            {
              reportFailed( cause );
            }
           
            public void
            disabled()
            {
              reportFailed( new MessageException( "UDP connection attempt failed as DDB is disabled" ));
            }
          });
    }else{
 
      udp_delegate.connect(
          initial_data,
          new GenericMessageConnectionAdapter.ConnectionListener()
          {
            private boolean  connected;
           
            public void
            connectSuccess()
            {
              connected  = true;
             
              setDelegate( udp_delegate );
             
              if ( closed ){
               
                try{
                  delegate.close();
                 
                }catch( Throwable e ){ 
                }
               
                reportFailed( new MessageException( "Connection has been closed" ));

              }else{
               
                reportConnected();
              }
View Full Code Here

               
              }catch( Throwable e ){
               
              }
             
              reportFailed( new MessageException( "Connection has been closed" ));

            }else{
             
              reportConnected();
            }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.logging.LoggerChannel

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.