Subversion Repositories DevTools

Rev

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

Rev 924 Rev 1350
Line 2... Line 2...
2
 
2
 
3
import com.erggroup.buildtool.ripple.MutableChar;
3
import com.erggroup.buildtool.ripple.MutableChar;
4
import com.erggroup.buildtool.ripple.MutableInt;
4
import com.erggroup.buildtool.ripple.MutableInt;
5
import com.erggroup.buildtool.ripple.Package;
5
import com.erggroup.buildtool.ripple.Package;
6
import com.erggroup.buildtool.ripple.ReleaseManager;
6
import com.erggroup.buildtool.ripple.ReleaseManager;
-
 
7
import com.erggroup.buildtool.daemon.NagiosThread;
7
 
8
 
8
import java.io.File;
9
import java.io.File;
9
import java.net.InetAddress;
-
 
10
 
10
 
-
 
11
import java.net.InetAddress;
11
import java.net.UnknownHostException;
12
import java.net.UnknownHostException;
-
 
13
import java.net.ServerSocket;
12
 
14
 
13
import java.sql.SQLException;
15
import java.sql.SQLException;
14
 
16
 
15
import java.util.Iterator;
17
import java.util.Iterator;
16
import java.util.Vector;
18
import java.util.Vector;
Line 41... Line 43...
41
  /**Collection of ThreadIdentifier objects.
43
  /**Collection of ThreadIdentifier objects.
42
   * @attribute
44
   * @attribute
43
   */
45
   */
44
  private Vector<ThreadIdentifier> mThreadCollection = new Vector<ThreadIdentifier>();
46
  private Vector<ThreadIdentifier> mThreadCollection = new Vector<ThreadIdentifier>();
45
 
47
 
-
 
48
  /**Nagios
-
 
49
   * @attribute
-
 
50
   */
-
 
51
  ServerSocket nagiosSrv;
-
 
52
  NagiosThread nagiosChecker;
-
 
53
 
46
  /**mThreadCollection items
54
  /**mThreadCollection items
47
   */
55
   */
48
  private class ThreadIdentifier
56
  private class ThreadIdentifier
49
  {
57
  {
50
    /**rcon_id associated with the thread
58
    /**rcon_id associated with the thread
Line 160... Line 168...
160
        password.length() == 0)
168
        password.length() == 0)
161
    {
169
    {
162
      mLogger.fatal("Usage: java -jar abtdD.jar -c connectionString -u username -p password");
170
      mLogger.fatal("Usage: java -jar abtdD.jar -c connectionString -u username -p password");
163
      System.exit(1);
171
      System.exit(1);
164
    }
172
    }
165
    
173
 
166
    BuildDaemon buildDaemon = new BuildDaemon(connectionString, username, password);
174
    BuildDaemon buildDaemon = new BuildDaemon(connectionString, username, password);
167
    buildDaemon.cleanUp();
175
    buildDaemon.cleanUp();
168
    
176
    
169
  }
177
  }
170
 
178
 
Line 198... Line 206...
198
      if ( Package.mGbeDpkg == null )
206
      if ( Package.mGbeDpkg == null )
199
      {
207
      {
200
        mLogger.fatal("run GBE_DPKG not set");
208
        mLogger.fatal("run GBE_DPKG not set");
201
        throw new Exception("run GBE_DPKG not set");
209
        throw new Exception("run GBE_DPKG not set");
202
      }
210
      }
-
 
211
 
-
 
212
      //
-
 
213
      //  Start the Nagios Interface Thread
203
      
214
      //
-
 
215
      nagiosSrv = new ServerSocket(666);
-
 
216
      nagiosChecker = new NagiosThread(nagiosSrv);
-
 
217
      nagiosChecker.start();
204
 
218
 
205
      boolean firstTime = true;
219
      boolean firstTime = true;
206
      
220
      
207
      while (run)
221
      while (run)
208
      {
222
      {
Line 333... Line 347...
333
  /**terminates all BuildThreads
347
  /**terminates all BuildThreads
334
   */
348
   */
335
  public void cleanUp()
349
  public void cleanUp()
336
  {
350
  {
337
    mLogger.debug("cleanUp");
351
    mLogger.debug("cleanUp");
-
 
352
    nagiosChecker.terminate();
-
 
353
 
338
    for (Iterator<ThreadIdentifier> it = mThreadCollection.iterator(); it.hasNext(); )
354
    for (Iterator<ThreadIdentifier> it = mThreadCollection.iterator(); it.hasNext(); )
339
    {
355
    {
340
      ThreadIdentifier threadIdentifier = it.next();
356
      ThreadIdentifier threadIdentifier = it.next();
341
 
357
 
342
      if (threadIdentifier.get_thread().isAlive())
358
      if (threadIdentifier.get_thread().isAlive())