Search in sources :

Example 1 with ProgressStatusMirroringImpl

use of org.glassfish.api.admin.progress.ProgressStatusMirroringImpl 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;
}
Also used : ProgressStatusEventCreateChild(org.glassfish.api.admin.progress.ProgressStatusEventCreateChild) ProgressStatusMirroringImpl(org.glassfish.api.admin.progress.ProgressStatusMirroringImpl)

Example 2 with ProgressStatusMirroringImpl

use of org.glassfish.api.admin.progress.ProgressStatusMirroringImpl in project Payara by payara.

the class CommandProgressImplTest method testCreateMirroringChild.

// @BeforeClass
// public static void setUpClass() throws Exception {
// }
// 
// @AfterClass
// public static void tearDownClass() throws Exception {
// }
@Test
public void testCreateMirroringChild() {
    CommandProgressImpl cp = new CommandProgressImpl("first", "a");
    cp.setTotalStepCount(2);
    ProgressStatusMirroringImpl ch1 = cp.createMirroringChild(1);
    assertNotNull(ch1);
    ProgressStatus ch2 = cp.createChild(1);
    assertNotNull(ch1);
    assertTrue(ch2 instanceof ProgressStatusImpl);
}
Also used : ProgressStatus(org.glassfish.api.admin.ProgressStatus) ProgressStatusMirroringImpl(org.glassfish.api.admin.progress.ProgressStatusMirroringImpl) ProgressStatusImpl(org.glassfish.api.admin.progress.ProgressStatusImpl) Test(org.junit.Test)

Aggregations

ProgressStatusMirroringImpl (org.glassfish.api.admin.progress.ProgressStatusMirroringImpl)2 ProgressStatus (org.glassfish.api.admin.ProgressStatus)1 ProgressStatusEventCreateChild (org.glassfish.api.admin.progress.ProgressStatusEventCreateChild)1 ProgressStatusImpl (org.glassfish.api.admin.progress.ProgressStatusImpl)1 Test (org.junit.Test)1