Package org.osgi.service.coordinator

Examples of org.osgi.service.coordinator.Coordination.end()


            ReporterLogService log = new ReporterLogService(Central.getWorkspace());
            Map<Resource,List<Wire>> wirings = resolve.resolveRequired(model, Central.getWorkspace(), felixResolver, callbacks, log);
            result = new ResolutionResult(Outcome.Resolved, wirings, null, status, logger.getLog());
            if (coordination != null)
                coordination.end();
        } catch (ResolveCancelledException e) {
            result = new ResolutionResult(Outcome.Cancelled, null, null, status, logger.getLog());

            if (coordination != null)
                coordination.fail(e);
View Full Code Here


            ReporterLogService log = new ReporterLogService(Central.getWorkspace());
            Map<Resource,List<Wire>> wirings = resolve.resolveRequired(model, Central.getWorkspace(), bndResolver, callbacks, log);
            result = new ResolutionResult(Outcome.Resolved, wirings, null, status, logger.getLog());
            if (coordination != null)
                coordination.end();
        } catch (ResolveCancelledException e) {
            result = new ResolutionResult(Outcome.Cancelled, null, null, status, logger.getLog());

            if (coordination != null)
                coordination.fail(e);
View Full Code Here

        assertNull(coordinator.peek());

        assertFalse(c1.fail(new Exception()));
        try
        {
            c1.end();
            fail("Expected CoordinationException.FAILED on end() after fail()");
        }
        catch (CoordinationException ce)
        {
            // expected failed
View Full Code Here

        assertNull(coordinator.peek());
        assertNull(c2.getFailure());
        assertFalse(c2.isTerminated());
        assertTrue(c2.getParticipants().isEmpty());

        c2.end();
        assertNull(c2.getFailure());
        assertTrue(c2.isTerminated());
        assertNull(coordinator.peek());

        assertFalse(c2.fail(new Exception()));
View Full Code Here

        assertNull(coordinator.peek());

        assertFalse(c2.fail(new Exception()));
        try
        {
            c2.end();
            fail("Expected CoordinationException.ALREADY_ENDED on second end()");
        }
        catch (CoordinationException ce)
        {
            // expected already terminated
View Full Code Here

        assertNull(coordinator.peek());
        c1.push();
        assertEquals(c1, coordinator.peek());

        c1.end();
        assertNull(coordinator.peek());

        final Coordination c2 = coordinator.begin(name, 0);
        assertNotNull(c2);
        assertEquals(name, c2.getName());
View Full Code Here

        assertEquals(name, c2.getName());
        assertEquals(c2, coordinator.peek());
        c2.fail(new Exception());
        assertNotNull(coordinator.peek());
        try {
            c2.end();
            fail("Exception should be thrown");
        } catch (CoordinationException ce) {
            // ignore
        }
        assertNull(coordinator.peek());
View Full Code Here

        final Coordination c2 = coordinator.begin(name, 0);
        assertNotNull(c2);
        assertEquals(name, c2.getName());
        assertEquals(c2, coordinator.peek());

        c2.end();
        assertEquals(c1, coordinator.peek());

        c1.end();
        assertNull(coordinator.peek());
    }
View Full Code Here

        c1.end();
        assertNull(coordinator.peek());

        try
        {
            c2.end();
            fail("c2 is already terminated");
        }
        catch (CoordinationException ce)
        {
            assertEquals(CoordinationException.ALREADY_ENDED, ce.getType());
View Full Code Here

        final MockParticipant p1 = new MockParticipant();
        c1.addParticipant(p1);
        assertTrue(c1.getParticipants().contains(p1));
        assertEquals(1, c1.getParticipants().size());

        c1.end();
        assertTrue(p1.ended);
        assertFalse(p1.failed);
        assertEquals(c1, p1.c);

        // assert order of call
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.