Lines 445-482
Link Here
|
445 |
|
445 |
|
446 |
@Override |
446 |
@Override |
447 |
public void operationStateChanged(OperationState newState, String message) { |
447 |
public void operationStateChanged(OperationState newState, String message) { |
448 |
if (OperationState.COMPLETED.equals(newState)) { |
448 |
if (newState == OperationState.RUNNING) { |
449 |
// Make sure the server really is ready before we |
449 |
// wait for the profiler agent to initialize |
450 |
// advertise that it is ready |
450 |
int t = 0; |
|
|
451 |
Logger.getLogger("glassfish-javaee").log(Level.FINE,"t == {0}", t); // NOI18N |
452 |
|
453 |
// Leave as soon as the profiler reaches state STATE_BLOCKING - |
454 |
// we need the ant execution thread to for the profiler client; |
455 |
// Note: It does not make sense to wait for STATE_RUNNING or STATE_PROFILING |
456 |
// as the profiler won't reach them unless the client is connected |
451 |
try { |
457 |
try { |
452 |
int t = 0; |
458 |
while (!(ProfilerSupport.getState() == ProfilerSupport.STATE_BLOCKING) |
453 |
Logger.getLogger("glassfish-javaee").log(Level.FINE,"t == {0}", t); // NOI18N |
459 |
&& t < 30000) { |
454 |
|
|
|
455 |
// Wait for the profiler to start completely... |
456 |
while (!(ProfilerSupport.getState() == ProfilerSupport.STATE_PROFILING) && |
457 |
t < 30000) { |
458 |
Thread.sleep(1000); |
460 |
Thread.sleep(1000); |
459 |
t += 1000; |
461 |
t += 1000; |
460 |
Logger.getLogger("glassfish-javaee").log(Level.FINE,"t.1 == {0}", t); // NOI18N |
462 |
Logger.getLogger("glassfish-javaee").log(Level.FINE, "t.1 == {0}", t); // NOI18N |
461 |
} |
463 |
} |
462 |
|
|
|
463 |
int port = Integer.parseInt(ip.getProperty(GlassfishModule.ADMINPORT_ATTR)); |
464 |
// Wait for the admin port to be 'running' |
465 |
while (//!Hk2PluginProperties.isRunning(ip.getProperty(GlassfishModule.HOSTNAME_ATTR), |
466 |
// ip.getProperty(GlassfishModule.ADMINPORT_ATTR)) && |
467 |
!org.netbeans.modules.glassfish.spi.Utils.isLocalPortOccupied(port) && |
468 |
t < 60000) { |
469 |
Thread.sleep(1000); |
470 |
t += 1000; |
471 |
Logger.getLogger("glassfish-javaee").log(Level.FINE,"t.2 == {0}", t); // NOI18N |
472 |
} |
473 |
Logger.getLogger("glassfish-javaee").log(Level.FINE, "t.3 == {0}", t); // NOI18N |
474 |
} catch (InterruptedException ex) { |
464 |
} catch (InterruptedException ex) { |
|
|
465 |
Thread.currentThread().interrupt(); |
475 |
} |
466 |
} |
476 |
} |
467 |
} |
477 |
fireHandleProgressEvent(null, new Hk2DeploymentStatus( |
468 |
fireHandleProgressEvent(null, new Hk2DeploymentStatus( |
478 |
CommandType.START, translateState(newState), ActionType.EXECUTE, |
469 |
CommandType.START, translateState(newState), ActionType.EXECUTE, |
479 |
message)); |
470 |
message)); |
480 |
} |
471 |
} |
481 |
}, jdkRoot, settings.getJvmArgs()); |
472 |
}, jdkRoot, settings.getJvmArgs()); |
482 |
} |
473 |
} |