Subversion Repositories DevTools

Rev

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

Rev 868 Rev 896
Line 1... Line 1...
1
package com.erggroup.buildtool.daemon;
1
package com.erggroup.buildtool.daemon;
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.MutableString;
-
 
6
import com.erggroup.buildtool.ripple.Package;
5
import com.erggroup.buildtool.ripple.Package;
7
import com.erggroup.buildtool.ripple.ReleaseManager;
6
import com.erggroup.buildtool.ripple.ReleaseManager;
8
 
7
 
9
import java.io.File;
8
import java.io.File;
10
import java.net.InetAddress;
9
import java.net.InetAddress;
Line 179... Line 178...
179
      new ReleaseManager(connectionString, username, password);
178
      new ReleaseManager(connectionString, username, password);
180
    boolean run = true;
179
    boolean run = true;
181
    MutableInt rtag_id = new MutableInt();
180
    MutableInt rtag_id = new MutableInt();
182
    MutableInt rcon_id = new MutableInt();
181
    MutableInt rcon_id = new MutableInt();
183
    MutableChar daemon_mode = new MutableChar();
182
    MutableChar daemon_mode = new MutableChar();
184
    MutableString gbebuildfilter = new MutableString();
-
 
185
    String hostname = new String("");
183
    String hostname = new String("");
186
    
184
    
187
    try
185
    try
188
    {
186
    {
189
      InetAddress local = InetAddress.getLocalHost();
187
      InetAddress local = InetAddress.getLocalHost();
Line 217... Line 215...
217
          releaseManager.queryReleaseConfig(hostname);
215
          releaseManager.queryReleaseConfig(hostname);
218
  
216
  
219
          rtag_id.value = 0;
217
          rtag_id.value = 0;
220
          rcon_id.value = 0;
218
          rcon_id.value = 0;
221
          daemon_mode.value = 'X';
219
          daemon_mode.value = 'X';
222
          gbebuildfilter.value = "";
-
 
223
  
220
  
224
          boolean moreReleasesConfigured = 
221
          boolean moreReleasesConfigured = 
225
            releaseManager.getFirstReleaseConfig(rtag_id, rcon_id, 
222
            releaseManager.getFirstReleaseConfig(rtag_id, rcon_id, 
226
                                                 daemon_mode, gbebuildfilter);
223
                                                 daemon_mode);
227
  
224
  
228
          do
225
          do
229
          {
226
          {
230
            if (moreReleasesConfigured)
227
            if (moreReleasesConfigured)
231
            {
228
            {
232
              if (!isActive(rcon_id.value))
229
              if (!isActive(rcon_id.value))
233
              {
230
              {
234
                mLogger.warn("BuildDaemon activating " + rtag_id.value + " " + rcon_id.value + " " + daemon_mode.value + " " + gbebuildfilter.value);
231
                mLogger.warn("BuildDaemon activating " + rtag_id.value + " " + rcon_id.value + " " + daemon_mode.value);
-
 
232
                
-
 
233
                String utf = null;
-
 
234
                
-
 
235
                if ( connectionString.compareTo("unit test spawn thread") == 0 )
-
 
236
                {
-
 
237
                  utf = connectionString;
-
 
238
                }
235
                
239
                
236
                // spawn and run the BuildThread
240
                // spawn and run the BuildThread
237
                if (daemon_mode.value == 'M')
241
                if (daemon_mode.value == 'M')
238
                {
242
                {
239
                  MasterThread thread = new MasterThread(rtag_id.value, rcon_id.value, gbebuildfilter.value);
243
                  MasterThread thread = new MasterThread(rtag_id.value, rcon_id.value, utf);
240
                  ThreadIdentifier threadIdentifier = 
244
                  ThreadIdentifier threadIdentifier = 
241
                    new ThreadIdentifier(rcon_id.value, thread);
245
                    new ThreadIdentifier(rcon_id.value, thread);
242
                  mThreadCollection.add(threadIdentifier);
246
                  mThreadCollection.add(threadIdentifier);
243
                  // begin thread execution and invoke thread.run();
247
                  // begin thread execution and invoke thread.run();
244
                  thread.start();
248
                  thread.start();
245
                }
249
                }
246
                else if (daemon_mode.value == 'S')
250
                else if (daemon_mode.value == 'S')
247
                {
251
                {
248
                  SlaveThread thread = new SlaveThread(rtag_id.value, rcon_id.value, gbebuildfilter.value);
252
                  SlaveThread thread = new SlaveThread(rtag_id.value, rcon_id.value, utf);
249
                  ThreadIdentifier threadIdentifier = 
253
                  ThreadIdentifier threadIdentifier = 
250
                    new ThreadIdentifier(rcon_id.value, thread);
254
                    new ThreadIdentifier(rcon_id.value, thread);
251
                  mThreadCollection.add(threadIdentifier);
255
                  mThreadCollection.add(threadIdentifier);
252
                  // begin thread execution and invoke thread.run();
256
                  // begin thread execution and invoke thread.run();
253
                  thread.start();
257
                  thread.start();
254
                }
258
                }
255
              }
259
              }
256
  
260
  
257
              moreReleasesConfigured = 
261
              moreReleasesConfigured = 
258
                  releaseManager.getNextReleaseConfig(rtag_id, rcon_id, 
262
                  releaseManager.getNextReleaseConfig(rtag_id, rcon_id, 
259
                                                      daemon_mode, gbebuildfilter);
263
                                                      daemon_mode);
260
            }
264
            }
261
          }
265
          }
262
          while (moreReleasesConfigured);
266
          while (moreReleasesConfigured);
263
  
267
  
264
          if ( connectionString.compareTo("unit test spawn thread") == 0)
268
          if ( connectionString.compareTo("unit test spawn thread") == 0)