Subversion Repositories DevTools

Rev

Rev 1354 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1354 Rev 1361
Line 62... Line 62...
62
    private final int mRcon_id;
62
    private final int mRcon_id;
63
 
63
 
64
    /**thread identifier
64
    /**thread identifier
65
     * @attribute
65
     * @attribute
66
     */
66
     */
67
    private final Thread mThread;
67
    private final BuildThread mThread;
68
 
68
 
69
    /**constructor
69
    /**constructor
70
     */
70
     */
71
    ThreadIdentifier(int rcon_id, Thread thread)
71
    ThreadIdentifier(int rcon_id, BuildThread thread)
72
    {
72
    {
73
      mLogger.debug("ThreadIdentifier " + rcon_id);
73
      mLogger.debug("ThreadIdentifier " + rcon_id);
74
      mRcon_id = rcon_id;
74
      mRcon_id = rcon_id;
75
      mThread = thread;
75
      mThread = thread;
76
    }
76
    }
Line 84... Line 84...
84
      return mRcon_id;
84
      return mRcon_id;
85
    }
85
    }
86
 
86
 
87
    /**accessor
87
    /**accessor
88
     */
88
     */
89
    Thread get_thread()
89
    BuildThread get_thread()
90
    {
90
    {
91
      mLogger.debug("get_thread");
91
      mLogger.debug("get_thread");
92
      return mThread;
92
      return mThread;
93
    }
93
    }
94
  }
94
  }
Line 213... Line 213...
213
      //
213
      //
214
      //  Start the Nagios Interface Thread
214
      //  Start the Nagios Interface Thread
215
      //
215
      //
216
      try {
216
      try {
217
        nagiosSrv = new ServerSocket(1111);
217
        nagiosSrv = new ServerSocket(1111);
218
        nagiosChecker = new NagiosThread(nagiosSrv);
218
        nagiosChecker = new NagiosThread(nagiosSrv, this);
219
        nagiosChecker.start();
219
        nagiosChecker.start();
220
      } catch ( IOException e ) {
220
      } catch ( IOException e ) {
221
            mLogger.fatal("Failed to start Nagios Service. Port already in use");
221
            mLogger.fatal("Failed to start Nagios Service. Port already in use");
222
            throw new Exception("Nagios port in use");
222
            throw new Exception("Nagios port in use");
223
      }
223
      }
Line 348... Line 348...
348
    }
348
    }
349
    mLogger.info("isActive returned " + retVal);
349
    mLogger.info("isActive returned " + retVal);
350
    return retVal;
350
    return retVal;
351
  }
351
  }
352
 
352
 
-
 
353
    /**
-
 
354
     *  Nagios interface
-
 
355
     *      Returns true if ALL the thread looks OK
-
 
356
     *      Must have one active thread
-
 
357
    */
-
 
358
    boolean checkThreads()
-
 
359
    {
-
 
360
      boolean retVal = false;
-
 
361
        mLogger.info("checkThreads called");
-
 
362
      for (Iterator<ThreadIdentifier> it = mThreadCollection.iterator(); it.hasNext(); )
-
 
363
      {
-
 
364
        ThreadIdentifier threadIdentifier = it.next();
-
 
365
 
-
 
366
        if (threadIdentifier.get_thread().checkThread())
-
 
367
        {
-
 
368
          retVal = true;
-
 
369
        }
-
 
370
        else
-
 
371
        {
-
 
372
          retVal = false;
-
 
373
          break;
-
 
374
        }
-
 
375
      }
-
 
376
 
-
 
377
      mLogger.info("checkThreads returned " + retVal);
-
 
378
      return retVal;
-
 
379
    }
-
 
380
  
-
 
381
 
353
  /**terminates all BuildThreads
382
  /**terminates all BuildThreads
354
   */
383
   */
355
  public void cleanUp()
384
  public void cleanUp()
356
  {
385
  {
357
    mLogger.debug("cleanUp");
386
    mLogger.debug("cleanUp");
Line 376... Line 405...
376
        }
405
        }
377
      }
406
      }
378
    }
407
    }
379
  }
408
  }
380
}
409
}
-
 
410