Package org.gudy.azureus2.core3.util

Examples of org.gudy.azureus2.core3.util.AEThread


     
      accept_server = VirtualServerChannelSelectorFactory.createBlocking( address, 0, this );
     
      accept_server.start();
         
      AEThread  read_thread =
        new AEThread( "TRTrackerServer:readSelector")
        {
          public void
          runSupport()
          {
            selectLoop( read_selector );
          }
        };
       
      read_thread.setDaemon(true);
       
      read_thread.start();
       
      AEThread  write_thread =
        new AEThread( "TRTrackerServer:writeSelector")
        {
          public void
          runSupport()
          {
            selectLoop( write_selector );
          }
        };
       
      write_thread.setDaemon(true);
       
      write_thread.start();
     
      AEThread  close_thread =
        new AEThread( "TRTrackerServer:closeScheduler")
        {
          public void
          runSupport()
          {
            closeLoop();
          }
        };
       
      close_thread.setDaemon(true);
       
      close_thread.start();
     
      Logger.log(new LogEvent(LOGID,
          "TRTrackerServer: Non-blocking listener established on port "
              + getPort()));
View Full Code Here


     * @throws IllegalArgumentException
     */
  protected final Object /*NSAppleEventDescriptor*/ executeScriptWithNewThread(
    final String scriptFormat, final Object[] params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
  {
    Thread worker = new AEThread("ScriptObject", true) {
      public void runSupport() {
        try {
          int pool = NSAutoreleasePool_push();
          long start = System.currentTimeMillis();

          String src;
          if (params == null || params.length == 0) {
            src = scriptFormat;
          } else {
            src = MessageFormat.format(scriptFormat, params);
          }   

          Debug.outNoStack("Executing: \n" + src);

          Object /*NSMutableDictionary*/ errorInfo = new_NSMutableDictionary();
          if (NSAppleScript_execute(new_NSAppleScript(src), errorInfo) == null) {
            Debug.out(String.valueOf(NSMutableDictionary_objectForKey(errorInfo, NSAppleScript_AppleScriptErrorMessage)));
            //logWarning(String.valueOf(errorInfo.objectForKey(NSAppleScript.AppleScriptErrorBriefMessage)));
          }

          Debug.outNoStack(MessageFormat.format("Elapsed time: {0}ms\n",
              new Object[] {
                new Long(System.currentTimeMillis() - start)
              }));
          NSAutoreleasePool_pop(pool);
        } catch (Throwable e) {
          Debug.out(e);
        }
      }
    };

    worker.setPriority(Thread.NORM_PRIORITY - 1);
    worker.start();

    return methNSAppleEventDescriptor_descriptorWithBoolean.invoke(null, true);
    //return NSAppleEventDescriptor.descriptorWithBoolean(true);
  }
View Full Code Here

          Debug.out(t);
        }
      }
    };

        AEThread t = new AEThread("ScriptObject", true)
        {
            public void runSupport()
            {
                scriptDispatcher.exec(worker);
            }
        };
        t.setPriority(Thread.NORM_PRIORITY - 1);
        t.start();

        return methNSAppleEventDescriptor_descriptorWithBoolean.invoke(null, true);
        //return NSAppleEventDescriptor.descriptorWithBoolean(true);
    }
View Full Code Here

            ssl_server_socket.setReuseAddress(true);
                           
            server_socket = ssl_server_socket;
           
            Thread accept_thread =
                new AEThread("TRTrackerServer:accept.loop(ssl)")
                {
                  public void
                  runSupport()
                  {
                    acceptLoop( server_socket );
                  }
                };
         
            accept_thread.setDaemon( true );
         
            accept_thread.start();                 
         
            Logger.log(new LogEvent(LOGID,
                "TRTrackerServer: SSL listener established on port "
                    + getPort()));
           
            ok  = true;
          }
         
        }catch( Throwable e){
                 
          Logger.logTextResource(new LogAlert(LogAlert.UNREPEATABLE,
              LogAlert.AT_ERROR, "Tracker.alert.listenfail"), new String[] { ""
              + getPort() });
         
          Logger.log(new LogEvent(LOGID,
              "TRTrackerServer: SSL listener failed on port " + getPort(), e));
           
          if ( e instanceof TRTrackerServerException ){
           
            throw((TRTrackerServerException)e);
           
          }else{
           
            throw( new TRTrackerServerException( "TRTrackerServer: accept fails: " + e.toString()));
          }
        }
       
      }else{
       
        try{
          ServerSocket ss;
         
          int  port = getPort();
         
          if ( _bind_ip != null ){
         
            current_bind_ip = _bind_ip;
           
            ss = new ServerSocketport, 1024, _bind_ip );

          }else if ( bind_ip == null ){
           
            ss = new ServerSocketport, 1024 );
           
          }else{
           
            current_bind_ip = bind_ip;
           
            ss = new ServerSocketport, 1024, bind_ip );
          }
         
          if ( port == 0 ){
           
            setPort( ss.getLocalPort());
          }
         
          ss.setReuseAddress(true);
         
          server_socket = ss;
         
          Thread accept_thread =
              new AEThread("TRTrackerServer:accept.loop")
              {
                public void
                runSupport()
                {
                  acceptLoop( server_socket );
                }
              };
       
          accept_thread.setDaemon( true );
       
          accept_thread.start();                 
       
          Logger.log(new LogEvent(LOGID, "TRTrackerServer: "
              + "listener established on port " + getPort()));
         
          ok  = true;
View Full Code Here

    }
   
    final String    f_category  = category;
    final String    f_props    = props;
   
    new AEThread( "shareFile" )
    {
      public void
      runSupport()
      {
        try{
View Full Code Here

        {
          public void
          initializationComplete()
          {
            Thread  t  =
              new AEThread("test")
              {
                public void
                runSupport()
                {
                 
                  testBTMessageHandler();
 
                }
              };
             
            t.setDaemon(true);
           
            t.start();
          }
         
          public void
          closedownInitiated()
          { 
View Full Code Here

    try{
      class_mon.enter();
   
      if ( singleton == null ){
       
        new AEThread( "plugin initialiser" )
        {
          public void
          runSupport()
          {
            PluginManager.registerPlugin( Test.class );
View Full Code Here

  }
 
  public void
  initializationComplete()
  {
    new AEThread("install tester" )
    {
      public void
      runSupport()
      { 
        try{
View Full Code Here

  }
 
  public void
  initializationComplete()
  {
    new AEThread("update tester" )
    {
      public void
      runSupport()
      { 
        try{
View Full Code Here

            }
          }
        }
      });
       
    new AEThread( "NetworkGlueUDP", true )
    {
      public void
      runSupport()
      {
        while( true ){
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.util.AEThread

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.