Hi,
I'm trying to understand how gfv2 implements deployment (jsr88). I understand that you can provide a callback event by registering progress listeners from progress object when deploying an application:
===========================================================
Custom code:
ProgressObject progress = deploymentManager.distribute(targets,
new File(file), null);
progress.addProgressListener(progressListener);
===========================================================
SunDeploymentManager.java (Line 1339):
ProgressObject deploy(Target[] targetList,
AbstractArchive moduleArchive, AbstractArchive planArchive, Properties presetOptions)
throws IllegalStateException {
...
progressObj = getDeploymentFacility().deploy(targetList, moduleArchive, planArchive, options);
}
===========================================================
DeploymentFacilityImpl.java (Line 167)
public JESProgressObject deploy(Target[] targets, Archive source, Archive deploymentPlan, Map deploymentOptions) {
...
ProgressObjectImpl progressObject = new DeployAction(targetList);
...
progressObject.setCommand(CommandType.DISTRIBUTE, args);
Thread newThread = new Thread(progressObject);
newThread.start();
return progressObject;
}
===========================================================
How does glassfish prevent race condition from happening when running DeploymentFacilityImpl.deploy (as new thread is created and started before you could attach progress listeners)?
Cheers.
[Message sent by forum member 'lyeung' (lyeung)]
http://forums.java.net/jive/thread.jspa?messageID=264553