Examples of fail()


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

        } catch (ResolutionException e) {
            status.add(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, e.getLocalizedMessage(), e));
            result = new ResolutionResult(Outcome.Unresolved, null, e, status, logger.getLog());

            if (coordination != null)
                coordination.fail(e);
        } catch (Exception e) {
            status.add(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Exception during resolution.", e));
            result = new ResolutionResult(Outcome.Error, null, null, status, logger.getLog());

            if (coordination != null)
View Full Code Here

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

        } catch (Exception e) {
            status.add(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Exception during resolution.", e));
            result = new ResolutionResult(Outcome.Error, null, null, status, logger.getLog());

            if (coordination != null)
                coordination.fail(e);
        } finally {
            if (coordinator != null)
                bc.ungetService(coordSvcRef);
        }
    }
View Full Code Here

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

        assertNull(c1.getFailure());
        assertFalse(c1.isTerminated());
        assertTrue(c1.getParticipants().isEmpty());

        Exception cause = new Exception();
        assertTrue(c1.fail(cause));
        assertSame(cause, c1.getFailure());
        assertTrue(c1.isTerminated());
        assertNull(coordinator.peek());

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

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

        assertTrue(c1.fail(cause));
        assertSame(cause, c1.getFailure());
        assertTrue(c1.isTerminated());
        assertNull(coordinator.peek());

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

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

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

        assertFalse(c2.fail(new Exception()));
        try
        {
            c2.end();
            fail("Expected CoordinationException.ALREADY_ENDED on second end()");
        }
View Full Code Here

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

        final Coordination c2 = coordinator.begin(name, 0);
        assertNotNull(c2);
        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) {
View Full Code Here

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

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

        c1.fail(new Exception());
        assertFalse(p1.ended);
        assertTrue(p1.failed);
        assertEquals(c1, p1.c);

        // assert order of call
View Full Code Here

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

        c2.addParticipant(p22);
        assertTrue(c2.getParticipants().contains(p21));
        assertTrue(c2.getParticipants().contains(p22));
        assertEquals(2, c2.getParticipants().size());

        c2.fail(new Exception());
        assertTrue(p21.failed);
        assertEquals(c2, p21.c);
        assertTrue(p22.failed);
        assertEquals(c2, p22.c);
        assertTrue("p22 must be called before p21", p22.time < p21.time);
View Full Code Here

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

        c3.addParticipant(p31); // should be "ignored"
        assertTrue(c3.getParticipants().contains(p31));
        assertTrue(c3.getParticipants().contains(p32));
        assertEquals(2, c3.getParticipants().size());

        c3.fail(new Exception());
        assertTrue(p31.failed);
        assertEquals(c3, p31.c);
        assertTrue(p32.failed);
        assertEquals(c3, p32.c);
        assertTrue("p31 must be called before p32", p32.time < p31.time);
View Full Code Here

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

      result = createSubsystem(ssr);
      checkLifecyclePermission(result);
      return (BasicSubsystem)ResourceInstaller.newInstance(coordination, result, parent).install();
    }
    catch (Throwable t) {
      coordination.fail(t);
    }
    finally {
      if (!embedded) {
        try {
          coordination.end();
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.