use of org.glassfish.api.admin.progress.ProgressStatusEventCreateChild in project Payara by payara.
the class CommandProgressImpl method createMirroringChild.
@Override
public synchronized ProgressStatusMirroringImpl createMirroringChild(int allocatedSteps) {
allocateStapsForChildProcess(allocatedSteps);
String childId = (id == null ? "" : id) + "." + (children.size() + 1);
ProgressStatusMirroringImpl result = new ProgressStatusMirroringImpl(null, this, childId);
children.add(new ChildProgressStatus(allocatedSteps, result));
fireEvent(new ProgressStatusEventCreateChild(id, null, result.getId(), allocatedSteps, -1));
return result;
}
use of org.glassfish.api.admin.progress.ProgressStatusEventCreateChild in project Payara by payara.
the class ProgressStatusEventJsonProprietaryReader method readProgressStatusEvent.
public static ProgressStatusEvent readProgressStatusEvent(JsonParser jp) throws IOException {
String id = null;
JsonToken token = null;
ProgressStatusEvent result = null;
while ((token = jp.nextToken()) != JsonToken.END_OBJECT) {
if (token == JsonToken.START_OBJECT) {
String nm = jp.getCurrentName();
if ("set".equals(nm)) {
result = new ProgressStatusEventSet(id);
readToPSEventSet((ProgressStatusEventSet) result, jp);
} else if ("progres".equals(nm)) {
result = new ProgressStatusEventProgress(id);
readToPSEventProgress((ProgressStatusEventProgress) result, jp);
} else if ("complete".equals(nm)) {
result = new ProgressStatusEventComplete(id);
readToPSEventComplete((ProgressStatusEventComplete) result, jp);
} else if ("create-child".equals(nm)) {
result = new ProgressStatusEventCreateChild(id);
readToPSEventCreateChild((ProgressStatusEventCreateChild) result, jp);
}
} else {
String fieldname = jp.getCurrentName();
if ("id".equals(fieldname)) {
// move to value
jp.nextToken();
id = jp.getText();
}
}
}
return result;
}
use of org.glassfish.api.admin.progress.ProgressStatusEventCreateChild in project Payara by payara.
the class ProgressStatusClient method mirror.
/**
* Applies event on existing structures. If not appliable do nothing.
*/
public synchronized void mirror(ProgressStatusEvent event) {
if (event == null) {
return;
}
ProgressStatus effected = map.get(event.getSourceId());
ProgressStatus result = event.apply(effected);
if (event instanceof ProgressStatusEventCreateChild) {
map.put(((ProgressStatusEventCreateChild) event).getChildId(), result);
}
}
Aggregations